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 of deleting a block leaves block references to it as plain text #1325
In another block, type see (( and pick "target", so the block holds a reference to "target".
Delete the block "target". The other block now reads "see target" as plain text.
Press Ctrl+Z.
Expected
"target" is back, and the other block holds its reference to "target" again.
Actual
"target" is back, but the other block still reads "see target" as plain text, with no reference to "target".
Cause
Deleting a block also rewrites every ((uuid)) reference to it in other blocks' titles into the deleted block's text, and retracts those blocks' refs to it (build-retracted-tx in deps/db/src/logseq/db/common/delete_blocks.cljs, which ldb/transact! adds to the delete's transaction). The undo inverse (build-inverse-delete-blocks in deps/outliner/src/logseq/outliner/op/construct.cljc) inserts the deleted blocks again and holds nothing for the blocks whose titles were rewritten. Same family as #1302 (node property values that pointed at the deleted block) and #1310 (links to a deleted tag).
Found with a property-based test of random outliner operation sequences with undo and redo, replayed on upstream master 16c4ed1a0: the other block's raw title is edit ((<uuid of b2>)) with b2 in its refs before the delete, edit b2 after the delete, and still edit b2 with no refs after the undo. The same replay with the app's worker transaction pipeline registered (ldb/register-transact-pipeline-fn! worker-pipeline/transact-pipeline) gives the same result.
Fixed in logseq/logseq#13786 (fix(db): sync checksum and local graphs, page and tag names, orphaned pages, tag deletion, recycled values, and unreachable code). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.
Activity
test(undo): pin db-test 1325 and 1326 on graphs without sync
yuxi-liu-wired commentedon Oct 28, 2026
Fixed in logseq/logseq#13786 (fix(db): sync checksum and local graphs, page and tag names, orphaned pages, tag deletion, recycled values, and unreachable code). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
1 remaining item
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync
test(undo): pin db-test 1325 and 1326 on graphs without sync