fix(contributor): distinguish API errors from user not found#661
fix(contributor): distinguish API errors from user not found#661mayurigade-hub wants to merge 2 commits into
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
More reviews will be available in 56 minutes and 49 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds error state tracking to distinguish "user not found" (404) errors from other API/network failures in the ContributorProfile component. Fetch logic now sets error type accordingly, and the render path returns different messages for each error case. ChangesError State Handling in Contributor Profile
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🤖 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/ContributorProfile/ContributorProfile.tsx`:
- Around line 32-33: The component resets error with setError(null) when
starting a new fetch but doesn't set loading to true; in the ContributorProfile
component locate the fetch-start blocks where setError(null) is called (the
initial fetch block and the second occurrence around the other fetch at the
referenced area) and add setLoading(true) before initiating the async request;
ensure the corresponding promise/finally handlers still call setLoading(false)
after completion so loading state is accurate during the fetch.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 28549b71-931a-4f73-907b-904b2f9e3e98
📒 Files selected for processing (1)
src/pages/ContributorProfile/ContributorProfile.tsx
|
Hello Maintainers |
Related Issue
Description
Improved error handling in
ContributorProfile.tsxby separating "User not found" errors from other GitHub API failures.Previously, all API failures (such as GitHub rate limits, network issues, or server errors) caused the page to display "User not found", which was misleading because the contributor may actually exist.
Changes made:
How Has This Been Tested?
Screenshots (if applicable)
N/A
Type of Change
Summary by CodeRabbit
Bug Fixes