CalendarEvent/get omits explicitly requested isOrigin

Issue Description

CalendarEvent/get does not return the isOrigin property when the client explicitly includes isOrigin in the properties argument.

The property is returned when fetching all properties, but is omitted when using a restricted property list.

isOrigin is a server-set property defined by JMAP Calendars draft-26.

Source inspection suggests a property-projection bug in crates/jmap/src/calendar_event/get.rs.

When processing the requested property list, the IsOrigin branch sets:

return_is_origin = true;

but, unlike the other calculated JMAP properties, does not add the property to jmap_properties.

The value is therefore calculated later, but never inserted into the response object.

Expected Behavior

A request such as:

{
  "accountId": "...",
  "ids": ["..."],
  "properties": [
    "id",
    "organizerCalendarAddress",
    "isOrigin"
  ]
}

should return isOrigin for each returned event.

For an event whose organizerCalendarAddress is null, the specification defines isOrigin as true.

Actual Behavior

When isOrigin is explicitly requested in a restricted properties list, Stalwart omits the property from the returned object.

Fetching the same event without supplying the properties argument takes a different code path and includes isOrigin.

Clients which deserialize an absent boolean as false may consequently interpret the event as isOrigin: false, even when the event’s organizer state implies otherwise.

Reproduction Steps

  1. Create or identify any CalendarEvent.

  2. Fetch it with a restricted property list containing isOrigin, for example:

[
  "CalendarEvent/get",
  {
    "accountId": "...",
    "ids": ["..."],
    "properties": [
      "id",
      "organizerCalendarAddress",
      "isOrigin"
    ]
  },
  "0"
]
  1. Inspect the raw JMAP response.

  2. Observe that isOrigin is absent despite having been explicitly requested.

  3. Fetch the same event again without supplying the properties argument.

  4. Observe that the full-property response includes isOrigin.

Relevant Log Output

No relevant error is logged. The request succeeds normally; the requested property is simply omitted from the response.

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

This confirms the reported bug exactly. Given this is a solid technical bug report with source-level confirmation, I’ll acknowledge it clearly and concisely, matching the fallback style expected for confirmed source issues (not asking for more info, since ripdog already did the legwork).

Your source inspection is correct. In crates/jmap/src/calendar_event/get.rs, the restricted-property branch for JSCalendarProperty::IsOrigin only sets return_is_origin = true but never pushes JSCalendarProperty::IsOrigin into jmap_properties, unlike the return_all_properties path (which explicitly includes it in the property vector) and unlike the other computed properties (UtcStart/UtcEnd, which push the property alongside setting their flag). That means when a restricted list is used, isOrigin is computed later but has no corresponding entry to attach the value to in the response, so it’s silently dropped.

This is a genuine bug matching what you described, thanks for the detailed writeup and source pointer. A human maintainer will follow up on the fix.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Fixed in v0.16.18 (yet to be released).