Skip to content

fix(migrate): the revoke route's 404 carries code grant_not_found - #544

Merged
ABB65 merged 1 commit into
mainfrom
t5/revoke-404-code
Nov 4, 2026
Merged

ABB65 merged 1 commit into
mainfrom
t5/revoke-404-code

Conversation

@ABB65

@ABB65 ABB65 commented Nov 4, 2026

Copy link
Copy Markdown
Member

POST /api/migrate/grants/revoke answered an order with no grant as a 404 carrying only the message. The other grant routes (attach, checkout, connect-project, GET /grants/{id}) also send data: { 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 adds data: { code: 'grant_not_found' }. The docblock says why.

Supersedes / removes

  • Nothing.

Tests

  • tests/unit/migrate-revoke-route.test.ts: the existing 404 case also pins data.code. That file passes (12/12).

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
ABB65 merged commit 3347849 into main Nov 4, 2026
2 checks passed
@ABB65
ABB65 deleted the t5/revoke-404-code branch November 4, 2026 11:28
ABB65 added a commit that referenced this pull request Nov 4, 2026
ABB65 added a commit that referenced this pull request Nov 4, 2026
#543)

* chore(release): v0.4.23, connector asks for media on eligible projects

The connector gets the media tools on media-eligible projects (#541).
No migrations, no new environment variables.

* chore(release): v0.4.23 changelog lists #544
ABB65 added a commit that referenced this pull request Nov 4, 2026
#542 landed as a squash (89f30db); the branch carried its commits. Conflicts resolved as
this branch's changes on top of main (3-way with #542's head as base), keeping #541/#543/#544.
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