Retry GraphQL requests rejected as Throttled without a 429 code - #8317
Open
isaacroldan wants to merge 3 commits into
Open
Retry GraphQL requests rejected as Throttled without a 429 code#8317isaacroldan wants to merge 3 commits into
isaacroldan wants to merge 3 commits into
Conversation
retryAwareRequest already retries rate-limited requests, but only when the response is HTTP 429 or a GraphQL error with extensions.code '429'. Some Shopify APIs (App Management among them) throttle with a 200 response whose GraphQL error message is "Throttled" and no code, so the CLI failed instantly on first rejection. CI logs from throttled E2E jobs running with DEBUG=1 show zero retry attempts, confirming the path was never taken. Match the "Throttled" message as retryable too, reusing the existing retry limit and default backoff. This currently accounts for the top E2E failure mode (32 of 79 failed shards last week) and affects real `app dev`/`app deploy` users the same way. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 task
alfonso-noriega
approved these changes
Aug 13, 2026
amcaplan
reviewed
Aug 13, 2026
| // the message so those are retried too. | ||
| return ( | ||
| error.response.errors?.some( | ||
| (graphqlError) => graphqlError.extensions?.code === '429' || /^throttled/i.test(graphqlError.message ?? ''), |
Contributor
There was a problem hiding this comment.
Regex tests always raise some flags... Is there nothing like a canonical error code we can use? Or at least some tighter enforcement around the message text? So someone can't name an app "throttled" and then retry on user errors...
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?
retryAwareRequestretries rate-limited requests, but only recognizes HTTP 429 or a GraphQL error withextensions.code === '429'. Some Shopify APIs — App Management among them — throttle with a 200 response whose GraphQL error message isThrottled, carrying no status and no code. Those requests fail instantly on first rejection.Evidence: E2E CI jobs run with
DEBUG=1, and jobs that hitThrottledcontain zeroretries exhausted/succeeded after N retriesdebug lines — the retry path never engaged. This is currently the top E2E failure mode (32 of 79 failed shards last week, per the failure-mode dataset), and realshopify app dev/app deployusers hit the same instant failure.WHAT is this pull request doing?
Extends the retryability check (
errorsIncludeStatus429→errorsIncludeThrottling) to also match GraphQL errors whose message starts withThrottled. Everything else reuses the existing machinery: up to 10 retries,Retry-Afterwhen present, 1s default backoff otherwise.How to test your changes?
packages/cli-kit/src/private/node/api.test.tsadds a case mirroring the App Management shape (200 +{message: 'Throttled'}, no code, no retry-after) and asserts the request is retried and succeeds.Measuring impact
The
e2e-failure-reportdataset trackspartners-throttledas a failure mode — it should drop sharply once this lands.🤖 Generated with Claude Code