Repository navigation
fix(migrate): the revoke route's 404 carries code grant_not_found - #544
Merged
Merged
Conversation
The grant routes answer an unknown grant with data.code 'grant_not_found'; the revoke route answered with the message alone. Migrate settles a refunded order only on that code, so a 404 that is not Studio's own answer (a wrong base URL, a proxy) is retried there instead of being taken as "no grant".
ABB65
added a commit
that referenced
this pull request
Nov 4, 2026
ABB65
added a commit
that referenced
this pull request
Nov 4, 2026
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.
POST /api/migrate/grants/revokeanswered an order with no grant as a 404 carrying only the message. The other grant routes (attach,checkout,connect-project,GET /grants/{id}) also senddata: { code: 'grant_not_found' }.Migrate's refunded-order sweep will settle an order only on that code, so a 404 that is not Studio's own answer (a wrong base URL, a proxy) is retried instead of being read as "no grant". This side ships first; the Migrate side follows once it is live.
What changes
server/api/migrate/grants/revoke.post.ts: the 404 addsdata: { code: 'grant_not_found' }. The docblock says why.Supersedes / removes
Tests
tests/unit/migrate-revoke-route.test.ts: the existing 404 case also pinsdata.code. That file passes (12/12).