Context
When User A deletes a node, User B may have pending operations for that node sitting in their operation queue (not yet sent). Currently these stale ops would be sent and silently fail or cause errors. Sim proactively cancels dependent operations client-side when receiving a deletion broadcast.
What to build
Client-side: Queue purging on remote deletion
When receiving a node_delete or edge_delete broadcast:
- Scan the local operation queue for any pending ops targeting the deleted entity
- Cancel/remove those ops from the queue (both node-level and sub-entity ops like text edits)
- Then apply the deletion to local state
This is more efficient than server-side validation — avoids wasting network requests on ops that would fail anyway.
Cascade logic
- Node deletion should cancel:
- All pending ops for that node (move, update, text edits)
- All pending ops for edges connected to that node
- All pending CRDT ops for documents owned by that node
- Edge deletion should cancel:
- All pending ops for that edge
Server-side: Validate stale ops
Current code references
frontend/src/canvas/hooks/useCanvasCollab.ts — inbound event handlers (where deletion broadcasts are received)
frontend/src/shared/events.ts — node_delete, edge_delete event types
Acceptance criteria
Context
When User A deletes a node, User B may have pending operations for that node sitting in their operation queue (not yet sent). Currently these stale ops would be sent and silently fail or cause errors. Sim proactively cancels dependent operations client-side when receiving a deletion broadcast.
What to build
Client-side: Queue purging on remote deletion
When receiving a
node_deleteoredge_deletebroadcast:This is more efficient than server-side validation — avoids wasting network requests on ops that would fail anyway.
Cascade logic
Server-side: Validate stale ops
nackfor ops targeting deleted entities (ties into ack/nack system from issue Server-side operation acknowledgment & client reconciliation #6)Current code references
frontend/src/canvas/hooks/useCanvasCollab.ts— inbound event handlers (where deletion broadcasts are received)frontend/src/shared/events.ts—node_delete,edge_deleteevent typesAcceptance criteria