Re: [Webpush] When UA should send an acknowledgement?

Idel Pivnitskiy <idel.pivnitskiy@gmail.com> Wed, 08 June 2016 22:10 UTC

Return-Path: <idel.pivnitskiy@gmail.com>
X-Original-To: webpush@ietfa.amsl.com
Delivered-To: webpush@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1BD8A12D736 for <webpush@ietfa.amsl.com>; Wed, 8 Jun 2016 15:10:53 -0700 (PDT)
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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 9x7rfPyeOyCi for <webpush@ietfa.amsl.com>; Wed, 8 Jun 2016 15:10:51 -0700 (PDT)
Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (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 CBE8912D68A for <webpush@ietf.org>; Wed, 8 Jun 2016 15:10:50 -0700 (PDT)
Received: by mail-it0-x233.google.com with SMTP id h190so20628197ith.1 for <webpush@ietf.org>; Wed, 08 Jun 2016 15:10:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=t8QMbuEBGNxOHOglUkTHHTmvEdr8pjg9EAFQZmoy4wA=; b=Y5/lM1uZ1APpII76mQEciNwIRBTujy/txmELRxVqk7v5HZEDBDOfYLNuseK8dieWz+ fVCrk5qjXHy5zrbYzV/Z1V08RtWAdrsdTouhBuRprWGF+mNEPKuoNtHnoVkDcKk56fXK kjRF3oc1woSCBe3N3XhNl0iGmZL2d2IjQluZDlB4w/3lIpvKuAqmNysbJohyBdnQsvhe X4D6NnT4grsX3IqHp9N8zGwooL3f/G/rku/8XU5Cqy/lkqYioLLoUSyNOn7XGomb/SqG TWBybhQ0/dI9xltUWJH8aHJyUTeKvx1uSo8+pYgo2pBSdc0Hd+fsyBgTvtOImbthN41q RNpg==
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:from:date :message-id:subject:to:cc; bh=t8QMbuEBGNxOHOglUkTHHTmvEdr8pjg9EAFQZmoy4wA=; b=Nd94vnlVoFJG6bgnvZ4Kgrwu9BpKdMbQ+u6rBaHWI6kkygWZifSQK7kkEhN91tEFMW kxdJXC6X7pNDzvVcX8ec0oHOnWPubtgINpUBnDw+yRFkVNhg26IjVsw3p+SwzDrkE/Fe ALyRPbgHDKbPdmU34fuGwYmIS9pV4IlD+xWpDXhYHnY9S4RToP+nve8/s1ZROqFBErjp jrzxgh/ja+tRd1+IkHKmynz2PmP2IcsAQdAmD88ZF1lV9vVdxjeiae9u88bVI7w+pfAj FWQ9MzYCfXXEbgeWbxSGiSJBy0rITi5rpr5HMDP87H9Qr9XUfK8VobFnKVTObJ5B/BfJ y8Ow==
X-Gm-Message-State: ALyK8tKaOZghm2+3AnPk3UkgvenkrEKtqrOhR7gpZxo6HbSlhk4WN4ou5pLz23PcinbEV9AFOeiz+JMydtJ9cw==
X-Received: by 10.36.123.77 with SMTP id q74mr15944769itc.44.1465423850119; Wed, 08 Jun 2016 15:10:50 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.36.152.131 with HTTP; Wed, 8 Jun 2016 15:10:10 -0700 (PDT)
In-Reply-To: <CABp8EuK32xxDLqv5a9+Pc=rETASmi+E-R5ALs9PWA1ntN_L0ug@mail.gmail.com>
References: <CAN+BUJpdSB-HvT6VQzVcAPqzwb_pn=HzLOC3r4ntSKjDh3ffLA@mail.gmail.com> <CABkgnnVSrKp8sf31qpBztp1FH=AQHFCoAH9XVQx6JyU4BoEQaQ@mail.gmail.com> <CABp8EuLYHufcLSnJjCvKGsCqgXDeAzrwn3N2XdoK4x6Px+0w5w@mail.gmail.com> <CABkgnnVcyFcd2MPUFKORkkyHpMDfALjAP34ByVJpLBEMSiZ=ZA@mail.gmail.com> <CABp8EuKAcA9Vx3RO997MY3-niAgaNf_MZ3xjDW+zFE=7Hb_rbQ@mail.gmail.com> <CABkgnnXAqnY3sSzU67vLf3SS-RXcoF-Uq=KT+hyPOu5ATV+bSw@mail.gmail.com> <CABp8EuK32xxDLqv5a9+Pc=rETASmi+E-R5ALs9PWA1ntN_L0ug@mail.gmail.com>
From: Idel Pivnitskiy <idel.pivnitskiy@gmail.com>
Date: Thu, 9 Jun 2016 01:10:10 +0300
Message-ID: <CAN+BUJqDHLCCL1tFPQJLq-cjP5=BEzc0RQypZnrJiq8ek4=KVg@mail.gmail.com>
To: Benjamin Bangert <bbangert@mozilla.com>
Content-Type: multipart/alternative; boundary=001a11475b2208285e0534cb9444
Archived-At: <https://mailarchive.ietf.org/arch/msg/webpush/J5rHPCHPd9hnp9dK1FdoPjdGwZc>
Cc: Martin Thomson <martin.thomson@gmail.com>, "webpush@ietf.org" <webpush@ietf.org>
Subject: Re: [Webpush] When UA should send an acknowledgement?
X-BeenThere: webpush@ietf.org
X-Mailman-Version: 2.1.17
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: Wed, 08 Jun 2016 22:10:53 -0000

Agree with Benjamin,

In current spec if decryption or decoding fails, ack will not be
sent. Consequently, PS will try to resend a message after some delay
without ack and situation will repeat again. Lucky if it will not lead the
crash of an application again and again.

Best regards,
Idel Pivnitskiy
--
Twitter: @idelpivnitskiy <https://twitter.com/idelpivnitskiy>
GitHub: @idelpivnitskiy <https://github.com/idelpivnitskiy>

On Wed, Jun 8, 2016 at 4:42 PM, Benjamin Bangert <bbangert@mozilla.com>
wrote:

> I'm in support of at-least-once processing, so the ack would occur last per
> the DOM API. The difference would be that the DOM spec should require
> ack even if decryption fails or the SW fails for some reason.
>
> On Wed, Jun 8, 2016 at 12:38 AM, Martin Thomson
> <martin.thomson@gmail.com> wrote:
> > I'm sorry, I'm confused by your message.  I can't decide if you want
> > at-least-once, or at-most-once.  End-to-end ack, i.e., ack after
> > successful processing, is in support of at-least-once, which I think
> > is consistent with other decisions we've made in the overall design.
> >
> > On 8 June 2016 at 15:15, Benjamin Bangert <bbangert@mozilla.com> wrote:
> >> On Tue, Jun 7, 2016 at 9:36 PM, Martin Thomson <
> martin.thomson@gmail.com> wrote:
> >>> On 8 June 2016 at 13:17, Benjamin Bangert <bbangert@mozilla.com>
> wrote:
> >>>> For our implementation, we will actually never send more notifications
> >>>> until all sent ones are ack'd. This means if a message is malformed or
> >>>> causes a UA error in a UA that actually follows the DOM spec, it will
> >>>> never get a notification again (except the notification it won't ack).
> >>>
> >>>
> >>> This is fine, as long as you regard unacknowledged messages that you
> >>> thought were delivered as poisonous after a certain amount of time (or
> >>> retries, if you do that).  If you follow that advice, then progress
> >>> will eventually be made.
> >>
> >> This recommendation isn't in the WebPush spec. By mandating that the UA
> >> MUST ack every message it's clear that failure to ack a message should
> >> result in redelivery attempts.
> >>
> >> If it's intended that a UA does not need to ack every message, the
> WebPush
> >> spec should be updated to reflect that. I could see a PS reasonably
> >> considering messages dead if other messages were ack'd or some other
> >> command came over the connection such that the server knew that
> >> the client is alive and likely processed it.
> >>
> >> Automatically ack'ing a message in this manner for the PS has as many
> >> problems if not more than requiring the UA to ack every message though.
> >> It also introduces a lot of complexity into the PS and may result in
> very
> >> long message delivery times should a UA get bogged down with many
> >> improperly encrypted messages.
> >>
> >>>
> >>> I expect that Costin will agree with you, but we've discussed this in
> >>> the past.  The problem here is that an acknowledgment from the user
> >>> agent doesn't constitute a useful signal.  You have moved the problem
> >>> to a second middle-man.  When the user agent acknowledges prior to
> >>> processing the message, how will the application know that it was
> >>> processed?  Can you guarantee that?  When the browser crashes, your
> >>> message is still lost.
> >>
> >> Why not change the DOM spec to indicate that if a message was
> >> processed and failed for some reason it should still be ack'd?
> >>
> >> If the same message consistently crashes the browser, I would expect
> >> the browser to track that fact and avoid the message again in the
> future.
> >>
> >> Clearly we have the choice of guaranteeing that a message will be
> >> processed at-most-once, or at-least-once, since a crash immediately
> >> after processing could stop the ack from making it back. If the desire
> >> is at-most-once, then the UA should ack immediately upon receipt of
> >> the message (or the PS can consider it ack'd if a PING frame is
> >> returned after sending a message, etc.).
> >>
> >> The Push DOM spec seems to favor the at-least-once model, in which
> >> case it would be appropriate for the UA to always ack a message even
> >> if it decrypts improperly, or the SW throws an exception, etc.
> >>
> >>>
> >>> The only way for this to be a good signal is to have the
> >>> acknowledgment be end-to-end.
> >>>
> >>> (p.s., I don't know if your assertion is true or not.  I don't think
> >>> that it matters.  I should know that code, but it's an absolute rats
> >>> nest, despite Kit's recent efforts at cleanup.)
>