fix(streak): return SVG instead of JSON on validation error#5227
Conversation
|
@jatingow is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
…com/jatingow/commitpulse into fix/streak-api-svg-validation-error
Aamod-Dev
left a comment
There was a problem hiding this comment.
Appreciate you taking the time to submit this PR. I went through the implementation and the approach looks solid.
I'm happy to approve this. Great job!
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I went through the changes and everything looks solid. The code is readable, well-structured, and aligns with the project conventions.
I'll go ahead and approve this PR. Thanks again for the contribution!
Aamod-Dev
left a comment
There was a problem hiding this comment.
This PR is currently marked with the \status:blocked\ label. Please resolve the blockers so we can proceed with a full review and approval.
Aamod-Dev
left a comment
There was a problem hiding this comment.
Thanks for the contribution! I went through the changes and have evaluated them according to the rubric.
8fd9668 to
e076390
Compare
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
left a comment
There was a problem hiding this comment.
Excellent bugfix! I went through the changes and returning an actual SVG error badge instead of JSON when validation fails prevents GitHub profiles from displaying broken image links.
Labels applied:
- level:advanced: Modifies core routing returns.
- quality:clean: Proper SVG compilation.
- ype:bug: Fixes severe image rendering issue.
|
🎉 Congratulations @jatingow! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
Description
When the
/api/streakendpoint receives invalid query parameters (e.g. a malformed?user=value that failsstreakParamsSchema.safeParse), it returns a JSON response withContent-Type: application/jsonand status400instead of an SVG image.Fixes #5183
Pillar
Visual Preview
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.