Subject: [Jmap] WebSocket Push question

From: Jim Fenton <[email-masked]>
Date: Mon, 4 Nov 2019 15:06:03 -0800

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?

-Jim

---

From: Ken Murchison <[email-masked]>
Date: Tue, 5 Nov 2019 09:37:40 -0500

> some per-client tag that it can use to maintain only one pushState per

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