From 6bc4e32fdeb1e99f8079b53fd941794858b2a8ea Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Fri, 23 Jan 2026 20:54:45 -0300 Subject: [PATCH] fix: remove CRDT observer feedback loop causing drag issues The Yjs map observers were calling notifyNodesChange/notifyEdgesChange for local changes, creating a feedback loop that reset React Flow state mid-drag. Remote notifications are already handled by the connectChannel handler, so the observers only need to schedule persistence. Co-Authored-By: Claude Opus 4.5 --- src/lib/collaboration/crdt.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/collaboration/crdt.ts b/src/lib/collaboration/crdt.ts index 71974a7..e27a3c5 100644 --- a/src/lib/collaboration/crdt.ts +++ b/src/lib/collaboration/crdt.ts @@ -27,16 +27,14 @@ export class CRDTManager { this.edgesMap = this.doc.getMap('edges') this.callbacks = callbacks - // Listen for remote Yjs document changes + // Schedule persistence on local Yjs document changes this.nodesMap.observe(() => { if (this.isApplyingRemote) return - this.notifyNodesChange() this.schedulePersist() }) this.edgesMap.observe(() => { if (this.isApplyingRemote) return - this.notifyEdgesChange() this.schedulePersist() })