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 property with choices sets the property's own value to a choice #1309
Create a text property "stage" with 2 choices, "draft" and "done".
Delete the property.
Press Ctrl+Z.
Expected
The property "stage" is back with its 2 choices, and nothing holds a value of "stage".
Actual
The property is back with its choices, and the property's own page holds the value stage: done. No node held a value of "stage" before the delete.
Notes
The choices of a property are blocks on the property's page. The undo of :delete-page puts the page's blocks back, and inserting a block that is a property value also sets that value on the block's owner (insert-blocks in deps/outliner/src/logseq/outliner/core.cljs). That is a guess at the cause from reading the code; I have not traced it. #1304 is a different case with the same operation: undo of deleting a text property does not give back the values that blocks held.
Found with a property-based test of random outliner operation sequences with undo and redo ([[:delete-page 3 41 false]] in frontend.worker.outliner-undo-property-test, where page 3 is the property "stage"), on upstream master 16c4ed1a0.
Fixed on graphs without sync by logseq/logseq#13786. Undo of deleting a property now replays the delete's recorded datoms, so the property comes back with its choices and nothing holds a value of it. local-graph-undo-of-choice-property-delete-sets-no-value-test pins it (the choices are back and no datoms exist under the property's ident). A synced graph still undoes through the old inverse op, which this PR does not change.
Activity
yuxi-liu-wired commentedon Oct 27, 2026
Fixed on graphs without sync by logseq/logseq#13786. Undo of deleting a property now replays the delete's recorded datoms, so the property comes back with its choices and nothing holds a value of it.
local-graph-undo-of-choice-property-delete-sets-no-value-testpins it (the choices are back and no datoms exist under the property's ident). A synced graph still undoes through the old inverse op, which this PR does not change.