[Jmap] Re: Mahesh Jethanandani's Discuss on draft-ietf-jmap-contacts-09: (with DISCUSS and COMMENT)

Neil Jenkins <neilj@fastmailteam.com> Fri, 31 May 2024 05:07 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 B1BFFC14F68D; Thu, 30 May 2024 22:07:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.096
X-Spam-Level:
X-Spam-Status: No, score=-7.096 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=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="DBDh2u5A"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="cyLVe7v8"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ahTJiw6R_S0E; Thu, 30 May 2024 22:07:12 -0700 (PDT)
Received: from wfout5-smtp.messagingengine.com (wfout5-smtp.messagingengine.com [64.147.123.148]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 14E0EC14F69F; Thu, 30 May 2024 22:07:08 -0700 (PDT)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.west.internal (Postfix) with ESMTP id 60D261C001D5; Fri, 31 May 2024 01:07:02 -0400 (EDT)
Received: from imap43 ([10.202.2.93]) by compute5.internal (MEProxy); Fri, 31 May 2024 01:07:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=cc:cc:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1717132022; x=1717218422; bh=zX3qZZH5hO/VHunM1ip9sPHBU2BNctplO1RWCJvbB5s=; b= DBDh2u5Aza++wlXcx0s5KpLvh7/BcU+OTsMtdDhnewHHE4d/r/Sj8LYl8SlSyV/s U3iPRUSTEK8BT1iVHTw0IudSxT7kMosi5h6CUO9JlTReL32txvkXfIexPOVjJASM MtUrvw43b3QvgBhnKLiPuVRrfC81bwNRkwqiteLdKLdRg4DLNPBU+E4BIyasLkzk Dd60RnifBsSv2BcYhzo5pi6S9v5KI7aD9SVA8ZQM2ydHFq094DTDF3kkGtzBOYQA LVzkX2dqkknCbHiDzXprWAnV2lgH9fNtbUHBYy2Qvc9xJLBRO1S7SFyYmPbaojFZ 5oLdlrKRRr8zGs6De24ToQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717132022; x=1717218422; bh=zX3qZZH5hO/VHunM1ip9sPHBU2BN ctplO1RWCJvbB5s=; b=cyLVe7v8wbl4ZL0rFwpTCW3ZoPgPBldDVIzTq0Cr2NvJ 5Y7pUiSWI/tifOxkzBGcohAwOP5hUpht/hZza3AgBWs7s1S9p45oBqC8Uvl++lVi j0P0QGQ80LN75quPbehZxa9UWwOh0RuhFmHqflJYMkqo0o6LEpRnkOxxmw/TD3ah O6KFvm7st6RH75TD8TrWa0CEg+NJK7eDghdMZ0BhH9hLgWHLTyhfyxEhxhSBKf7v wmB5St00kvVNuTIwvB2j/wS1Bot2jyDaR4l1lttcIM9ZEqi/74IJJAhRThQae+yA zmSH+duQvgidgZum6osEu2+TpnrCLru0CJJOAITwkw==
X-ME-Sender: <xms:9VpZZg8RZ0Y006qkm18TvvHsVCyDdJrjWIl4miFUy16u0_UvkPqLvw> <xme:9VpZZovZ_5aguU3Q1dlVDNcn0E1bVycWqlhGZ72sUs-8TXbSJ6dv-zlbq-wjskXt- t9Yiqq3HzVMXg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekhedgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsegrtderreerreejnecuhfhrohhmpedfpfgv ihhlucflvghnkhhinhhsfdcuoehnvghilhhjsehfrghsthhmrghilhhtvggrmhdrtghomh eqnecuggftrfgrthhtvghrnhephfdvhefgleekleffgeeiieelteefffdujeekgfekheel ieetkeeuffehueffheeunecuffhomhgrihhnpehivghtfhdrohhrghenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnvghilhhjsehfrghsthhm rghilhhtvggrmhdrtghomh
X-ME-Proxy: <xmx:9VpZZmDa5jW6JSgpACDrkV42nQci-xs50X2X26yZjdZOeMFrhzjQ0g> <xmx:9VpZZgen4DCY3J4pvZZMvEpMYVB-EFrrw-g_YXUcXcIeEx6QnTw_-A> <xmx:9VpZZlMsb-4Xdwzw-xQrKhuMGPr9UCOlUNDQAdQlLzBe81oS-EneZw> <xmx:9VpZZqkNk743mdExQBbGcpj62ENFNCTKDjlfYIbunsfswJkES0SbkA> <xmx:9VpZZo0Z1e1lAAHHVUVH0YrpiKEf2hc3-dGcnGUu-lDlL9U54ydCxLAd>
Feedback-ID: ibc614277:Fastmail
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 7EFBD2D4007D; Fri, 31 May 2024 01:07:01 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844
MIME-Version: 1.0
Message-Id: <7a00bc9d-d339-4a31-b566-12ceaf3841d5@dogfoodapp.fastmail.com>
In-Reply-To: <171625301728.10738.743002934797335476@ietfa.amsl.com>
References: <171625301728.10738.743002934797335476@ietfa.amsl.com>
Date: Fri, 31 May 2024 15:07:01 +1000
From: Neil Jenkins <neilj@fastmailteam.com>
To: Mahesh Jethanandani <mjethanandani@gmail.com>, iesg <iesg@ietf.org>
Content-Type: multipart/alternative; boundary="2061321efb0b49fa841251d570e23e4f"
Message-ID-Hash: 3LOK7ES2F3AZZRYY54XHTRTADL5L6CMN
X-Message-ID-Hash: 3LOK7ES2F3AZZRYY54XHTRTADL5L6CMN
X-MailFrom: neilj@fastmailteam.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-jmap.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: draft-ietf-jmap-contacts@ietf.org, jmap-chairs@ietf.org, IETF JMAP Mailing List <jmap@ietf.org>, Jim Fenton <fenton@bluepopcorn.net>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Jmap] Re: Mahesh Jethanandani's Discuss on draft-ietf-jmap-contacts-09: (with DISCUSS and COMMENT)
List-Id: JSON Message Access Protocol <jmap.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/iYKFQKz6AfpRK33iMHNrFSzvqMA>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jmap>
List-Help: <mailto:jmap-request@ietf.org?subject=help>
List-Owner: <mailto:jmap-owner@ietf.org>
List-Post: <mailto:jmap@ietf.org>
List-Subscribe: <mailto:jmap-join@ietf.org>
List-Unsubscribe: <mailto:jmap-leave@ietf.org>

