Repository navigation
fix(sources): report GitHub rate limits cleanly - #27
Merged
Merged
Conversation
GitHub's trending page can return a 429 abuse page with a raw JSON body from Cloudflare's shared egress. Store a concise "temporarily rate-limiting this source; showing cached items" message instead, so the health payload and UI banner stay readable. Cached GitHub items remain in place until the next refresh. Add a source-level test that stubs three 429 responses and verifies the clean message (and that GitHub's raw body is not exposed). Co-Authored-By: Claude Code <noreply@anthropic.com>
|
🔎 Cloudflare preview: https://7318862b-feedreader.phatpham9.workers.dev Uploaded from |
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.
Summary
GitHub's trending page can return a
429abuse/rate-limit page with a raw JSON body from Cloudflare's shared egress. The source now stores a concise message instead:Cached GitHub items remain in place until the next refresh. The existing 1s/3s
429retries are unchanged; GitHub's multi-minute blocks still resolve on the next hourly attempt.Verification
npm run typechecknpx vitest run --exclude '.claude/**'— 18 files, 148 tests429responses and verifies:"Access to this site has been restricted"body is not exposednpm run db:migrate:localContext
Production at 03:00 UTC hit GitHub's
429abuse page; a manual refresh at 03:35 succeeded and/healthzreturned to all-green. This PR only improves the failure message; no retry/architecture change.🤖 Generated with Claude Code