[Jmap] Draft messages - mutability

Bron Gondwana <brong@fastmail.fm> Mon, 24 April 2017 01:55 UTC

Return-Path: <brong@fastmail.fm>
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 1BCE4124217 for <jmap@ietfa.amsl.com>; Sun, 23 Apr 2017 18:55:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 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, 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=fastmail.fm header.b=YYvNRKIx; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=d5gnZ8Sv
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 RWBBw8nmtVcD for <jmap@ietfa.amsl.com>; Sun, 23 Apr 2017 18:55:00 -0700 (PDT)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 14B1C120046 for <jmap@ietf.org>; Sun, 23 Apr 2017 18:55:00 -0700 (PDT)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6EAAB20BBC for <jmap@ietf.org>; Sun, 23 Apr 2017 21:54:59 -0400 (EDT)
Received: from web2 ([10.202.2.212]) by compute6.internal (MEProxy); Sun, 23 Apr 2017 21:54:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=WIu9hWUqmS8wyjniStJVVTM6Z1nuFWah6sN2zfegnH8=; b=YYvNRKIx 1WFN28EMcuT39K5mczJgpam+GSBk6NdDj8TEsb3vw0g7ZNcu19Mm++ALVCkAS32a OBJEHwiaiQ98mW2WDILXc/qqapZ7oRo/cFg4rZkLLlu9g7MoRWTQYMYqv/z7jTDT RoynxMeAWaamJyul7RwWEPWN1EILpC2H+TwNnjGUkvJDA1ApB5bGVGmG59xISpXO pn4spYqvGB/JucLQOh/8xWIJJwUI5iBw8up7AWXd/W8dRrw3pDOuhV14DiQ6SkrB yPYj7i0H/e3+xqxfOnRi6OO/g4tGBEcjZB9TWkuVoPYxnJkQUIv095/s22NdVP2z NF33DZeONHmOYA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=WIu9hWUqmS8wyjniStJVVTM6Z1nuF Wah6sN2zfegnH8=; b=d5gnZ8SvK0gOP2O6f5zYIUd9sW4gdimYWTBr68kLahnjC I0Cmw6FSI042xRZyiWeCOc5eDT623Rk1OhhgRl+jRtGDGRIZvrT2B47haCB6wClZ 3XfWZR3HBf0U1mSrAuXF+ikQS/ifs9UcKG7IWN88ljwjqYEkEUVHrEiFNVPURvrE gzNngLRrAybot1I6RhWqTF+zc6pedbif/AgFzyLRGmNSvmhL2a2mzwp/3QOlBMz0 Bog4jZyJmR4QA51jgCeCAS7Y6CAtk5MBUEeGLG2sUuxNi4pFwxfDLFMqMMPXODgn MMk8FyOIp/VGgKEIeZcBwq0omIZdfIITjuT8Dh9iA==
X-ME-Sender: <xms:81r9WG4Ss0B552fzd0h1dLOCNR2LXFFBkUi05s91M9Oo0TLmDYaZKw>
Received: by mailuser.nyi.internal (Postfix, from userid 99) id 443FD62737; Sun, 23 Apr 2017 21:54:59 -0400 (EDT)
Message-Id: <1492998899.3316920.953769616.254C9CBD@webmail.messagingengine.com>
From: Bron Gondwana <brong@fastmail.fm>
To: jmap@ietf.org
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="utf-8"
X-Mailer: MessagingEngine.com Webmail Interface - ajax-75775c69
Date: Mon, 24 Apr 2017 11:54:59 +1000
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/rrixg14571HOQMwuU1dyO04MW_o>
Subject: [Jmap] Draft messages - mutability
X-BeenThere: jmap@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 24 Apr 2017 01:55:01 -0000

I'm starting this thread to discuss the mutability of fields in isDraft: true messages.

In Cyrus IMAPd right now, we create the "MSGID" field as the sha1 of the "RFC822" raw message content as would be delivered over IMAP.  That's lovely for non-draft messages (except that we'll probably switch to using blake2 for new messages soon).

But it sucks for drafts, because it means that every time you edit a draft, you get a new MSGID.  Futhermore, you can't edit a draft via JMAP with ['setMessages', {update:{}}] because the fields that you want to edit are immutable, so instead you are doing ['setMessages', {create:{all the fields}, destroy: ["the old id"]}] which is a horrible way to edit drafts.

A somewhat similar discussion is happening over in CalConnect around the idea of saving draft ICALENDAR items on a server without sending out scheduling messages about them until they have finished being edited.

So the question for JMAP becomes: is a "draft message" the same datatype as a "message", or do you handle them completely differently?  Clearly you want to show them in-thread with the message they are in reply to in an interface, but how does that look over the protocol?

Bron.

-- 
  Bron Gondwana
  brong@fastmail.fm