You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Undo made offline is dropped after sync when the other person deleted a block it names #1314
Alice and Bob edit the same synced graph. Page "page 1" holds the blocks a, b, c; page "page 2" starts with the block d.
Alice goes offline.
Alice selects a and c (Ctrl+click both) and drags them below d on page 2 (page 2 open in the right sidebar).
Alice presses Ctrl+Z. a and c are back on page 1.
Bob, online, deletes a.
Alice goes online.
Expected
Alice's move and her undo cancel out, so the result is Bob's change alone: page 1 holds b, c; page 2 is as before.
Actual
c stays on page 2 below d, for Alice and for Bob. The undo Alice saw take effect is gone after the sync, with no message.
When Alice goes online, her client takes off her 2 unconfirmed requests, applies Bob's delete, then applies the 2 requests again (rebase-local-txs!, src/main/frontend/worker/sync/apply_txs.cljs). The move now moves c alone. The undo request names a, which is gone: its replay throws "invalid rebase op", rebase-local-op! (apply_txs.cljs:1625) returns :failed, and the row is marked not pending. The whole undo request is dropped: the move of c is uploaded, its undo never is.
The same happens when the undo names a neighbor that is gone: Alice, offline, moves c to the end of page 2 and presses Ctrl+Z; Bob deletes b. After the sync c stays at the end of page 2. rebase-resolve-target-and-sibling (apply_txs.cljs:1390) has a fallback for a deleted target (its old left sibling, else its parent), but the :move-blocks replay first turns the target's uuid into an id of the current DB (replay-entity-id-value, apply_txs.cljs:1518), which is nil for a deleted block, so the fallback never sees the old target.
A delete can be lost the same way. Bob deletes a and b1 (a child of b). Alice, offline, deletes b with its child b2, presses Ctrl+Z, then deletes a herself. After the sync b and b2 are deleted for everyone.
Found with a 2-person property-based test of undo under sync (random requests of 2 people, random sync points), replayed on upstream master 16c4ed1a0.
Activity