Skip to content

fix(graph): prevent e.graphData crash on unmount when navigating to notes#74

Merged
VariableThe merged 1 commit into
mainfrom
fix/graph-data-undefined
Jun 27, 2026
Merged

fix(graph): prevent e.graphData crash on unmount when navigating to notes#74
VariableThe merged 1 commit into
mainfrom
fix/graph-data-undefined

Conversation

@VariableThe

Copy link
Copy Markdown
Owner

Summary

Fixes TypeError e.graphData is not a function when 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-3d cleans up and destroys internal methods on the ref instance (fgRef.current) before GraphView's cleanup hook executes. When the cleanup hook attempted to invoke fg.graphData(), it threw a TypeError.

  • Added defensive verification (typeof fg.graphData === 'function') before calling ref methods.
  • Kept a synchronized graphDataRef to safely fallback to the computed node positions during cleanup.
  • Replaced active setInterval in GraphView.tsx with a chained setTimeout pattern to adhere to project rules.

Verification

  • npm run lint passed
  • npx vitest run passed
  • Documented in CHANGELOG.md and AUDIT_LOG.md

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@VariableThe, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e2b07dfa-3536-48c5-8c08-10b9671a6322

📥 Commits

Reviewing files that changed from the base of the PR and between 0a49515 and 22316de.

📒 Files selected for processing (3)
  • AUDIT_LOG.md
  • CHANGELOG.md
  • src/GraphView.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/graph-data-undefined

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VariableThe VariableThe merged commit bf7e180 into main Jun 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant