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 node property values that pointed at it empty #1302
On a page, set a property of type node (for example "related") to a block on that page.
Delete that block.
Press Ctrl+Z.
Expected
The block is back, and the property value points at it again.
Actual
The block is back, and the property is empty.
Cause
Deleting a block retracts it with :db/retractEntity (-del in deps/outliner/src/logseq/outliner/core.cljs), which also retracts every reference to the block held by other nodes. The undo inverse (build-inverse-delete-blocks in deps/outliner/src/logseq/outliner/op/construct.cljc) inserts the block again from its own attributes and does not record the references that pointed at it, so they stay retracted.
Found with a property-based test of random outliner operation sequences with undo and redo.
Activity
fix: restore node property values when undoing a block delete