Re: [dispatch] Potential incoming work: web push for IMAP, CalDAV and CardDAV

Michael Toomim <toomim@gmail.com> Fri, 25 October 2019 23:18 UTC

Return-Path: <toomim@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 39199120020 for <dispatch@ietfa.amsl.com>; Fri, 25 Oct 2019 16:18:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 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_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 ahQRtwbBgFLo for <dispatch@ietfa.amsl.com>; Fri, 25 Oct 2019 16:18:15 -0700 (PDT)
Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 011F712009E for <dispatch@ietf.org>; Fri, 25 Oct 2019 16:18:14 -0700 (PDT)
Received: by mail-pg1-x530.google.com with SMTP id f19so2519200pgn.13 for <dispatch@ietf.org>; Fri, 25 Oct 2019 16:18:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=IoyYsfEcpjxM0rK/0CGRskyozgF9sV3SBKfldApptj0=; b=l1AhOxSt83nXHwtyd4YntNaSFowkqNHVI//3+gjZHOcGGF99Gnnq3JrqVziWlga6Cy Cvc44p6Z56AuzivZLrtRsQrsOP3jZlN5V+LK6Tk7rQA/qL2v1RRQoGL8pwhTNoer5Erc PujEVWMeQ8NozsRtAZ+wMiFKxojtA1OC0nlkv5+nWuz9/0TSkCJixqyZ1fkGGvJREbt0 yzm3RFYiMUKohgpAhfX/RutEFCzrVdwI5Oext6MF9ZlvN4Igpo2fVNr12aBXw8+svJgS Ty4LAIZkZrRJ+hxlUKjXE+iDx9iQUbruYr/eYJt17pIC6+iJ/ZHipsvf9zEmIZygT4E0 7vmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=IoyYsfEcpjxM0rK/0CGRskyozgF9sV3SBKfldApptj0=; b=POY7EAoQvzFzXikBOvwhlbtlTM/LynwHsA1qgmyjXdLc9HYoZhxFSd7AWYU06jOIzh Tv+oXpdF8jaPXhR/StuEJQ+Z8YcHRJ+b6c7kYX3acaQGocH/6auJy/x8xo26/JukFFKv TfC8G062kH8TVbHZ6ONr6XMQmgRDuu9ICGIgINhOk+CdAM332kgnvX9pglDTzvAYlGVy qPjQBCqE6+fpQJor6r2NGGoaOEBN3LU6y2j22cUB9QkNNXvpAAkRhNf9noTpjRkitwg3 kVpT2OJ0/4lbbHvPJkf6JmNd9CoDo2dyiH8hlOszeKJapFJ3SDsm5M3SOp7njY6YSCBs tnoQ==
X-Gm-Message-State: APjAAAVkQUPe4NtpfmS73huNHrzXOWMxldVaLPtSN3SNti0eapkNcOEU DMPHnvGwaKJke2lpVe8moQE=
X-Google-Smtp-Source: APXvYqynwMkS8IUR/7vuWao9kWiJuNE/NXYEJgYn/lYh+cqCpywt7xhzgemws61PfZ6eVgr+4dIgyg==
X-Received: by 2002:a17:90a:bb0a:: with SMTP id u10mr7465108pjr.14.1572045494157; Fri, 25 Oct 2019 16:18:14 -0700 (PDT)
Received: from [172.16.103.49] (c-71-202-89-74.hsd1.ca.comcast.net. [71.202.89.74]) by smtp.gmail.com with ESMTPSA id q20sm3477607pfl.79.2019.10.25.16.18.13 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Oct 2019 16:18:13 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_30D343AF-7C13-4458-AD18-72C1B8DBF7D0"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Michael Toomim <toomim@gmail.com>
In-Reply-To: <191d3882-3bc4-48de-a4b2-dac05c7b1288@www.fastmail.com>
Date: Fri, 25 Oct 2019 16:18:12 -0700
Cc: dispatch@ietf.org, Braid <braid-http@googlegroups.com>
Message-Id: <A8988642-054E-4A20-A2FD-00A75D734A4A@gmail.com>
References: <290514e7-79ce-4852-bf05-a684e2e8d045@beta.fastmail.com> <DFC3797D-DA12-4470-9CBE-D7BD981DB6CE@gmail.com> <00358631-a34d-45db-bf87-44709972387b@beta.fastmail.com> <1C9B1121-B20E-479E-B596-C04A416B5EE1@gmail.com> <191d3882-3bc4-48de-a4b2-dac05c7b1288@www.fastmail.com>
To: Bron Gondwana <brong@fastmailteam.com>
X-Mailer: Apple Mail (2.3124)
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/dX56pR9gEfTRWvH_peLOvn0_3_I>
Subject: Re: [dispatch] Potential incoming work: web push for IMAP, CalDAV and CardDAV
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Oct 2019 23:18:17 -0000

Bron Gondwana:
> At this point the big difference is whether you want a push of the entire resource, or (as JMAP does) an edge trigger to say "there's something new of this object type on the server - issue a query about which bits you're interested in to see if there's anything new you want to fetch".
> 
> At which point the granularity of detail becomes interesting - because you only want to be informed of changes if there's a high probability that they are things you are interested in, and even more so - if there's a high probability that you'll be able to see them!  You don't want a push every time a resource on a server with a million users changes if you can only see your own resources!
> 
> We do that on our own server with pushing you every change to you own resources plus doing ACL filtering to see if any other user can see the resources and giving them an ACL push too, even if they aren't subscribed to the resources and won't notice a change.... so there could be more smarts in the push filter but it seems to balance out OK in a real life, just the occasional extra wake.  And we separate data types like email and calendar into separate change pools.


Ah, yes the JMAP approach is to inform the client of EVERY change to EVERY object, even if that object isn't being displayed right now. The client just ignores the unnecessary changes.

That works well enough for email, where all changes are bounded to the user's mailbox, and things just don't change that often. However, it doesn't scale to the general case, where a server might be serving millions of resources, and any client could conceivably want to watch any of them, but probably only a few at a time.

It is much more efficient here for a client to explicitly subscribe to the resources it wants to watch. In Braid, you subscribe to a resource by adding the Subscribe header to a GET. Then the server promises to send you updates, even if you go offline, until you explicitly give it a FORGET.

This means that the granularity of subscription is a URI, and clients are responsible for expressing which URIs they want to subscribe to. This works quite well in practice. You usually start out with just a few URIs, which means your client will do a few GETs, and then if you need finer granularity, you can always break up your objects into multiple URIs. The Linked JSON spec <https://raw.githubusercontent.com/braid-work/braid-spec/master/draft-xx-httpbis-linked-json-00.txt> makes that easy.