fix(packages): register PATCH /packages/:id so edit-manifest reaches the handler#2995
Merged
Conversation
…the handler handlePackages has handled `PATCH /packages/:id` (edit a package's name / description / version) all along, but the route was never mounted in dispatcher-plugin — only GET/DELETE `/:id` and PATCH `/:id/enable|disable` were. So `PATCH /packages/:id` 405'd over HTTP and the Studio "edit package" form silently failed (surfaced dogfooding the builder header refresh). Register the missing route, mirroring the GET/DELETE `/:id` handlers. `/:id` is a single path segment, so it does not shadow the `/:id/enable|disable` routes. Adds a route-registration regression test (same class as the /ready seam bug, #2217). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 16 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.
Problem
handlePackageshas handledPATCH /packages/:id(edit a package's name / description / version) since the edit-manifest feature landed, but the route was never mounted indispatcher-plugin. OnlyGET/DELETE /packages/:idandPATCH /packages/:id/enable|disablewere registered.Result:
PATCH /packages/:idreturns 405 Method Not Allowed (Allowed: DELETE, GET, HEAD) over HTTP, so the Studio "edit package" form silently fails end-to-end. Found while dogfooding the Studio builder header-refresh (objectui).Fix
Register
server.patch('/packages/:id')mirroring the existing GET/DELETE/:idhandlers, forwardingreq.body/req.querytohandlePackages(..., 'PATCH', ...)./:idis a single path segment so it does not shadow the/:id/enable|disableroutes.Test
Adds a route-registration regression test in
dispatcher-plugin.routes.test.ts(same harness/class as the/readyseam bug #2217): assertsPATCH /api/v1/packages/:idis mounted.dispatcher-plugin.routes.test.tspasses (6 tests).🤖 Generated with Claude Code