From 8df483d8c73c8a957853bcffb985aadb8f815778 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Fri, 12 Jun 2026 00:36:45 +0200 Subject: [PATCH] fix: don't send connected-account key as JMAP accountId when sharing files #408 --- stores/file-store.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stores/file-store.ts b/stores/file-store.ts index 471c7824..28c255d7 100644 --- a/stores/file-store.ts +++ b/stores/file-store.ts @@ -1015,11 +1015,14 @@ export const useFileStore = create((set, get) => ({ }, shareResource: async (id: string, principalId: string, rights: FileNodeRights | null) => { - const { client, currentAccountId, refresh } = get(); + const { client, refresh } = get(); if (!client) return; - // Owned nodes are browsed in the current account, so their ids are not - // namespaced; route the share to that account (defaults to the files account). - await client.setFileNodeShare(id, principalId, rights, currentAccountId ?? undefined); + // currentAccountId is the webmail's connected-account key ("user@host"), + // not a JMAP account id - Stalwart parses accountId strictly while + // deserializing the request, so sending it rejects the whole call with + // notRequest. The client is already the per-account client; let + // setFileNodeShare resolve its own files account. + await client.setFileNodeShare(id, principalId, rights); await refresh(); },