[JMAP] Re: EmailSet - inconsistent behavior with keyword maps?
Maia McCormick <maiamcc@gmail.com> Tue, 30 December 2025 04:39 UTC
Return-Path: <maiamcc@gmail.com>
X-Original-To: jmap@mail2.ietf.org
Delivered-To: jmap@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 8FEEDA0A5730 for <jmap@mail2.ietf.org>; Mon, 29 Dec 2025 20:39:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aa1J7K8nBIQ4 for <jmap@mail2.ietf.org>; Mon, 29 Dec 2025 20:39:35 -0800 (PST)
Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 14874A0A5729 for <jmap@ietf.org>; Mon, 29 Dec 2025 20:39:35 -0800 (PST)
Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-3f584ab62c6so4102178fac.1 for <jmap@ietf.org>; Mon, 29 Dec 2025 20:39:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767069574; x=1767674374; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jN2EImmAfGOwtL9MPUUmEJp45DdapR9dLpNFmhRA4ro=; b=JqWrFUem9X1f6tfglK6Wo9XjrZwO0HlHIf1Epew8EFXzpQsroYO7ac899dOyAQQu7X GxXVFUuHT6nvsUiaxcf/itSX6QJ3JqFJiIdm96N/B+g7eHWeH6VfvUTZe/gTcxDyjl41 xypFuR+9qHaeBQjr2wLCwHSbx9c0HyFWvcGkjRAxryypU5fjcwfFDiu6rg8HFiWsfBAX hcztX83G1Z2A/+JzTuyectaS+UVHDyJi4znVtH/KP8i5YW9SSwLizv4UJBHpT8PRhfmR JZ1Jnlp62adEDoGurUs2+gV2AQND6Xeqh8XJHcGudvSE7CC8jnP7NGiXwXMv6NMCO31g br+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767069574; x=1767674374; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jN2EImmAfGOwtL9MPUUmEJp45DdapR9dLpNFmhRA4ro=; b=OOkbNSJDRecwIYHBWmrEMHsoCzEUtjpHF4QsmmdPgVbd+bcKUJuF2CPdN3MrdcY3Gk 2FJJ/l5KefGxnX61Cgq0eojLYwK5NEKIFDHmfofhNFn+BhMvwf2mGCKi2bUUpHxKvlqB X8CRugVT1L71FJ94KUaJWnCihQVVicaggSUv6tKjDhGZ4+zCWX+cohA5HeG/L6lu9gjF 2JpsUXvuMeuHycbMNzl7Gs/WByHTxJOa6tr+SAgJwtXhU2tFRovItub5r0WkzSizrDIk hoTkrRRRW9PLgOpjJ0Xp+aLn0KOFOtketSoKEm7Dex/RAuLiDsBcL9meu5PZ6iF9WmN1 LzmA==
X-Gm-Message-State: AOJu0Yz+zPkjOSSH28y69k9XivDBt+bAJVuYPxXv9cnguAU5P/VzrI4M yFj5R2l/LaAiqX0fFXaLsFs2jiJ0/Jiz4Sv0qouXaqiJJ8fnhxviGkxUu2pg4NiLNrkQQxuvykR bbkG1PeJMpzJ6zdTbErvvNeOiXRqxCZTDYMFu
X-Gm-Gg: AY/fxX5I9Fp3L0SSEqhqJl6n8Qrqt3DzQBqJBfQRay/T8kHwjZKPe1z4v2P5xPaqINB GG44MoUx7pKb0dwtA7u/3FkwAU2om8LGpy6cgmoCn94eWbS19zmM8hgfyqD/QCghKhvuN1Kc6sY jkURGRFXxNS1UtuekQhcbDK4u2HOpN3KEiBGsQyq/egKRwjW562soSsl5BmIkwwJMraoMYG6EQ9 K4Kw/Cuq26PDDys+QZikSj5CXEsoGCRowtU3dwbdGrrzKsAEYZ0sksm2DcpR9RG0glPTFs833sk DkrJya13Z+f4FK7Vw3r/0mckBX+TM1TMknGNfDIKmCCv4BCRgzpyn055vMc2oFvL8nbW0ZIM
X-Google-Smtp-Source: AGHT+IEgoWCwrBjLc6lIeYzyjdEFrhHlUb4EUJqLCzO2gehBZp5/pJytIT77C6R09BtCKHkJ49GIADAL/RT9IhrnjL0=
X-Received: by 2002:a05:6820:229c:b0:65c:fa23:2d04 with SMTP id 006d021491bc7-65d0e9e7b69mr11127455eaf.13.1767069573896; Mon, 29 Dec 2025 20:39:33 -0800 (PST)
MIME-Version: 1.0
References: <CAHUcZGMaVc6tg-W4VQHkDf7G4vQTsbcAW8WGk0xc1ph2SRwHeQ@mail.gmail.com> <bad920b3-56e5-46c4-b117-aeb2a02ec7e7@dogfoodapp.fastmail.com>
In-Reply-To: <bad920b3-56e5-46c4-b117-aeb2a02ec7e7@dogfoodapp.fastmail.com>
From: Maia McCormick <maiamcc@gmail.com>
Date: Mon, 29 Dec 2025 23:39:22 -0500
X-Gm-Features: AQt7F2pcX2NkdAfXcVIffzOh5iRNA-qctoFOo_f7iJbPWOFT7U_avWxVggwOVNY
Message-ID: <CAHUcZGMcWVyr6QKo5AyasLpnzftBYQQVyMFZ_bpxju72QPv_aQ@mail.gmail.com>
To: Neil Jenkins <neilj@fastmailteam.com>
Content-Type: multipart/alternative; boundary="0000000000003ee163064723f2ab"
Message-ID-Hash: TFXMBRYOIRQP2L5P64KH6LF2HJ7EMAEA
X-Message-ID-Hash: TFXMBRYOIRQP2L5P64KH6LF2HJ7EMAEA
X-MailFrom: maiamcc@gmail.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: IETF JMAP Mailing List <jmap@ietf.org>
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [JMAP] Re: EmailSet - inconsistent behavior with keyword maps?
List-Id: JSON Meta Access Protocol <jmap.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/jmap/HnTtnl1aSYzJ5RQ_QfrAWzggb0Q>
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 Neil,
Incredible, thanks for the thorough explanation! This makes a ton of sense,
and has filled in some gaps in my mental models. Much appreciated!
Best,
Maia
On Mon, Dec 29, 2025 at 11:32 PM Neil Jenkins <neilj@fastmailteam.com>
wrote:
> Hi Maia,
>
> The main thing to understand is that an update in /set
> <https://www.rfc-editor.org/rfc/rfc8620.html#section-5.3> is *patch* to
> the existing object.
>
> To update the $seen flag to TRUE (i.e. to mark a message as unread), both
> of the following syntaxes work:
>
> "update": {"my-message": {"keywords/$seen": true}} # this works, yay!
> "update": {"my-message": {"keywords": {"$seen": true}}} # so does this!
>
>
> So these do different things. The first one just patches the keywords
> property, adding the $seen keyword if not already set. The second one
> *replaces* the entire keywords property, so will blat any existing
> keywords. You almost certainly do not want this!
>
> When trying to unset the $seen flag (i.e. when marking a message as
> read), the first syntax works fine, but the second, nested syntax results
> in an error.
>
> # these work fine
> "update": {"my-message": {"keywords/$seen": false}}
>
>
> That one should be an invalidProperties error; that's a bug in whatever
> server you're testing against. This syntax means you are patching the
> object under the keywords property to map the $seen property to false,
> but that's not a valid value according to the spec
> <https://www.rfc-editor.org/rfc/rfc8621.html#page-25>. All properties
> must map to true.
>
> "update": {"my-message": {"keywords/$seen": null}}
>
>
> This will remove the $seen keyword (if set), which is what you want.
>
> # these won't successfully update my message
> "update": {"my-message": {"keywords": {"$seen": false}}}
> "update": {"my-message": {"keywords": {"$seen": null}}}
>
>
> These are invalid, because you're trying to replace the keywords object
> with a value that's not valid according to the spec
> <https://www.rfc-editor.org/rfc/rfc8621.html#page-25>:
>
> o keywords: "String[Boolean]" (default: {})
>
> A set of keywords that apply to the Email. The set is represented
> as an object, with the keys being the keywords. The value for
> each key in the object MUST be true.
>
>
> Cheers,
> Neil.
>
- [JMAP] EmailSet - inconsistent behavior with keyw… Maia McCormick
- [JMAP] Re: EmailSet - inconsistent behavior with … Neil Jenkins
- [JMAP] Re: EmailSet - inconsistent behavior with … Maia McCormick