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 of deleting a first child puts it above a block the other person placed first #1315
Alice and Bob edit the same synced graph. Block "tmpl" has 1 child, "tmpl child". Block "c" sits elsewhere.
Alice goes offline.
Alice deletes "tmpl child".
Alice presses Ctrl+Z. "tmpl child" is back under "tmpl".
Bob, online, drags "c" onto "tmpl" so it becomes the first child of "tmpl".
Alice goes online.
Expected
Alice's delete and her undo cancel out, so the result is Bob's change alone: under "tmpl", "c" and then "tmpl child".
Actual
Under "tmpl": "tmpl child" and then "c", for Alice and for Bob.
When Alice goes online, her client applies her delete and her undo again after Bob's move. The replayed undo has no sort key: canonicalize-insert-ops builds the replayed insert through sanitize-insert-block-payload (deps/outliner/src/logseq/outliner/op/construct.cljc:205-209), which removes :block/order. So the undo, applied again, inserts "tmpl child" as the first child of "tmpl", above "c". Undoing from the delete's stored inverse datoms instead puts "tmpl child" back at its old sort key, below "c".
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