From a10ee48ef3054f0f745a5f33c532065e93dc58ae Mon Sep 17 00:00:00 2001 From: Bernd Rodler Date: Wed, 5 Aug 2026 11:02:35 +0200 Subject: [PATCH] fix(jmap): poll ContactCard/FileNode state too, not just Mailbox/Email/Calendar The mail-index's event-driven reindex depends on this poll to notice contacts/files changes when SSE/WS isn't available - found during the mail-index build's push-wiring investigation (the WS/SSE transport is already type-generic, but this poll fallback wasn't). Mirrors the existing Calendar branch exactly, same accountId resolution pattern. Confirmed the one pre-existing test failure this touches (jmap-client-resilience) is flaky independent of this change - ran the full suite twice with this edit stashed out, got 3 failed then 2 failed with no edit present. --- lib/jmap/client.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/jmap/client.ts b/lib/jmap/client.ts index f7c88a44..16502ccd 100644 --- a/lib/jmap/client.ts +++ b/lib/jmap/client.ts @@ -6071,6 +6071,8 @@ export class JMAPClient implements IJMAPClient { 'Calendar/get': 'Calendar', 'CalendarEvent/get': 'CalendarEvent', 'SieveScript/get': 'SieveScript', + 'ContactCard/get': 'ContactCard', + 'FileNode/get': 'FileNode', }; private static readonly POLLING_INTERVAL = 3_000; @@ -6588,6 +6590,23 @@ export class JMAPClient implements IJMAPClient { ); } + // Contacts and files get no push at all today (mail-index's event-driven + // reindex depends on this poll to notice them when SSE/WS isn't + // available) - mirrors the Calendar branch above, same accountId caveat. + if (this.supportsContacts()) { + using.push('urn:ietf:params:jmap:contacts'); + methodCalls.push( + ['ContactCard/get', { accountId: this.getContactsAccountId(), ids: [], properties: ['id'] }, 'f'], + ); + } + + if (this.hasCapability('urn:ietf:params:jmap:filenode')) { + using.push('urn:ietf:params:jmap:filenode'); + methodCalls.push( + ['FileNode/get', { accountId: this.getFilesAccountId(), ids: [], properties: ['id'] }, 'g'], + ); + } + return { using, methodCalls }; }