Re: [Webpush] Require the TTL header

Costin Manolache <costin@gmail.com> Sat, 06 February 2016 20:47 UTC

Return-Path: <costin@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 4FDB01B337D for <webpush@ietfa.amsl.com>; Sat, 6 Feb 2016 12:47:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, HTML_MESSAGE=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 hoa55AXiBeIB for <webpush@ietfa.amsl.com>; Sat, 6 Feb 2016 12:47:36 -0800 (PST)
Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) (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 EAA251B337C for <webpush@ietf.org>; Sat, 6 Feb 2016 12:47:35 -0800 (PST)
Received: by mail-ob0-x235.google.com with SMTP id ba1so116700301obb.3 for <webpush@ietf.org>; Sat, 06 Feb 2016 12:47:35 -0800 (PST)
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; bh=mP6nmr4nUFBCud2yjuUASihY6JnSRPnKrRFhjSzAhx4=; b=FmJnFaAoFJJ4M1uvIJC7rVR1tFFIfpHjrvqoBJO8bJm3JUSEmMg7xaviGx2NNnoJf+ 5ow2WmdqgJM2jS9+Pj5q3+5y+UV+F8MBVIxxawFWgcnMRgo2uFF0GMsMECKMuqsTqw3v AdZq3DKi4/Pow471YcRHRatTh8C9dQRhSjKR2f8e9+jurzQEtwDRYSwKD7OE3uRT7AK3 KpTkyImJRNPpZJH2rzb0MhtQZu6DfEivx64omyWmBPsqraxi1B9g4Rrs5j0RhqBppxjR nOYi5Duet45+vpiA95926HS8LfshG8Gm/dSizQEYxtZ0lEKEprzlbYWOz4uY61RvRTbu VRUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=mP6nmr4nUFBCud2yjuUASihY6JnSRPnKrRFhjSzAhx4=; b=h3wVDJCgBs+aNxwhHRwee/z66L1wlap28VjCOJFPl4CtlHK3jj0m9YSL21DVtOv4EF hErHbpsRCCRaLhf59L5FTfwMZfZvVmBOdrdBKSwL67MgdN2I9hssQ0p7pDEqkspwNQAe jQBU7Nmsjr3WtEp/XUIakLsDu9ZXkJ80g2acK/KBtAt6IvuwfG+9/qotq1CsRgE4jcNs DDIDKFOEj5NbLSTa/eiPuEbZtTnh3vQUbXaNJPx6CLMPuCWKKuTiydkWTxN28CFgB7iQ 1LvnrRCpgvr9ysSrNWMJ8rsxYt4zUbajkRTQOYZprceY0IToKIBTvWxsnFDVhKm5AVb2 Oc1Q==
X-Gm-Message-State: AG10YOR2ZvLQ2UQAl322NdRXqgPwa22h8soqrbErHD1oSSDOBd8BbuFd9BAQDQJYmE5ppsm5b5R0jwGp2VFf6w==
MIME-Version: 1.0
X-Received: by 10.182.19.164 with SMTP id g4mr18368195obe.15.1454791655364; Sat, 06 Feb 2016 12:47:35 -0800 (PST)
Received: by 10.76.8.74 with HTTP; Sat, 6 Feb 2016 12:47:35 -0800 (PST)
In-Reply-To: <CABp8EuJQ_KXSs6Zz-fbhPcrnYymk14tShu4ukATX9GJ9J3PMjQ@mail.gmail.com>
References: <CABp8Eu+oBj8XKWbqd9ypT_mQWzMxXDe+cBR_vqk=rJ=6tM3tFA@mail.gmail.com> <BY2PR0301MB06477C93FA8937F0ABD4393383D20@BY2PR0301MB0647.namprd03.prod.outlook.com> <CABp8EuJFn+e8ParLY5+SLRVA-_8XgFgp5k8a2W2Ejir35hucxA@mail.gmail.com> <BY2PR0301MB064705934B6DE1B371E1301D83D20@BY2PR0301MB0647.namprd03.prod.outlook.com> <CABp8EuJQ_KXSs6Zz-fbhPcrnYymk14tShu4ukATX9GJ9J3PMjQ@mail.gmail.com>
Date: Sat, 6 Feb 2016 12:47:35 -0800
Message-ID: <CAP8-FqnzSukVkkiBv8F19NH-uTdtRM2rXuQyA1Ng52c4KczDTg@mail.gmail.com>
From: Costin Manolache <costin@gmail.com>
To: Benjamin Bangert <bbangert@mozilla.com>
Content-Type: multipart/alternative; boundary=001a11c2a5f6d72115052b2013b7
Archived-At: <http://mailarchive.ietf.org/arch/msg/webpush/OK0zD-iTezMOKq9Z2RdMVMGfFBY>
Cc: Brian Raymor <Brian.Raymor@microsoft.com>, "Martin Thomson \(martin.thomson@gmail.com\)" <martin.thomson@gmail.com>, "webpush@ietf.org" <webpush@ietf.org>
Subject: Re: [Webpush] Require the TTL header
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, 06 Feb 2016 20:47:39 -0000

+1 on requiring ttl, and returning a Location even for TTL=0

However receipt behavior is a bit tricky. The service may 'delete
immediately' ( which is the same with
not storing it in the first place ), but the delivery receipts should still
be returned when the device
acks.

