fix : remove ineffective AbortController from useRecentRepos#2419
fix : remove ineffective AbortController from useRecentRepos#2419tmdeveloper007 wants to merge 1 commit into
Conversation
Issue: nisshchayarathi#1622 useRecentRepos initializes an AbortController but the useEffect does not make any async fetch calls — only a synchronous localStorage read. The controller.signal.aborted check fires immediately after creation (before any async operation) so it can never detect a genuine abort signal. The controller.abort() call in the cleanup function has no target to abort. Fix: remove the AbortController pattern entirely since localStorage reads cannot be cancelled. The synchronous read is fast and the setIsLoaded(true) in both branches makes the existing isMounted flag redundant.
|
Someone is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesuseRecentRepos localStorage Init Simplification
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
|
CI Status Check (2026-06-20): CI pipeline summary:
Note: The Type Check failure is a pre-existing issue in upstream/main. This PR only touches src/hooks/useRecentRepos.ts and does not introduce any new type errors. |
|
Closing this PR. The branch is based on an older commit of upstream/main and has drifted from the current main. The upstream repository has received significant updates since this PR was opened, causing CI type-check and test failures due to merge conflicts with the base branch. Please re-open as a fresh PR against the current main if the fix is still needed. |
Summary
useRecentReposinitializes anAbortControllerbut theuseEffectdoes not make any async fetch calls — only a synchronouslocalStorageread. Thecontroller.signal.abortedcheck fires immediately after creation so it can never detect a genuine abort signal.Changes
AbortControllerandisMountedflag fromuseRecentRepossince localStorage reads are synchronous and cannot be cancelled.Impact
Note
Assign to tmdeveloper007
Summary by CodeRabbit