Description
When the JMAP server has more contacts than maxObjectsInGet (advertised in session capabilities), the contacts page shows "No contacts yet" with no error message. The user has no indication that contacts exist but can't be loaded.
Steps to reproduce
- Have a Stalwart JMAP server with
maxObjectsInGet: 500 (the default)
- Sync 500+ contacts into the address book (e.g., from a CRM)
- Open Shell → Contacts
- Expected: Contacts are displayed (paginated if needed)
- Actual: "No contacts yet" — empty state, no error in console
Root cause
getContacts() in the JMAP client does:
ContactCard/query → limit: 1000 → returns N ids
ContactCard/get → #ids back-reference → requests all N at once
When N exceeds maxObjectsInGet, Stalwart returns a requestTooLarge error for the ContactCard/get call. The error is caught silently and the contacts store receives an empty array.
Two issues
-
No batching: ContactCard/get should respect maxObjectsInGet from session.capabilities["urn:ietf:params:jmap:core"] and split requests into batches. Per RFC 8620 §5.1, clients should not exceed this limit.
-
Silent failure: When ContactCard/get returns a method-level error, getContacts() returns [] instead of surfacing the error. The fetchContacts store handler catches the exception but the JMAP error path returns empty data without throwing.
Environment
- JMAP web-mail v1.3.3
- Stalwart Mail Server (latest, default config:
maxObjectsInGet: 500)
- ~600 contacts in address book
Workaround
Increase Stalwart's maxObjectsInGet in config:
[jmap.protocol]
get.max-objects = 100000
This works but doesn't fix the client-side issue — jmap-webmail should handle this gracefully regardless of server limits.
Description
When the JMAP server has more contacts than
maxObjectsInGet(advertised in session capabilities), the contacts page shows "No contacts yet" with no error message. The user has no indication that contacts exist but can't be loaded.Steps to reproduce
maxObjectsInGet: 500(the default)Root cause
getContacts()in the JMAP client does:When N exceeds
maxObjectsInGet, Stalwart returns arequestTooLargeerror for theContactCard/getcall. The error is caught silently and the contacts store receives an empty array.Two issues
No batching:
ContactCard/getshould respectmaxObjectsInGetfromsession.capabilities["urn:ietf:params:jmap:core"]and split requests into batches. Per RFC 8620 §5.1, clients should not exceed this limit.Silent failure: When
ContactCard/getreturns a method-level error,getContacts()returns[]instead of surfacing the error. ThefetchContactsstore handler catches the exception but the JMAP error path returns empty data without throwing.Environment
maxObjectsInGet: 500)Workaround
Increase Stalwart's
maxObjectsInGetin config:This works but doesn't fix the client-side issue — jmap-webmail should handle this gracefully regardless of server limits.