fix(editor): prevent yjs rebinding on keystrokes#460
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @Rishabhworkspace!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
WalkthroughDecouples editor content tracking from Yjs binding using a ref and adjusts binding dependencies to avoid rebinding on keystrokes; removes debug console logs from the AI chat panel; adds ChangesBug Fix: Yjs Binding Stability, Logging Cleanup, and Git Configuration
🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Suggested reviewers
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 |
Closes #458
Closes #459
What is broken?
The Yjs/Monaco collaboration binding is torn down and rebuilt on every keystroke because
content(the live file text) is incorrectly listed as auseEffectdependency. This causes excessive network calls to/api/collab-tokenand causes remote cursors to flicker and disappear.Fix:
contentRefto track the latest content value without triggering re-renders.contentRef.currentinside the YjsuseEffectfor initial seeding instead of the reactivecontentprop.contentfrom theuseEffectdependency array.Verification:
Summary by CodeRabbit
Bug Fixes
Chores