Re: [Jmap] draft-murchison-jmap-websocket as a JMAP working product

"Neil Jenkins" <neilj@fastmailteam.com> Fri, 30 November 2018 09:02 UTC

Return-Path: <neilj@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 CE3A012F18C for <jmap@ietfa.amsl.com>; Fri, 30 Nov 2018 01:02:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.983
X-Spam-Level:
X-Spam-Status: No, score=-1.983 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, MIME_HEADER_CTYPE_ONLY=0.717, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmailteam.com header.b=SV3DLwSs; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=VMI4BcdP
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 EoVfP6wSrMqE for <jmap@ietfa.amsl.com>; Fri, 30 Nov 2018 01:02:43 -0800 (PST)
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 943A6130DCC for <jmap@ietf.org>; Fri, 30 Nov 2018 01:02:43 -0800 (PST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BCB2123180; Fri, 30 Nov 2018 04:02:42 -0500 (EST)
Received: from imap7 ([10.202.2.57]) by compute6.internal (MEProxy); Fri, 30 Nov 2018 04:02:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=message-id:in-reply-to:references:date:from :to:cc:subject:content-type; s=fm1; bh=x5W5VKNOFAaST9jpm0U+GOVjJ v3Fy0fUEoL/dZRrP8k=; b=SV3DLwSsOHtr9pQMfGdJP+rRhirbyW+CEijRmuopw eldInzsbVl1yIubQxJznHDkQy2++PnlWUn/e3L29dSztbhV1LRta4KObe54z+fdl B1Qn71Kk04Xt1tZD3gJHO2ep2sshpsygE1T6nmAhQb7aXPSWdRT9JcQ3IE3+pYID tzqDfvHNNjsKgnSRed/3Xu7oqubv8BJ1C4olY9RCIQkjnJD3s9OlwfY8z+qbAgnH 7QQrKHyPY+j11m9FIfGo9hW3u2LeW2vP6RjZDgO1Pa32UathGFHe3ZlID+0bmiPU K3PQ5EJwNQMvu0LgJ06huqxPoovNqjtYCu8gfKFuzCZrA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:references:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=x5W5VKNOFAaST9jpm 0U+GOVjJv3Fy0fUEoL/dZRrP8k=; b=VMI4BcdPig0nqkj3qRQ0+eE6OyRtju/Fh EEO3H6Ea6dBNFxFdEdAjxIAQL+9K/sI4ggOzIoKQdq9P8GTjbmkQIpWDXpoFpid8 AO3fCMLCYMFis7sN8RZSTHtZy8H7QfIkh3l5IfDuQsnadRlHX0vtLaCO4YEGUh+t AnPghopVFA/fovKjagLoFvkPHaY8W482dWe6hq1r6DmLcoWYhmq/3mv5KzlvXqAK bKnhy9+1ZADBicRmwHpR0Lr7hpKFFxauC855QhL0U3AYLUA48H/MfwQzmU45aANZ pYuLyb3NaEN3iV24b3FL2Ppm0iUY2aEBn74du8PHSoBKrYJSEnhxw==
X-ME-Sender: <xms:svwAXNHuSXOrJjs38mkQ3Geos2phITqMdvHnrmLAqVbeRxZasjB7Ag>
X-ME-Proxy: <xmx:svwAXAuUexDbDZO7pV7iVDSSYO8POoATJBrSvVMa8TtdrIZpAc0wgQ> <xmx:svwAXBmNucnhoFxcuMkSs8zpfU_VAUsKUtTdV8fOsy7gUVqYPVl4Yw> <xmx:svwAXIxIFqMgxal6CbVT7wiFPdVwmQe8Q7k9L63Vi6wkBuDyE_rhtQ> <xmx:svwAXNxHnIGmlMsxTWeeVEyBp_sAMueKEr_ADaU0XzluD99sPMsc8g> <xmx:svwAXH8ZkMF8-Kyw5U_7zJnyhEbA0woWgX__AuEq8ytAnjU5UcJdEA> <xmx:svwAXGCRptTFYUTrqk_RGMdFup0lbhVi1-VSu8r30b7fdP-bRISjfg>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id F311E20322; Fri, 30 Nov 2018 04:02:41 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
Message-Id: <48fc1d7e-ab93-4af8-a672-36876979fbd5@sloti7d1t02>
User-Agent: Cyrus-JMAP/3.1.5-656-g84f879f-fmstable-20181126v1
X-Me-Personality: 64588216
In-Reply-To: <e1c4c556-691c-5ced-7dae-52930b2d9194@fastmailteam.com>
References: <CALaySJLQV8U4P7nk97nVtRz7boArQ0F-dU0B7XYpN8wrfPsMpg@mail.gmail.com> <265ec3f1-75b8-43e3-8c52-276b6f6077c6@sloti7d1t02> <e1c4c556-691c-5ced-7dae-52930b2d9194@fastmailteam.com>
Date: Fri, 30 Nov 2018 04:02:30 -0500
From: Neil Jenkins <neilj@fastmailteam.com>
To: Ken Murchison <murch@fastmailteam.com>
Cc: IETF JMAP Mailing List <jmap@ietf.org>
Content-Type: multipart/alternative; boundary="ff25edfdb0574acaba77a8c062ffbb62"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/bEai01gjXtr4fru_glQIQcIk5ug>
Subject: Re: [Jmap] draft-murchison-jmap-websocket as a JMAP working product
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: Fri, 30 Nov 2018 09:02:51 -0000

On Fri, 23 Nov 2018, at 11:38 PM, Ken Murchison wrote: 
> Se already have @type in the problem details object returned for a request level error. Can't the client simply check the response object for "methodResponses" , or "changed", or "type"? Otherwise, perhaps "responseType". 

 
There's a `type` property on the problem details object but not an `@type` property. This object would also need an `@type` property with a value probably of `"error"` (or maybe `"RequestError"` would be better actually). The client can then simply look at this property on the object it receives to know what type of object it is and how to dispatch it. That's simpler and cleaner than looking for certain properties which should be on one type of object but not another (which you could easily screw up in the future by adding an extra property with a common name). 
 
>>>  o Should we allow out of order processing of requests? 
>>  
>> Again the consensus was "yes"; you can use a single WebSocket connection as the equivalent to parallel HTTP API requests. This means we also need an `id` property on Request and Response objects so they can be correlated by the client. 
> Should we make this "requestId" to be a little more descriptive? Or perhaps steal "tag" from IMAP? 

 
We could, but in general with JMAP if a property is an id of the object it is on, that property is always just called "id". If it's a reference to an id of another object, then it gets prefixed with a description of what's being referenced. So I think `id` is probably more consistent on the `Request` object, but maybe name it `requestId` on the `Response` object to show that is what it is referencing. 
 
> Is "clientId" in the request not sufficient for correlation? 
 
Yes, except what if the Request object returns a `RequestError` problem details object (as discussed above)? We need to know which request generated the error, so I think need to have a matching `requestId` property on this object. 
 
> Do we push ALL notifications or do we allow the client to subscribe to notifications for certain object types? 
 
We should allow clients to choose what types they want push notifications for, like we do with the other two push mechanisms. I guess we define an API method to configure this that affects the push channel it's sent down. 
 
Neil.