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

Martin Thomson <martin.thomson@gmail.com> Sat, 31 October 2015 05:46 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 51FD01A01E2 for <webpush@ietfa.amsl.com>; Fri, 30 Oct 2015 22:46:25 -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 prub3e1qEzoc for <webpush@ietfa.amsl.com>; Fri, 30 Oct 2015 22:46:23 -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 8F51A1A01AA for <webpush@ietf.org>; Fri, 30 Oct 2015 22:46:23 -0700 (PDT)
Received: by ykek133 with SMTP id k133so96429309yke.2 for <webpush@ietf.org>; Fri, 30 Oct 2015 22:46:23 -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=3CWw/0w7ohNpQd+izUM0CJEYEVXl1XBJk/nl4SJ68Gs=; b=CP9cviM+qxHAXnDBZaLCCLoPqHI7L1gMkoQ1avGKEax0w5KR+xnlikmtfU/qbJ4uKK jfZM26yNuOQlZ1wC1bK1YFReoDnMD/6VFofCZ8wtNPDthvxs4gGi+1+kT+BF8fXLC9Cj K9i6kUk+LAv7sGRR8057MiSkW0bZlY+6uZ9yYUBhH1NmLnzVuQbEDY9mIJVRuKekbLgH en9vfEpe6LF2YRxz0NNU9CBUfQiuygjYdD2WXCHdIOtLgtDUbB57nSsZkom8GfPl0ein fx9PxWsJPrawCcpNVNh7vd2lPKMN/UbWZnbd5Ij2lPWQxYLvCXU3cGh+4lMnCoMhrstX 3C3A==
MIME-Version: 1.0
X-Received: by 10.13.230.201 with SMTP id p192mr8808437ywe.43.1446270382967; Fri, 30 Oct 2015 22:46:22 -0700 (PDT)
Received: by 10.129.132.145 with HTTP; Fri, 30 Oct 2015 22:46:22 -0700 (PDT)
In-Reply-To: <CABkgnnUJFNLb6ocT1OEzTEsKniP0XYsuaqrxsCUGqDhHZH5OaA@mail.gmail.com>
References: <BN1PR0301MB06266C1F50CF432338E98764CB2F0@BN1PR0301MB0626.namprd03.prod.outlook.com> <CABp8EuJnrWph1Kj3W8pg0Sh8TE0HkDkL1CtkDTjK=y9agavHeg@mail.gmail.com> <CABkgnnUJFNLb6ocT1OEzTEsKniP0XYsuaqrxsCUGqDhHZH5OaA@mail.gmail.com>
Date: Sat, 31 Oct 2015 14:46:22 +0900
Message-ID: <CABkgnnXZ8DFzoWZDCFyj8oD71Bg5uFkNB+zHJRJ2ixwi2YRvdw@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/Q1ax49Ugx5ljTewrpTo5N69whhw>
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:46:25 -0000

Oh, and it means that the recipient won't receive the collapse key.
Though we could add something for that too.

On 31 October 2015 at 14:45, Martin Thomson <martin.thomson@gmail.com> wrote:
> 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
>>