Skip to content

Redo of creating a namespaced page creates new pages instead of restoring them #1298

Closed
logseq/logseq
#13449

Description

@yuxi-liu-wired

Steps

  1. Create page "ns/child".
  2. Undo.
  3. Redo.

Expected

Pages "ns" and "child" come back with their uuids, so references and sync keep pointing at them.

Actual

Redo creates new "ns" and "child" pages with new uuids. A tag "ns/child" behaves the same. A page with a plain title such as "alpha" comes back with its uuid.

Cause

created-page-uuid-from-tx-data in deps/outliner/src/logseq/outliner/op/construct.cljc looks for a created entity whose title equals the op's title "ns/child", but the created pages are titled "ns" and "child". The recorded create op therefore carries no :uuid, the op has no semantic inverse (undo falls back to reversing the raw transaction), and redo replays :create-page without a uuid.

Found with a property-based test of random outliner operation sequences with undo and redo.

Activity

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

    @yuxi-liu-wired
    Author

    The same cause also shows up through sync, without redo.

    1. Alice goes offline, creates the page "ns/child" and presses Ctrl+Z. Both pages are gone.
    2. Bob, online, edits any block.
    3. Alice goes online.

    The pages "ns" and "child" come back, for Alice and on the server. When Alice goes online, her client takes off her 2 unconfirmed requests, applies Bob's edit, and applies them again: the create runs again, and the undo is dropped. The create is uploaded, its undo is not.

    The same steps on the 2 open pull requests:

    • #13449 (ea7da4346): "child" goes away, "ns" stays, for Alice and on the server.
    • #13453 (46a7bd259): both pages go away, as expected.

    Found with a 2-person property-based test of undo under sync, replayed on upstream master 16c4ed1a0 and on both pull requests.

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