Repository navigation
Conversation
…fter When admission control refuses a request because its API has too many requests in flight, the server answers HTTP 429 with Retry-After and the CONCURRENCY_LIMIT_REACHED code. The client parsed that code but isRetryable() did not list it, and Retry-After was dropped, so callers could neither tell the refusal would clear nor how long to wait. isRetryable() now includes CONCURRENCY_LIMIT_REACHED. An HTTP error's Retry-After, in seconds or as an HTTP date, is kept in the error's context as retryAfterSeconds, and retryAfterMs(error) reads it, for use in retry delays. The codegen client re-exports the helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
When admission control refuses a request because its API already has too many requests in flight, the server answers HTTP 429 with
Retry-Afterand theCONCURRENCY_LIMIT_REACHEDcode. On the client side:isRetryable()doesn't list it, so retry logic built on it gives up on a refusal that's designed to clear;Retry-Afteris dropped, so a caller that does retry can't wait as long as the server asked.Change
isRetryable()now includesCONCURRENCY_LIMIT_REACHED.Retry-Afteron an HTTP error response, in seconds or as an HTTP date, is kept in the error'scontextasretryAfterSeconds. The server's own context, such aslimit, is kept alongside it.retryAfterMs(error)returns that wait in milliseconds, orundefinedwhen the response had none. It's exported from@constructive-io/graphql-query, and the codegen client re-exports it like the other error helpers.For example, with React Query:
Not in this PR
SCHEMA_BUILD_UNAVAILABLE) belongs in the same list; itsRetry-Afteris already picked up by this change.BAD_USER_INPUT. Classifying those by status is a separate change.Tests
graphql/query/__tests__/client-retry.test.tsdrivesexecuteagainst mockedfetchresponses:Retry-After: 5as 5000 ms;Retry-Afteris read, within a second;Retry-After, or an unreadable one, leaves the wait undefined while the refusal stays retryable;Removing the new code from the list fails three of these; dropping the
Retry-Afterhandling fails two.Run locally
graphql/query: 63 passed;tsc --noEmitforgraphql/queryandgraphql/codegen;🤖 Generated with Claude Code
Summary by CodeRabbit