fix: don't send connected-account key as JMAP accountId when sharing files #408

This commit is contained in:
Linus Rath
2026-06-12 00:36:45 +02:00
parent 1e63e2469a
commit 8df483d8c7
+7 -4
View File
@@ -1015,11 +1015,14 @@ export const useFileStore = create<FileState>((set, get) => ({
}, },
shareResource: async (id: string, principalId: string, rights: FileNodeRights | null) => { shareResource: async (id: string, principalId: string, rights: FileNodeRights | null) => {
const { client, currentAccountId, refresh } = get(); const { client, refresh } = get();
if (!client) return; if (!client) return;
// Owned nodes are browsed in the current account, so their ids are not // currentAccountId is the webmail's connected-account key ("user@host"),
// namespaced; route the share to that account (defaults to the files account). // not a JMAP account id - Stalwart parses accountId strictly while
await client.setFileNodeShare(id, principalId, rights, currentAccountId ?? undefined); // 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(); await refresh();
}, },