feat(client): pass overwrite through packages.install for upgrade flows - #3007
Merged
Conversation
…lows POST /packages now 409s when the manifest id is already installed (#2971, duplicate-id guard). The SDK's packages.install() had no way to opt into the intentional-overwrite escape hatch, so any upgrade / re-install flow built on it would hit the 409 with no recourse. Add `overwrite?: boolean` to the options bag and pass it through the POST body only when explicitly set — the default request stays byte-identical so the server keeps rejecting duplicate ids. First SDK tests for packages.install (default omits the flag; overwrite:true carries it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 12 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
Why
#2971 made
POST /packagesreturn 409 Conflict on a duplicate package id (with anoverwrite: trueescape hatch for intentional upgrade / re-install). The SDK'sclient.packages.install()had no way to set that flag, so any future upgrade/re-install flow built on the SDK would hit the 409 with no recourse. (409-blast-radius audit found no current caller — this is future-proofing the API surface, tracked in objectui#2555.)What
packages.install(manifest, options)options bag gainsoverwrite?: boolean, passed through the POST body only when explicitly set — the default request body stays byte-identical, so the server keeps rejecting duplicate ids by default.Tests
First SDK tests for
packages.install(client.test.ts, existingcreateMockClientharness):overwrite;{ overwrite: true }carries the flag.client.test.ts: 91/91 pass;tsc --noEmitclean.🤖 Generated with Claude Code