Skip to content

Undo of deleting a text property turns its values into child blocks #1304

Open

Description

@yuxi-liu-wired

Steps

  1. Create a property of type text (for example "note"), and set it on a block to "text 1".
  2. Delete the property.
  3. Press Ctrl+Z.

Expected

The property is back, and the block's "note" is "text 1" again.

Actual

The property is back, but the block has no "note" value. The text "text 1" appears as an ordinary child block of the block instead.

Notes

After the undo, the value block "text 1" is a live child of the block, and the block holds no value for the property. The cause is not established. It may be the same family as logseq/logseq#1302, where undo of a delete does not restore the references that pointed at the deleted entity.

Found with a property-based test of random outliner operation sequences with undo and redo, replayed on upstream master d9d625847.

Activity

  1. yuxi-liu-wired commented on Sep 26, 2026

    @yuxi-liu-wired
    Author

    A correction to the title: the value becomes a child block at the delete itself, before any undo; the undo only fails to repair it.

    Replayed on master 16c4ed1a0, with a block "Buy milk" whose text property "note" is "2 liters":

    State Value block "2 liters" Buy milk's note
    Before the delete child of "Buy milk", marked created-from-property note "2 liters"
    After deleting "note" child of "Buy milk", mark gone none
    After Ctrl+Z child of "Buy milk", mark gone none

    Deleting the property (build-page-retract-tx, deps/outliner/src/logseq/outliner/page.cljs) retracts each block's value datom and the property entity, but not the value blocks. Retracting the property entity also removes their created-from-property mark, which is what hid them as values, so they show as ordinary child blocks. The undo re-creates the property and does not restore the link or the mark (#1338).

  2. yuxi-liu-wired commented on Oct 27, 2026

    @yuxi-liu-wired
    Author

    Fixed by two PRs. logseq/logseq#13882 fixes the delete itself: deleting a text property now deletes its value blocks with their children, so no stray child blocks are left, and the undo puts the values back on their blocks. It is pinned by delete-property-page-retracts-text-value-blocks and undo-delete-property-restores-text-values. logseq/logseq#13786 fixes the undo on a graph without sync by replaying the delete's recorded datoms (local-graph-undo-of-text-property-delete-restores-values-test); a synced graph still undoes through the inverse op, so #13882 is the fix there.

  3. 79 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions