You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(wrapped): eliminate duplicate fetchGitHubContributions call in /api/wrapped route (JhaSourav07#2446)
## Description
FixesJhaSourav07#2247
The /api/wrapped route was calling fetchGitHubContributions twice for
the same user and year range in a single request. The first call happens
inside getWrappedData(), and the second was made directly in the route
handler to get the calendar for SVG rendering.
With refresh=false this was a harmless redundant cache lookup, but with
refresh=true both calls used bypassCache: true, meaning two separate
GitHub GraphQL requests went out for identical data, burning rate limit
quota twice per request.
Added calendar to the WrappedStats interface and returned it from
getWrappedData() since it was already computed there. The route now
reads calendar directly from wrappedStats instead of fetching it again.
Removed the now-unused fetchGitHubContributions import from route.ts.
## Pillar
- [x] 🛠️ Other (Bug fix, refactoring, docs)
## Visual Preview
No SVG changes — backend logic fix only.
## Checklist before requesting a review:
- [x] I have read the `CONTRIBUTING.md` file.
- [x] I have tested these changes locally
(`localhost:3000/api/streak?user=YOUR_USERNAME`).
- [x] I have run `npm run format` and `npm run lint` locally and
resolved all errors (CI will fail otherwise).
- [x] My commits follow the Conventional Commits format (e.g.,
`feat(themes): ...`, `fix(calculate): ...`).
- [x] I have updated `README.md` if I added a new theme or URL
parameter.
- [x] I have started the repo.
- [x] I have made sure that i have only one commit to merge in this PR.
- [x] The SVG output matches the CommitPulse "premium quality" aesthetic
standard (no raw elements, smooth animations, correct fonts).
- [x] (Recommended) I joined the CommitPulse Discord community for
contributor discussions, mentorship, and faster PR support.
0 commit comments