fix: add maxLength validation on username input field#935
Conversation
|
@meetparmar392005 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 @meetparmar392005, 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! 🚀 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR tightens GitHub username input handling in the landing page UI and updates the /api/streak invalid-parameters test to assert a structured JSON error response.
Changes:
- Add a 39-character limit to the GitHub username input and display a helper/error message at the limit.
- Update the streak API test to parse JSON and validate
error/detailsfields for invalid parameters.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| app/page.tsx | Adds maxLength for GitHub usernames and renders a length-related message in the form UI. |
| app/api/streak/route.test.ts | Updates invalid-parameter assertions to expect a JSON error payload with details. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| className="flex-1 rounded-xl border border-black/10 bg-gray-100 px-5 py-3.5 text-sm text-black outline-none transition-all duration-200 placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-[#00ffaa] focus:border-transparent dark:border-[rgba(255,255,255,0.08)] dark:bg-[#111] dark:text-white dark:placeholder:text-[#A1A1AA]" | ||
| value={username} | ||
| onChange={(e) => setUsername(e.target.value)} | ||
| maxLength={39} |
| const body = await response.text(); | ||
| expect(body).toContain('Missing'); | ||
| const body = await response.json(); | ||
| expect(response.status).toBe(400); |
|
@meetparmar392005 make pr according to guideline |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
🎉 Congratulations @meetparmar392005! 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! 💻✨ |
Fixes #930
Description
Added input validation on the username field to prevent inputs exceeding GitHub's 39 character username limit.
Changes Made
maxLength={39}attribute to username inputPillar
🐛 Bug Fix — Input validation
Checklist
npm run lintpasses locallynpm run testpasses locally ✅