Hi Mahesh,

Thank you for your review.

On Tue, 21 May 2024, at 10:56, Mahesh Jethanandani via Datatracker wrote:
> Section 2.3, paragraph 3
> >       If false, any attempt to destroy an AddressBook that still has
> >       ContactCard in it will be rejected with an addressBookHasContents
> >       SetError.  If true, any ContactCards that were in the AddressBook
> >       will be removed from it, and if in no other AddressBooks they will
> >       be destroyed.
> 
> The "if true" condition is not clear to me, especially if other AddressBooks
> exist. There is a distinction that is being drawn between removing a
> ContactCard and destroying it, which is not apparent. Can that distinction be
> explained?

I will explain, but I'm not sure how to reword this to make it more obvious. Quoting from the data model overview <https://www.ietf.org/archive/id/draft-ietf-jmap-contacts-09.html#name-data-model-overview>:

*A ContactCard is a representation of a person, company, or other entity, or a group of such entities […]. Each ContactCard belongs to one or more AddressBooks.*

And from the definition of ContactCard <https://www.ietf.org/archive/id/draft-ietf-jmap-contacts-09.html#name-contactcards>:
 • **addressBookIds***: *`*Id[Boolean]*`*
**The set of AddressBook ids this ContactCard belongs to. A card MUST belong to at least one AddressBook at all times (until it is destroyed).*
So the way ContactCards are associated with AddressBook objects is via a property on the ContactCard. The API enforces consistency — you can't have an id in the ContactCard's `addressBookIds` property that's not a currently valid AddressBook. So if you try to destroy an AddressBook that is currently referenced by a ContactCard we can do one of two things to ensure the data remains consistent:
 • Reject the destroy (this is the default).
 • Update the ContactCards that currently reference the AddressBook. This is what happens if you set `onDestroyRemoveContents` to true. It removes the now non-existent AddressBook id from the ContactCard's `addressBookIds` property. But all ContactCards MUST be associated with at least one AddressBook at all times, so if this was the only AddressBook it was in, we will destroy the ContactCard instead to ensure the data consistency constraints are upheld.
