fix(links): send the store-URL field names the API accepts (SIT-423) - #1
Open
onamfc wants to merge 1 commit into
Open
fix(links): send the store-URL field names the API accepts (SIT-423)#1onamfc wants to merge 1 commit into
onamfc wants to merge 1 commit into
Conversation
create_link and update_link declared iosUrl and androidUrl and forwarded args verbatim. The Cloud API accepts iosAppStoreUrl and androidAppStoreUrl, and its schema strips unknown keys rather than rejecting them — so every call carrying store URLs returned success and created a link with none. bulk_create_links reuses linkInputSchema, so it was affected too and is fixed by the same change. The rest of the tool surface was diffed against createLinkSchema: nothing else MCP sends is discarded. Templates already nest their defaults under settings and the UTM schemas already use bare keys, both correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
create_linkandupdate_linkdeclarediosUrl/androidUrland forwarded their parsed args verbatim to the Cloud API. The API acceptsiosAppStoreUrl/androidAppStoreUrl, and its schema strips unknown keys instead of rejecting them — so every MCP call carrying store URLs returned success and created a link with none.Four lines, but a live defect: a store URL passed through MCP is discarded before it reaches the database.
Severity, corrected. I first described this as every affected link losing its store URLs. That overstated it. The create handler applies a fallback chain (
links.ts:341-342) — user input → template default → workspace app config → null. Because the field is stripped,data.iosAppStoreUrlisundefined, so the handler falls through to the template default, which most workspaces configure.Real either way — an explicit argument is discarded — but narrower than first stated.
Why nothing caught it
Nothing could. The MCP schema validated fine, the HTTP call succeeded, the API returned
201, and the link existed.iosAppStoreUrlappeared nowhere in this repo, so there was no mismatch for a type check to find — the two sides simply never agreed on a name, and the transport in between discards disagreements.Found while correcting the API reference documentation (SIT-421), which had the same wrong field names.
Scope check
bulk_create_linksreuseslinkInputSchema, so it was affected too and is fixed by the same change.I diffed the whole MCP link surface against
createLinkSchemaincloud/backend/src/routes/links.ts:settings, matching the Cloud template schema.source,medium,campaign) rather than theutm_-prefixed form that broke the docs in SIT-422.Tool descriptions never named the parameters, so they remain accurate without edits.
Not fixed here
Seven fields the Cloud API accepts that MCP cannot set:
appScheme,iosUniversalLink,androidAppLink,deepLinkPath,customSchemeUrl(present),domainId,eventAttributionWindowHours,appendClickId. Those are feature gaps rather than defects — nothing is silently lost — and the ticket scoped them out. Worth their own ticket if MCP should reach parity.Verification
npx tsc --noEmit— cleannpm run build— cleangrep -rn "iosUrl\|androidUrl" src/returns nothingOne check I could not run: the ticket asks for a live call against a real workspace confirming
ios_app_store_urlcomes back populated. That needs credentials and writes a real link, so it is left for the reviewer. It is the only check that exercises the actual fix end to end — a type check cannot see this class of bug, which is how it shipped.Existing links, and why they cannot be counted
This fixes new writes. Links already created through MCP keep whatever the fallback chain gave them — the template's store URLs rather than the caller's, or none.
The affected set cannot be measured.
POST /api/linkshardcodessource = 'dashboard'(links.ts:393) whether the caller is the dashboard UI or an API key, and nothing else records the transport. MCP-created links are indistinguishable from dashboard-created ones in the database. Isolating them would need a signal recorded at write time, which is what SIT-424 introduces.Closes SIT-423