Skip to content

fix(agent-toolkit): write a numeric assetId in finalize_asset_upload - #486

Open
marcin-polak-monday wants to merge 2 commits into
mondaycom:masterfrom
marcin-polak-monday:fix/finalize-asset-upload-integer-asset-id
Open

fix(agent-toolkit): write a numeric assetId in finalize_asset_upload#486
marcin-polak-monday wants to merge 2 commits into
mondaycom:masterfrom
marcin-polak-monday:fix/finalize-asset-upload-integer-asset-id

Conversation

@marcin-polak-monday

Copy link
Copy Markdown
Contributor

Problem

Guests on boards with column permission rules saw "File not found or deleted" for every file uploaded through finalize_asset_upload.

The tool wrote assetId into the file column value as a string. complete_upload.id is a GraphQL ID scalar, so the API serializes it as a string even though the hand written CompleteUploadMutation interface declared it as number. monday.com compares the stored assetId strictly against the asset's numeric id when deciding whether a file column grants access to a file, and a string never matches.

Fix

  • Coerce complete_upload.id with Number() before building the added_file value and in the returned asset_id.
  • Type complete_upload.id as string to match the GraphQL schema.
  • Send isImage so image uploads render a thumbnail in the cell.
  • Pass column_id to complete_upload so the asset is recorded as column bound.
  • Test mock now uses a string id, so the "assetId is a number" assertion actually exercises the coercion.

Companion monolith change: DaPulse/dapulse#114323 makes the server side comparison tolerant of ids already stored as strings.

Tests

yarn jest src/core/tools/platform-api-tools/finalize-asset-upload-tool passes (6 tests).

🤖 Generated with Claude Code

marcin-polak-monday and others added 2 commits September 11, 2026 13:39
The tool wrapped the new asset's id in String() before putting it into the
file column value. monday.com compares that stored value against the asset's
own numeric id when it decides whether a file column grants a user access to
a file, and a string never matches an integer, so guests on boards that have
permission rules got "File not found or deleted" for every file uploaded
through this tool. Board members and admins were unaffected because their
membership short-circuits the check before the comparison happens.

Write assetId as a number. Also send isImage so image uploads render a
thumbnail in the cell, and pass column_id to complete_upload so the asset is
recorded as column bound instead of being left with no columnless metadata.

https://monday.monday.com/boards/8297269624/pulses/12889382164

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… to a number

complete_upload.id is a GraphQL ID scalar, which the API serializes as a
string, so passing it through unchanged still wrote a string assetId into the
file column. Coerce it with Number() before building the added_file value and
in the returned asset_id, type the interface as string, and use a string id in
the test mock so the number assertion actually exercises the coercion.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant