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

Benjamin Bangert <bbangert@mozilla.com> Wed, 08 June 2016 03:17 UTC

Return-Path: <bbangert@mozilla.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 D043D12D9A1 for <webpush@ietfa.amsl.com>; Tue, 7 Jun 2016 20:17:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mozilla-com.20150623.gappssmtp.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 vBDwzwJk9vxf for <webpush@ietfa.amsl.com>; Tue, 7 Jun 2016 20:17:38 -0700 (PDT)
Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (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 6DA5912D9A9 for <webpush@ietf.org>; Tue, 7 Jun 2016 20:17:35 -0700 (PDT)
Received: by mail-io0-x236.google.com with SMTP id 5so32324903ioy.1 for <webpush@ietf.org>; Tue, 07 Jun 2016 20:17:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mozilla-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=XVRN7WFTf3Exohn7n+V2QVK1Vc0y8KWQtgP+MRFja+Q=; b=yDUfgbJf6VhdFktNzi4Zmvm2WXRR2+W2S88E1gaApX9/NM2qjJQ699IyKrtcsXZFU2 6xTMiBS+Ba7WZXWvw0n+bDdUHeO1fanTSAKNKG8qWP+QCH2g9huiwQ7iHjOnvmkbzY6B n5PdQJmbN77PJykOnkBYbXHKWWQueIb5JMwQfrlllZbbUTplZiEP4VjyJ1dt1p7MIkEK iTxaV8ewk1xnmhwlZhTLlqThvxW/+jpNtol1Ixm57rAXa8MJw4HnCUYDW25uW7D0HxNo W19UEM6xeXSryvAG6OrhSDIjriUQiyiSRDr6+0nOVDtaDyVROsHYAQPWI76qq+SBHmRP nJvA==
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; bh=XVRN7WFTf3Exohn7n+V2QVK1Vc0y8KWQtgP+MRFja+Q=; b=Dn0ozZGcLTb50/EoGm2Ca16ZHerCZzb/sieM6lz4p6bxrj+k6BurYQoj7+gRmOsSyx icrb1Q+JwKnf86YXhKHKbqYTHbCbywj6+8uORu7ODfJwggpUQz/LIuIfNheG7BeZsxPb K0pooK6ss/bcG5cq97d8PtnYDpb4njyMSU7j1Rfwkoi96noq4lHTjxIQoylJx0G3LuvJ CMlceJxU8ijjUXohMzAyMTAlW2wgtzdYb/hSpQVorI1eNBJg2wlkgaRmk1PbtISD4buI 1s0AjYps7v0NIOnDDGhOd3Cg1OpE+Xn/jdbUgh/ZwBZve3fb2UIw48Y/Qm0k5YJsxBR5 aGsg==
X-Gm-Message-State: ALyK8tInoReRPdprUCSan02H57avkM/BhKDHs5lzvS8x7mTtD64aaXp8LaTRKlPj5okZ+Lq/7/oxPCXp1HzOmtiJ
MIME-Version: 1.0
X-Received: by 10.107.201.3 with SMTP id z3mr4818129iof.120.1465355854622; Tue, 07 Jun 2016 20:17:34 -0700 (PDT)
Received: by 10.79.76.194 with HTTP; Tue, 7 Jun 2016 20:17:34 -0700 (PDT)
In-Reply-To: <CABkgnnVSrKp8sf31qpBztp1FH=AQHFCoAH9XVQx6JyU4BoEQaQ@mail.gmail.com>
References: <CAN+BUJpdSB-HvT6VQzVcAPqzwb_pn=HzLOC3r4ntSKjDh3ffLA@mail.gmail.com> <CABkgnnVSrKp8sf31qpBztp1FH=AQHFCoAH9XVQx6JyU4BoEQaQ@mail.gmail.com>
Date: Tue, 7 Jun 2016 20:17:34 -0700
Message-ID: <CABp8EuLYHufcLSnJjCvKGsCqgXDeAzrwn3N2XdoK4x6Px+0w5w@mail.gmail.com>
From: Benjamin Bangert <bbangert@mozilla.com>
To: Martin Thomson <martin.thomson@gmail.com>
Content-Type: text/plain; charset=UTF-8
Archived-At: <https://mailarchive.ietf.org/arch/msg/webpush/m94_qcy8AQChiHZN_BQphSPQAzM>
Cc: "webpush@ietf.org" <webpush@ietf.org>, Idel Pivnitskiy <idel.pivnitskiy@gmail.com>
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 03:17:42 -0000

On Tue, Jun 7, 2016 at 7:34 PM, Martin Thomson <martin.thomson@gmail.com> wrote:
> On 7 June 2016 at 09:02, Idel Pivnitskiy <idel.pivnitskiy@gmail.com> wrote:
>> Just a question: When should UA send an acknowledgement? Immediately after
>> receiving a push message or after decryption/decoding/processing a push
>> message?
>
> This is defined in
> http://w3c.github.io/push-api/index.html#the-push-event  (Step 6.5.3
> is the acknowledgment.)
>
> What a user agent does with the message is outside this spec.

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).

As such, our UA necessarily cannot and will not follow the DOM spec as
written. Instead we follow the WebPush spec which appears to conflict
with the DOM spec.

Per the WebPush spec, 6.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. "

The DOM spec in 6.5.3 notes that if the message is improperly
encrypted, the process is halted, and the webpush acknowledgement does
*not take place*.

The relevant portion of the DOM process:
"If the push message could not be decrypted for any reason, discard
the message and terminate this process. "

This makes it sound as if the following steps (including webpush ack)
*must not be run*.

Some clarification around this would be great.

Cheers,
Ben