Retry gateway failures during device authorization - #8573
Draft
gonzaloriestra wants to merge 1 commit into
Draft
gonzaloriestra wants to merge 1 commit into
gonzaloriestra wants to merge 1 commit into
Conversation
amcaplan
requested changes
Sep 17, 2026
amcaplan
left a comment
Contributor
There was a problem hiding this comment.
The code looks good. One small change I'd like to see, and then I think this PR is ready to go
gonzaloriestra
force-pushed
the
gonzalo/device-authorization-gateway-retries
branch
from
September 18, 2026 13:52
c5faa30 to
9832404
Compare
Contributor
Differences in type declarationsWe detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:
New type declarationspackages/cli-kit/dist/private/node/api/gateway-status.d.ts/**
* Checks whether an HTTP status indicates a gateway-level failure.
*
* @param status - The HTTP status to check.
* @returns Whether the status is 502, 503, or 504.
*/
export declare function isGatewayErrorStatus(status: number | undefined): boolean;
Existing type declarationsWe found no diffs with existing type declarations |
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 are these changes introduced?
Related to https://shopify.slack.com/archives/C0ARV62K59C/p1789515820672379
Temporary gateway failures during sign-in immediately fail device authorization, and non-JSON error responses are reported as CLI bugs.
WHAT is this pull request doing?
Retry device authorization requests that return HTTP 502, 503, or 504 twice. Respect valid
Retry-Afterheaders (seconds or HTTP dates), falling back to delays of 200 ms and 400 ms when the header is missing or invalid. If a non-JSON gateway response persists, report anAbortErrorwith the existing service-error context. JSON error responses retain their existing handling.Share the gateway-status helper with the existing GraphQL error classification and record retry analytics. Include regression coverage and a patch changeset.
How to manually test your changes?
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add