Skip to content

fix(sources): report GitHub rate limits cleanly - #27

Merged
phatpham9 merged 1 commit into
mainfrom
fix/github-429-message
Nov 14, 2026
Merged

phatpham9 merged 1 commit into
mainfrom
fix/github-429-message

Conversation

@phatpham9

Copy link
Copy Markdown
Member

Summary

GitHub's trending page can return a 429 abuse/rate-limit page with a raw JSON body from Cloudflare's shared egress. The source now stores a concise message instead:

GitHub is temporarily rate-limiting this source; showing cached items until the next refresh

Cached GitHub items remain in place until the next refresh. The existing 1s/3s 429 retries are unchanged; GitHub's multi-minute blocks still resolve on the next hourly attempt.

Verification

  • npm run typecheck
  • npx vitest run --exclude '.claude/**' — 18 files, 148 tests
  • New source-level test stubs three 429 responses and verifies:
    • the clean rate-limit message is returned
    • GitHub's raw "Access to this site has been restricted" body is not exposed
  • npm run db:migrate:local

Context

Production at 03:00 UTC hit GitHub's 429 abuse page; a manual refresh at 03:35 succeeded and /healthz returned to all-green. This PR only improves the failure message; no retry/architecture change.

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

🔎 Cloudflare preview: https://7318862b-feedreader.phatpham9.workers.dev

Uploaded from bb0476f5b2163e5c453e8128fe2f7ad495202f87. This is a Worker version preview — it shares the production D1 database, so it reads/writes real data; it does not receive cron-triggered refreshes.

@phatpham9
phatpham9 merged commit c7f2b1b into main Nov 14, 2026
3 checks passed
@phatpham9
phatpham9 deleted the fix/github-429-message branch November 14, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant