fix: improve GitHub rate limit error handling#557
Conversation
|
@yChandrakala23 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
👋 Hey @yChandrakala23, welcome to CommitPulse! 🎉 Thanks for opening your first pull request — this is a big deal and we appreciate the effort! While you wait for a review, please double-check:
A maintainer will review your PR shortly. Hang tight! 🚀 |
|
Hi maintainers, all required CI checks are passing on my side. The only failing check is Vercel deployment authorization, which seems to require project-level access. Please let me know if anything else is needed from my end. |
Aamod007
left a comment
There was a problem hiding this comment.
The author added a handful of well-typed helpers in lib/github.ts to detect 403 and 429 responses by checking the x-ratelimit-remaining header, then wired them into all three GitHub API call sites plus the contributors page. The error messages actually tell you when the limit resets and suggest setting up GITHUB_TOKEN, which is nice. Only tiny thing is that the rate limit headers get parsed twice when an error actually fires, once to decide to throw and again inside the error builder, but that's more of a shrug than a problem. The branch has some unrelated cruft from other PRs, but the author's own commit is clean and focused.
|
Hi @Aamod007, thank you for the detailed review! I checked the branch locally, and the PR currently contains only the intended rate-limit handling changes:
|
|
Please pull the latest changes and resolve the conflicts so we can review it! git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-leaseOnce resolved, the |
1 similar comment
|
Please pull the latest changes and resolve the conflicts so we can review it! git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-leaseOnce resolved, the |
Description
Fixes #536
Pillar
Visual Preview
Not applicable — backend/API error handling change.
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.