Repository navigation
fix: retry http JSON-RPC errors from non-2xx responses by status - #5286
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: ba85417 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58741d0081
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const retryAfter = | ||
| getHttpError(error)?.headers?.get('Retry-After') | ||
| if (retryAfter?.match(/\d/)) | ||
| return Number.parseInt(retryAfter, 10) * 1000 |
There was a problem hiding this comment.
Parse HTTP-date Retry-After values before retrying
When a non-2xx JSON-RPC response supplies the valid HTTP-date form of Retry-After (for example, Sat, 24 Oct 2026 04:00:00 GMT), /\d/ accepts the header but Number.parseInt returns NaN; withRetry then treats that delay as falsy and retries immediately. This can turn a provider's explicit backoff request into a rapid retry burst, so parse both delay-seconds and HTTP-date forms and calculate the remaining delay.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changed in this PR: HttpRequestError already uses the same Retry-After parsing, so HTTP-date support is left for a separate fix.
🤖 Addressed by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0053e28bf0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…etry # Conflicts: # src/utils/buildRequest.ts # src/utils/rpc/http.ts
Non-2xx
httpresponses with a JSON-RPC error body now throwRpcRequestErrorcarryingstatusandheaders. Retries then follow the HTTP status andRetry-After, while the RPC error class and revert data are kept.Related: #5282