Re: [Webpush] [Coalesce] Concern about PUT creating a new push message

Martin Thomson <martin.thomson@gmail.com> Sat, 31 October 2015 05:45 UTC

Return-Path: <martin.thomson@gmail.com>
X-Original-To: webpush@ietfa.amsl.com
Delivered-To: webpush@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DB0591A01AA for <webpush@ietfa.amsl.com>; Fri, 30 Oct 2015 22:45:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tc0d4rQuwzEk for <webpush@ietfa.amsl.com>; Fri, 30 Oct 2015 22:45:49 -0700 (PDT)
Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 117511A0196 for <webpush@ietf.org>; Fri, 30 Oct 2015 22:45:48 -0700 (PDT)
Received: by ykek133 with SMTP id k133so96423115yke.2 for <webpush@ietf.org>; Fri, 30 Oct 2015 22:45:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=2uQWYSOdilBSVtjJ3jrvlYIKh0wLCSMFN4v3mrWm4qo=; b=UbC5XvSwUStsT3FcMqhzgQHmzLkee78e4ysFtiLTlle99/5KW+0u/0NQeZ1uisVmQy I8RIhmdE1X1SDKba2J0rKAAutMVptXy1Bgku7KJA2+aWH1B37JmTRo1W4FJp9BF+3Qqu snHTYnuWEKTDB+j58628FN1jjoF0nbjOAOzbp84E1MN0y4S5PAqO4Rt3ZtMLem2crg5F vWyzdbr+dPWRSCtFXinaH0sRzOVV5TazQUPSb2c53e/TBVL0APbuhk9lNmA7MQd/HxNH 0Fb+EFtidsg9Ku4tVST+OnPwT8wZeMs93fVzTXMlO6S4dSLv8EJk1ULnRZLaQTcI3LmN 3CzQ==
MIME-Version: 1.0
X-Received: by 10.129.79.132 with SMTP id d126mr8898015ywb.159.1446270348373; Fri, 30 Oct 2015 22:45:48 -0700 (PDT)
Received: by 10.129.132.145 with HTTP; Fri, 30 Oct 2015 22:45:48 -0700 (PDT)
In-Reply-To: <CABp8EuJnrWph1Kj3W8pg0Sh8TE0HkDkL1CtkDTjK=y9agavHeg@mail.gmail.com>
References: <BN1PR0301MB06266C1F50CF432338E98764CB2F0@BN1PR0301MB0626.namprd03.prod.outlook.com> <CABp8EuJnrWph1Kj3W8pg0Sh8TE0HkDkL1CtkDTjK=y9agavHeg@mail.gmail.com>
Date: Sat, 31 Oct 2015 14:45:48 +0900
Message-ID: <CABkgnnUJFNLb6ocT1OEzTEsKniP0XYsuaqrxsCUGqDhHZH5OaA@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
To: Benjamin Bangert <bbangert@mozilla.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <http://mailarchive.ietf.org/arch/msg/webpush/Pu6EID9IaKfryNXxO7zpeHD86q8>
Cc: Brian Raymor <Brian.Raymor@microsoft.com>, "webpush@ietf.org" <webpush@ietf.org>, Elio Damaggio <elioda@microsoft.com>
Subject: Re: [Webpush] [Coalesce] Concern about PUT creating a new push message
X-BeenThere: webpush@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of potential IETF work on a web push protocol <webpush.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/webpush>, <mailto:webpush-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/webpush/>
List-Post: <mailto:webpush@ietf.org>
List-Help: <mailto:webpush-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/webpush>, <mailto:webpush-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 31 Oct 2015 05:45:51 -0000

There is an alternative, which is to have the collapse be a POST to a
push message URL.  If the message is present, the contents are
updated, if the message was acknowledged, then a new message is
created.  Would that work?

The only real downside to this is that it isn't idempotent.

On 31 October 2015 at 07:16, Benjamin Bangert <bbangert@mozilla.com> wrote:
> I implemented this feature in our system and decided that I'd 404 the
> request. The app-server will have to re-send it as a new request, but the
> logic involved in making a new message (where it's found that we can't
> update it) was complex enough that it was cheaper to push the retry to the
> app-server.
>
> Your second point still exists. If a client has pulled the message, but not
> deleted it when the app-server sends an update then there's two possible
> behaviors:
> 1) The new message the app-server sent in just got deleted
> 2) The delete is ignored because its not the same message anymore
>
> In our case we choose option #2, the delete is ignored. We also don't plan
> on generating a receipt for the failed delete, and when the updated message
> is delivered, then the delete for it will work and the receipt will be sent.
>
> I implemented this by tracking an additional internal message-id that is
> replaced everytime the message is updated, this prevents a client from
> deleting a message it got if it was just updated by the app-server.
>
> The side-effect of all this, is that a client will process multiple messages
> and send only the last receipt. I don't think that's too horrible because
> its an edge-case, it seems unlikely that it'll be common for an app-server
> to send in an update at just the right time for this.
>
> The logical slot is the unique message ID URL, which seemed adequate.
>
> Cheers,
> Ben
>
>
> On Fri, Oct 30, 2015 at 1:32 PM, Elio Damaggio <elioda@microsoft.com> wrote:
>>
>> Hi,
>>
>>
>>
>> Reviewing the current proposal for coalescing, I noticed this sentence.
>>
>>
>>
>> +          However, a push service is encouraged
>>
>> +          to treat an update for a removed push message as though the
>> message
>>
>> +          were still present and consequently send the push message to
>> the user
>>
>> +          agent.  Permitting an update avoids the additional request
>> required to
>>
>> +          retry and the associated delays.
>>
>>
>>
>> In my opinion, if the desired behavior is to be able to “update or insert”
>> in a logical “slot” (in the current proposal we are using the push message
>> location), I would prefer to explicitly call it out as something akin to GCM
>> “collapse-key”
>> (https://developers.google.com/cloud-messaging/concept-options?hl=en#collapsible_and_non-collapsible_messages).
>>
>>
>>
>> The collapse-key is more aligned on what we are planning to implement in
>> Azure.
>>
>>
>>
>> While I understand the cost of an additional concept, the current approach
>> has two negative consequences:
>>
>> 1)      Application servers have to consider the optional behaviors on the
>> send side.
>>
>> a.      Note that on the client side (given the raciness of message
>> collapsing), server support for collapsing has little impact on the design
>> of the push handler.
>>
>> 2)      It makes acknowledgement harder to process, as now the same push
>> can be acknowledged multiple times.
>>
>> a.      This could be solved by returning a different push location in
>> case the PUT results in an insert, but that complicates the concept of a
>> push id, and makes the interface very un-RESTful (?), as we use a PUT on
>> resource /a, to create a resource in /b.
>>
>>
>>
>> Thoughts?
>>
>>
>>
>> Elio
>>
>>
>> _______________________________________________
>> Webpush mailing list
>> Webpush@ietf.org
>> https://www.ietf.org/mailman/listinfo/webpush
>>
>
>
> _______________________________________________
> Webpush mailing list
> Webpush@ietf.org
> https://www.ietf.org/mailman/listinfo/webpush
>