Intuitively you can think of it like this: every contact is in an address book. If you delete the address book, it cascades the delete to the contacts in it, except for those that are still in another (non-deleted) address book.

Does that clarify? I think that the original text will probably be clear enough for anyone implementing this, who will probably have more time to understand the whole data model first. But I am open to suggestions on how to reword this to make it easier to parse without deeper understanding.

> Related to that, it appears the ContactCards that were part of an AddressBook
> that is being deleted, will be moved if another AddressBook exists.

As per the above, that's not correct. The ContactCard may already be in another AddressBook as well (think of the AddressBooks as more like labels in this regard), however it will not be automatically added to another one.

> Section 3, paragraph 2
> >    *  *addressBookIds*: Id[Boolean]
> >       The set of AddressBook ids this ContactCard belongs to.  A card
> >       MUST belong to at least one AddressBook at all times (until it is
> >       destroyed).  The set is represented as an object, with each key
> >       being an AddressBook id.  The value for each key in the object
> >       MUST be true.
> 
> What happens if a ContactCard is removed from an AddressBook that is present in
> multiple AddressBooks? Is it removed from all AddressBooks, or just one?

I'm not sure I fully understand your question here, but let me provide an example to perhaps clarify:

You have two AddressBooks in an account:
 • Work
 • Personal
You have a ContactCard representing Bill. Bill is your friend *and* colleague, and you have placed him in both address books. Some things that could happen:
 • Bill leaves the company. You update Bill's ContactCard (using a JMAP Contact/set method call) to change the `addressBookIds` property, removing Bill from the Work address book but leaving the card in your Personal address book.
 • You leave the company. You destroy the Work AddressBook, with `onDestroyRemoveContents` set to true. Because Bill's contact is also in your Personal address book, it is implicitly updated as above (to remove it from the now-destroyed Work AddressBook), but otherwise unchanged. Any contacts just in the Work AddressBook will have been destroyed.
 • Bill leaves the company and you have a massive fight, to the point you are no longer friends. You destroy Bill's contact card (again, using a JMAP Contact/set method call).
Does that help? If not, could you please rephrase to help me understand the question?

> If it is removed from all AddressBooks, how does a user who wants to trim the
> AddressBook to certain contacts remove a ContactCard?

You can't update a ContactCard to not be in any AddressBook (that update would be rejected by the server). You can destroy the ContactCard instead.

> Section 2, paragraph 12
> > w AddressBooks created by the user themself. If false, the AddressBook and it
> >                                    ^^^^^^^^
> Generally speaking, "themself" is only acceptable when referring to a singular
> entity (such as the singular usage of "they", which is the preferred pronoun
> for many non-binary people). If "themself" refers to a plural entity (such as
> "everybody", or the standard usage of "they"), you should use "themselves".

As "the user" is singular, I believe the current wording is correct,

> Section 2.3, paragraph 3
> > s, it MUST be ignored and the currently default AddressBook (if any) will rem
> >                               ^^^^^^^^^^^^^^^^^
> You used an adverb ("currently") instead of an adjective, or a noun ("default")
> instead of another adjective.

I believe the current phrasing is clear and reasonable; I'll leave this and revisit if the RFC editors flag it.

Cheers,
Neil.