fix: Handle HTTP 429 status code for rate limiting#3951
Merged
gmlewis merged 1 commit intogoogle:masterfrom Jan 30, 2026
Merged
fix: Handle HTTP 429 status code for rate limiting#3951gmlewis merged 1 commit intogoogle:masterfrom
gmlewis merged 1 commit intogoogle:masterfrom
Conversation
GitHub API can return either 403 or 429 for rate limiting, but the library was only checking for 403. This caused 429 responses to be treated as generic ErrorResponse instead of RateLimitError or AbuseRateLimitError, breaking retry logic and rate limit handling. Changes: - CheckResponse now detects 429 with X-RateLimit-Remaining: 0 as RateLimitError (primary rate limit) - CheckResponse now detects 429 with secondary rate limit documentation_url as AbuseRateLimitError Reference: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3951 +/- ##
=======================================
Coverage 92.45% 92.45%
=======================================
Files 203 203
Lines 14980 14980
=======================================
Hits 13850 13850
Misses 927 927
Partials 203 203 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gmlewis
approved these changes
Jan 30, 2026
Collaborator
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @abtris!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra
Collaborator
|
Thank you, @Not-Dhananjay-Mishra! |
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.
GitHub API can return either 403 or 429 for rate limiting, but the library was only checking for 403. This caused 429 responses to be treated as generic ErrorResponse instead of RateLimitError or AbuseRateLimitError, breaking retry logic and rate limit handling.
Changes:
Reference: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api