Rebasely Beta: data may be purged

examples/live-notes Public

Markdown · 30 lines · 1.2 KiB · at 99dd857

---id: 0002-drop-inserts-inside-concurrent-deletestype: decisionowner: justinreviewed: 2026-10-13status: accepted---# 0002 Drop inserts inside a concurrent delete## ContextAlice deletes a sentence while Bob types a word in the middle of it. To keep Bob's word, thedelete has to be split into two deletes around it, which means an op can turn into severalops, and every transform rule then has to handle lists.## DecisionAn insert that lands strictly inside a range someone else deleted at the same time is dropped,and the delete grows to cover the inserted text. Both orders of applying the two ops give thesame result: the sentence and Bob's word are gone.An insert exactly at either end of the deleted range is kept.## Consequences- Every transform returns exactly one op, and `transform()` stays a few lines per case.- Bob loses a word he typed into text that was being deleted. He sees it disappear right away,  and in practice he was typing into a sentence somebody else had decided to remove.- If this ever matters, splitting deletes is a contained change to `src/ops.ts`; the room,  the protocol and the session would not change. See [[conflict-strategy]].