Skip to content

fix : handle GitHub secondary rate limit in streak-shield with stale indicator#797

Merged
Priyanshu-byte-coder merged 2 commits into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#777
May 23, 2026
Merged

fix : handle GitHub secondary rate limit in streak-shield with stale indicator#797
Priyanshu-byte-coder merged 2 commits into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#777

Conversation

@tmdeveloper007
Copy link
Copy Markdown
Contributor

Closes #777.

Summary of What Has Been Done:
Modified src/app/api/badge/streak-shield/route.ts to include a stale flag when GitHub returns a 403 secondary rate limit response. Updated the StreakData interface to include stale?: boolean.

Changes Made:
Modified: src/app/api/badge/streak-shield/route.ts

  • Updated StreakData interface to include stale?: boolean
  • When GitHub API returns 403 (secondary rate limit), the return value now includes stale: true
  • For other errors, stale is undefined (not present)
  • Badge consumers can now detect rate-limited responses and display fallback content

Impact it Made:
Prevents users from seeing misleading '0 day streak' badges when GitHub rate limits are in effect. Downstream consumers can now detect stale data via the stale flag.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

@TESTPERSONAL 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.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix labels May 23, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Test User added 2 commits May 23, 2026 09:30
…indicator

Closes Priyanshu-byte-coder#777

Modified src/app/api/badge/streak-shield/route.ts to include stale: true in the return when GitHub returns a 403 rate limit response. Updated the StreakData interface to include stale?: boolean. This allows badge consumers to detect when streak data is outdated due to API rate limiting and display appropriate fallback content instead of a misleading zero streak.

Impact: Prevents users from seeing misleading '0 day streak' badges when GitHub rate limits are in effect.
@github-actions github-actions Bot added the type:testing GSSoC type bonus: tests (+10 pts) label May 23, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder added level:intermediate GSSoC: Intermediate difficulty (35 pts) gssoc:approved GSSoC: PR approved for scoring labels May 23, 2026
@Priyanshu-byte-coder Priyanshu-byte-coder merged commit 264023c into Priyanshu-byte-coder:main May 23, 2026
9 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

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:bug GSSoC type bonus: bug fix type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix : handle GitHub secondary rate limit in streak-shield with stale indicator

2 participants