fix(graph): prevent e.graphData crash on unmount when navigating to notes#74
Conversation
|
Warning Review limit reached
More reviews will be available in 11 minutes and 54 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?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 credits. 🚦 How do rate 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 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 (3)
✨ 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 |
Summary
Fixes TypeError
e.graphData is not a functionwhen clicking a node in Graph View to navigate to a note.Root Cause & Fix
When clicking a note in Graph View, React unmounts the component tree. During unmount,
react-force-graph-3dcleans up and destroys internal methods on the ref instance (fgRef.current) beforeGraphView's cleanup hook executes. When the cleanup hook attempted to invokefg.graphData(), it threw a TypeError.typeof fg.graphData === 'function') before calling ref methods.graphDataRefto safely fallback to the computed node positions during cleanup.setIntervalinGraphView.tsxwith a chainedsetTimeoutpattern to adhere to project rules.Verification
npm run lintpassednpx vitest runpassedCHANGELOG.mdandAUDIT_LOG.md