From 4fe0120318231d7eb98c8698e2454276e4382945 Mon Sep 17 00:00:00 2001 From: Juan Castro Date: Wed, 12 Aug 2026 19:26:49 -0400 Subject: [PATCH] fix(share): return the created share, not just an acknowledgement --- src/backend/controllers/share/ShareController.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/backend/controllers/share/ShareController.ts b/src/backend/controllers/share/ShareController.ts index 35220c61e..4f490c23a 100644 --- a/src/backend/controllers/share/ShareController.ts +++ b/src/backend/controllers/share/ShareController.ts @@ -64,11 +64,18 @@ const LIST_LIMIT_CAP = 200; export const DEFAULT_MAX_RECIPIENTS = 10; export const DEFAULT_MAX_ITEMS = 50; +/** A success carries the created share; a failure carries why. */ interface ShareOutcome { recipient: string; - path?: string; status: 'success' | 'error'; + path?: string; + uid?: string; mode?: string; + uid_entry?: string; + is_dir?: boolean; + issuer?: string | null; + holder?: string | null; + created_at?: unknown; message?: string; code?: string; } @@ -121,12 +128,13 @@ export class ShareController extends PuterController { const { recipient, item } = pairs[index]; const label = recipient.email ?? recipient.username ?? ''; if (outcome.status === 'fulfilled') { + // The whole share, not just an acknowledgement, so a caller + // needn't re-read to learn what it created. const share = outcome.value as ResolvedShare; return { + ...this.#toClientShare(share), recipient: label, - path: share.path, status: 'success', - mode: share.mode, }; } return {