The push service may believe the device is connected, and call send - but
in many cases send
will succeed even if the other end is gone - TCP will do its retry and
eventually will timeout and
close the connection, but it takes some time and it's well after send.

I assume 202 (Accepted) would be better for TTL=0 if the service is not
actually storing the message.

GCM ( and I assume other services ) may also optimize small TTLs by not
persisting - so
it may make sense to indicate this with 202, and not require in the spec
that the service is persisting
all messages.

Finally, it is very impractical for us to determine if the user agent is
available at the time of the send
(replication and cross-DC latency, plus the TCP retries)

Costin



On Fri, Feb 5, 2016 at 9:09 AM, Benjamin Bangert <bbangert@mozilla.com>
wrote:

> On Fri, Feb 5, 2016 at 8:29 AM, Brian Raymor <Brian.Raymor@microsoft.com>
> wrote:
>
>>
>>
>> If you don’t create a push message resource, how do you handle all the
>> related dependencies?
>>
>>
>>
>> For example, Receiving Push Messages:
>>
>>
>>
>> https://tools.ietf.org/html/draft-ietf-webpush-protocol-03#section-7
>>
>>
>>
>>    Each push message is pushed as the response to a synthesized GET
>>
>>    request in a PUSH_PROMISE.  This GET request is made to the push
>>
>>    message resource that was created by the push service when the
>>
>>    application server requested message delivery.
>>
>
> In our system we determine if the user agent is available as we process
> the notification from the application server and attempt delivery
> immediately if so.
>
>
>>  and in Acknowledging Push Messages:
>>
>>
>>
>> https://tools.ietf.org/html/draft-ietf-webpush-protocol-03#section-7.2
>>
>>
>>
>>    To ensure that a push message is properly delivered to the user agent
>>
>>    at least once, the user agent MUST acknowledge receipt of the message
>>
>>    by performing a HTTP DELETE on the push message resource.
>>
>>
>>
>> There is also a caveat in the TTL section that the push message resource
>> may be deleted before the acknowledgement:
>>
>>
>>
>> https://tools.ietf.org/html/draft-ietf-webpush-protocol-03#section-6.2
>>
>>
>>
>>    A Push message with a zero TTL is immediately delivered
>>
>>    if the user agent is available to receive the message.  After
>>
>>    delivery, the push service is permitted to immediately remove a push
>>
>>    message with a zero TTL.  This might occur before the user agent
>>
>>    acknowledges receipt of the message by performing a HTTP DELETE on
>>
>>    the push message resource.  Consequently, an application server
>>
>>    cannot rely on receiving acknowledgement receipts for zero TTL push
>>
>>    messages.
>>
>
>  It looks like our current choice of not returning a Location if the user
> is offline is not to spec, since returning a 201 implies it must contain a
> Location header. We will be changing this to a 400 for a Bad Request if the
> TTL header is missing in the future, and always include the Location field
> for TTL: 0 messages.
>
> Cheers,
> Ben
>
> _______________________________________________
> Webpush mailing list
> Webpush@ietf.org
> https://www.ietf.org/mailman/listinfo/webpush
>
>