fix: sanitize username parameter by stripping leading @ symbol to prevent search API 422 errors - #164
Conversation
…vent search API 422 errors
|
Warning Review limit reached
Next review available in: 41 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughChangesContributor profile recovery
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/ContributorProfilePage.jsx`:
- Line 464: Update the JSX text in the ContributorProfilePage render near
cleanUsername and username to replace both literal quotation marks with ",
preserving the displayed output and removing the no-unescaped-entities warning.
- Line 154: In the ContributorProfilePage username-handling flow, clear the
existing error state before the early return when cleanUsername is empty. Ensure
navigating to an empty contributor profile removes any previous error card
without affecting the normal fetchData path for valid usernames.
- Around line 182-203: Add regression tests for the fetch logic surrounding the
authenticated Promise.all and its catch branch: verify that HTTP_422 failures
with a PAT retry both url and mergedUrl using public headers, and that non-422
failures are rethrown without making unauthenticated requests.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e42c128c-2f1e-4f5b-ac67-1877b300d97d
📒 Files selected for processing (1)
src/pages/ContributorProfilePage.jsx
…sts, and fix unescaped jsx quote lints
|
@Ri1tik ,
The changes are ready for your review! |
Addressed Issues:
Fixes #137
Description of Changes:
Resolves a GitHub Search API validation failure (
HTTP_422 Unprocessable Entity) on the Contributor Profile dashboard.@symbol from the URL route username parameter before dispatcing queries, preventing query compilation crashes likeq=author:@username.HTTP_422status (which happens when a configured fine-grained PAT lacks read permission scopes for the target organization index), the application will catch the error and automatically retry the request as a public unauthenticated call.Screenshots/Recordings:
Resolved Profile Page Output:
Original Error Issue:
Additional Notes:
@prefix styling natively (@username) while only cleaning it for internal queries and markdown file export names.Checklist
Summary by CodeRabbit