Skip to content

feat: handle GitHub API rate limits with user-visible feedback (#93)#404

Closed
Harsh-Codes-77 wants to merge 6 commits into
Priyanshu-byte-coder:mainfrom
Harsh-Codes-77:feat/issue-93-v2
Closed

feat: handle GitHub API rate limits with user-visible feedback (#93)#404
Harsh-Codes-77 wants to merge 6 commits into
Priyanshu-byte-coder:mainfrom
Harsh-Codes-77:feat/issue-93-v2

Conversation

@Harsh-Codes-77
Copy link
Copy Markdown
Contributor

Handle GitHub API rate limits with user-visible feedback

Implements graceful rate limit handling for GitHub API 429 responses:

  • New githubFetch wrapper utility centralizes 429 detection and throws typed RateLimitError
  • New RateLimitBanner component displays rate limit status with countdown to reset
  • Updated 4 API metrics routes to catch rate limits and return 429 responses with reset timestamp
  • Updated 4 dashboard components to detect rate limits and show banner instead of generic error

Users now get immediate, friendly feedback when hitting GitHub API limits instead of confusing error messages.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@Harsh-Codes-77 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1. Hardcoded Tailwind colors in RateLimitBanner.tsxborder-amber-500/25, bg-amber-50, text-amber-700 don't respect the theming system. Use border-[var(--warning)]/25 or var(--destructive) variants, or define a --warning CSS var.

2. Missing EOF newlines on githubFetch.ts and RateLimitBanner.tsx.

3. 403 + X-RateLimit-Remaining: 0 not handled — GitHub often returns 403 before ever sending 429 when limits are exhausted. Add detection: if response.status === 403 && response.headers.get('X-RateLimit-Remaining') === '0', treat as rate-limited.

@Priyanshu-byte-coder Priyanshu-byte-coder added level:intermediate GSSoC: Intermediate difficulty (35 pts) gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 20, 2026
Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issues found in this PR:

  • Raw Tailwind color classes — replace text-red-* / bg-red-* with text-[var(--destructive)] / appropriate CSS var equivalents. All colors must use CSS variables for theme support.

…riables, and resolve missing imports in StreakTracker
@github-actions github-actions Bot added the type:design GSSoC type bonus: UI/design (+10 pts) label May 21, 2026
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Merge conflict with current main. Please rebase against main to resolve before this can be merged.

@Priyanshu-byte-coder Priyanshu-byte-coder added the gssoc:approved GSSoC: PR approved for scoring label May 24, 2026
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase on the latest main branch and re-request review. The approach is approved — just needs conflict resolution.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase:

git fetch upstream
git rebase upstream/main

Resolve conflicts and force-push. Will be merged once clean and CI passes.

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has significant merge conflicts with current main — it appears to be based on an older version of the codebase. Please rebase onto current main and resolve all conflicts before this can be merged.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has conflicts with the current main branch. Please rebase on main to resolve conflicts so it can be reviewed and merged. Run: git fetch upstream main && git rebase upstream/main

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has merge conflicts with main. Please rebase onto the latest main branch and resolve conflicts to proceed with merging.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase your branch against the latest main and force-push to resolve. Run: git fetch upstream && git rebase upstream/main

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with the current main branch. Please rebase your branch onto main, resolve the conflicts, and force-push. Once conflicts are resolved and the PR is marked as mergeable it will be reviewed for merging.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase:

git fetch origin
git rebase origin/main
# fix conflicts, then:
git push --force-with-lease

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with the current main branch. Please rebase on the latest main to resolve them — your contribution is labeled for GSSoC scoring.

@Harsh-Codes-77 Harsh-Codes-77 removed their assignment Jun 2, 2026
@Harsh-Codes-77 Harsh-Codes-77 removed their assignment Jun 2, 2026
@Harsh-Codes-77 Harsh-Codes-77 deleted the feat/issue-93-v2 branch June 2, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:intermediate GSSoC: Intermediate difficulty (35 pts) type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants