Skip to content

Commit e00b2d8

Browse files
committed
fix(dropbox): correct shared_link_already_exists JSON path
The prior fix read data.error.shared_link_already_exists.metadata, which is wrong per Stone's own JSON serialization rules: a union member whose payload is a struct (SharedLinkMetadata) flattens that struct's fields alongside ".tag" rather than nesting under a wrapper key. The real shape is data.error.shared_link_already_exists directly (with an extra ".tag" field mixed in) - there is no nested .metadata key, so the existing-link fast path never fired before this fix. Also marks list_shared_links' expires output optional, matching every other optional field in this PR and the SharedLinkMetadata spec.
1 parent c526eed commit e00b2d8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

apps/sim/tools/dropbox/create_shared_link.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export const dropboxCreateSharedLinkTool: ToolConfig<
9090
if (!response.ok) {
9191
// A link may already exist for this path - Dropbox includes its metadata in the error
9292
// when the requested settings match the existing link, so surface it as a success.
93-
const existingLink = data.error?.shared_link_already_exists?.metadata
93+
// Per Stone's JSON rules, a union member whose payload is a struct (SharedLinkMetadata)
94+
// flattens that struct's fields alongside ".tag" - there is no nested "metadata" key.
95+
const existingLink = data.error?.shared_link_already_exists
9496
if (existingLink) {
9597
return {
9698
success: true,

apps/sim/tools/dropbox/list_shared_links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const dropboxListSharedLinksTool: ToolConfig<
104104
description: 'Lowercase path of the shared item',
105105
optional: true,
106106
},
107-
expires: { type: 'string', description: 'Expiration date if set' },
107+
expires: { type: 'string', description: 'Expiration date if set', optional: true },
108108
},
109109
},
110110
},

0 commit comments

Comments
 (0)