Re: [Jmap] WebSocket Push question

Ken Murchison <murch@fastmailteam.com> Tue, 05 November 2019 14:49 UTC

Return-Path: <murch@fastmailteam.com>
X-Original-To: jmap@ietfa.amsl.com
Delivered-To: jmap@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D152712084D for <jmap@ietfa.amsl.com>; Tue, 5 Nov 2019 06:49:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.701
X-Spam-Level:
X-Spam-Status: No, score=-2.701 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-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=fastmailteam.com header.b=kcGTb+4R; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=QaueOCP0
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 oyf3ei79AacJ for <jmap@ietfa.amsl.com>; Tue, 5 Nov 2019 06:49:46 -0800 (PST)
Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9FF7B1208FF for <jmap@ietf.org>; Tue, 5 Nov 2019 06:37:42 -0800 (PST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id EE591459; Tue, 5 Nov 2019 09:37:41 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 05 Nov 2019 09:37:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=fm1; bh=ekS8V+xkEa8uIB3tNt0PQhDaLW FM6Z/HnWdgAyBKpLk=; b=kcGTb+4RSoQjSOxqLpaiMaawwHGZMnyiMTPsp8NBSg SejO0MMdHLRfJQF1R12HaxEiRlxM9AKVHijNDC3AdvucJkRVPvjv6EELUi3rOGV6 6Vgj6sda/iKwhV4k1q+FwhlisOEbc4l5deqXAlDl+dw8MJPZWNfnfV2RbFhFdh9/ BOps3E8EzJJBSanMv6ipBRP1znu2EVfSCAxHhlWJHsvQC/EY07IuslXv11DuebFc ifir6rSwb7faCFA7XPsSpVaxptCj00wQn79WFcAtFBsXZVMrLHjMKD2lbfEoOvXt eRwkG4QeIKTfbgdNteGegrJbyoS1I9CT2IToZgLXLLfg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=ekS8V+xkEa8uIB3tNt0PQhDaLWFM6Z/HnWdgAyBKp Lk=; b=QaueOCP04zJTy+0LTAPZ7LWV4TRtSzS2h8j12307qUHB/vDFtGPLxY295 lybez70rxYaOic2RovJxR44plVOzhndSmGFcLPar6SWx7cCC8jmK6aeiBm0swItX 2WAZe7AVAAbY5Bn+tuWCVzUTtJRaNvkVW3N6qz5C4+jALNnwdi/rmbzbxHa8bF6W tgVHl5TyPpz//Fli5qyXCoNZQjFNov7CHpU9JoNzUF6gc+jvpvb8zYXNBjy6N+YE Jka+ql420/iA2ZRMtJL6GuNEp7Uqwrzwn4Kv1Ke33X4j/7CDMJcrc39BwrGrRBfd XYjZr3ZdTQSDXb6rbYMVZs3BeU/Rg==
X-ME-Sender: <xms:NYnBXZu-MxMv3hbk8ieLX-8K-vRRh9GFgiQrO49p1fr_i0qMvyYn5A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudduhedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpefmvghn ucfouhhrtghhihhsohhnuceomhhurhgthhesfhgrshhtmhgrihhlthgvrghmrdgtohhmqe enucfkphepjeegrdejjedrkeehrddvhedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehm uhhrtghhsehfrghsthhmrghilhhtvggrmhdrtghomhenucevlhhushhtvghrufhiiigvpe dt
X-ME-Proxy: <xmx:NYnBXcREexlwMSUIDYgyB8_DQoOkZcnr6rl3OCpSI9yB-H-egnW3dw> <xmx:NYnBXYNct8l1o-_Ik8lELq_jk2JffZ6Rh8mW73Za6kyMJZu-stBPHg> <xmx:NYnBXcmgqZ_6ZRDNrgAwR4sBuE6KVEqCHpl87fWs3cAids4WU7CsBA> <xmx:NYnBXXvQwE0WC0Nsc8Z8bn44F4OL944iV_nSLvo9alpfrDGTW80VsQ>
Received: from localhost.localdomain (cpe-74-77-85-250.buffalo.res.rr.com [74.77.85.250]) by mail.messagingengine.com (Postfix) with ESMTPA id EB408306005C; Tue, 5 Nov 2019 09:37:40 -0500 (EST)
To: Jim Fenton <fenton@bluepopcorn.net>, jmap@ietf.org
References: <e51bcd34-7848-b57e-e084-40fe7b427e32@bluepopcorn.net>
From: Ken Murchison <murch@fastmailteam.com>
Organization: FastMail US LLC
Message-ID: <6039a470-edcd-dd3d-1afb-5ef137eb8993@fastmailteam.com>
Date: Tue, 05 Nov 2019 09:37:40 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1
MIME-Version: 1.0
In-Reply-To: <e51bcd34-7848-b57e-e084-40fe7b427e32@bluepopcorn.net>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/xoh_5Opw8jh1qpTYGfhdj-Ridjk>
Subject: Re: [Jmap] WebSocket Push question
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: JSON Message Access Protocol <jmap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jmap>, <mailto:jmap-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jmap/>
List-Post: <mailto:jmap@ietf.org>
List-Help: <mailto:jmap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jmap>, <mailto:jmap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Nov 2019 14:49:49 -0000

On 11/4/19 6:06 PM, Jim Fenton wrote:
> In Section 4.3 of the draft, after establishing the WebSocket
> connection, the client does a WebSocketPushEnable with a pushState of
> aaa. Where did this initial state come from, a previous session perhaps?
> If not, I wonder if the pushState parameter should have been left off.
>
> Presuming this is from a revious session, I'm wondering how the server
> manages the pushStates. Does it need to keep an archive of all of the
> pushStates it has used, so that multiple clients can establish a
> WebSocket connection and resume from where they left off? Or is there
> some per-client tag that it can use to maintain only one pushState per
> client?


Yes, "aaa" is from a previous session.  pushState is an opaque token so 
that the server can implement it in any way that it chooses.

But in the case if the Cyrus JMAP server, we leverage IMAP modification 
sequence numbers on a per-account basis.  Each change to data or 
meta-data bumps the current highest modseq and associates this new 
modseq with the changes.  When a client requests changes since a given 
modseq (pushState) we simply find all changes with a higher modseq than 
the one provided.


-- 
Ken Murchison
Cyrus Development Team
FastMail US LLC