Repository navigation
fix: undo bugs for pages, namespaced pages, tags and properties - #13449
Merged
Merged
Conversation
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
There was a problem hiding this comment.
✅ Devin resolved all 3 findings on ea7da43
Fixed by Devin (3)
- Slash-formatted journals lack page identity
- Shared namespace deleted twice on undo
- Namespaced tag redo loses identity
megayu
force-pushed
the
devin/1790403479-undo-fixes-dbtest
branch
from
October 29, 2026 12:18
ea7da43 to
3325b50
Compare
megayu
approved these changes
Oct 29, 2026
tiensonqin
force-pushed
the
devin/1790403479-undo-fixes-dbtest
branch
from
November 5, 2026 08:36
3325b50 to
12e52f2
Compare
- Record the created page's uuid by matching tx-data datoms against the page's namespace title chain, so undo/redo of namespaced page creation (e.g. 'ns/child') targets the leaf page instead of an arbitrary entity and redo restores the recycled page's uuid. - Replay create-page by restoring the recycled page when the recorded uuid still resolves to it. - Ignore recycled pages when validating title uniqueness, so undoing a rename back to a title held by a recycled page succeeds. - Resolve a created property's db/ident from tx-data before falling back to title lookup, so undo removes the newly created property when an existing one shares its name. - Delete tags created in the same transaction when undoing create-page. - Compare top-level blocks by document position (page id + ancestor order path) instead of raw :block/order, which is only unique within a parent, so undo/redo of outdent on a selected range doesn't reorder blocks.
- :create-page inverse now also deletes namespace ancestors created in the same transaction (walked via :block/parent or :logseq.property.class/extends), so undoing a namespaced create leaves no orphaned parent pages. - created-page-title-match? follows the extends chain for class/tag pages, so namespaced tags keep their uuid through undo/redo too. - :create-page replay restores recycled ancestors (top-down, re-reading entities per step) before restoring the page itself.
- created-page-title-match? accepts an exact title match, so pages whose title contains a slash without namespace splitting (e.g. journals like '2026/09/26') keep their uuid through undo/redo. - Inverse ops dedupe [:delete-page uuid] keeping the last occurrence: creating a/b and a/c in one action no longer recycles their shared ancestor twice, which overwrote its original-parent.
tiensonqin
force-pushed
the
devin/1790403479-undo-fixes-dbtest
branch
from
November 5, 2026 08:44
933a0b4 to
f3ad455
Compare
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 11, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 12, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 13, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 16, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 17, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
…age order get-top-level-blocks used to decide a consecutive selection was reversed by comparing the :block/order of its first 2 blocks. Order values are comparable only between siblings, but a last child and the block after its parent count as consecutive too; for those 2 the values are unrelated, and a move could reverse them (db-test logseq#1297: after an undo re-orders the second block, the redo moves it first). Master's aed1f88 (logseq#13449) now compares the 2 blocks by their document order path (page, then each ancestor's order), which fixes this, so this commit keeps only the regression test.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
A property value selected with its parent's next sibling must stay in the move or delete. This commit used to guard the page-order sort this PR added to get-top-level-blocks; master's aed1f88 (logseq#13449) replaced that sort with a document-order comparison that keeps every block, so only the regression test remains.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Nov 18, 2026
Since master's logseq#13449 the undo of a page create recycles the page and its new namespace parents and tags, and redo restores them with their uuids; master pins this with tests on a local graph. This branch's local-graph undo replayed the create's tx datoms instead, which retracts the page, so those tests failed after the rebase. A page create on a local graph now keeps its client-op row and semantic ops, and its undo and redo take the semantic path as on a synced graph (replays-tx-datoms?); every other local transaction still replays its datoms. The redo-create-page test no longer marks its graph synced, and the pipeline replay test expects the page recycled after the undo. That pipeline replay test also changed Movie's parent tag to Root with set-block-property; since master's logseq#13287 adding Root next to another parent is ignored, so the change recorded no undo entry. It now removes the parent tag, which gives Movie the Root tag as parent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes five undo/redo bugs around page creation and renaming:
created-page-uuid-from-tx-datapicked an arbitrary:block/uuiddatom from tx-data, so for namespaced titles likens/childit could record thenspage's uuid instead of the leaf's, and undo/redo lost the page's identity. It now resolves each candidate uuid indb-afterand requirescreated-page-title-match?: the entity's:block/titleplus its:block/parentchain must match the reversed/-split title parts.apply-history-action!:create-pagereplay: when the recorded:uuidresolves to a recycled page, restore it viaoutliner-recycle/restore-tx-datainstead ofcreate!— for namespaced titlescreate!would transact a fresh leaf map onto the same uuid, leaving:logseq.property/deleted-atset.validate-unique-for-pagecounted recycled pages (which keep:block/title) as title conflicts, so undoing a rename back to a title held by a recycled page threw and cleared undo history. Recycled entities are now filtered out.:upsert-propertycanonicalization now resolves the created property'sdb/identfrom tx-data (created-db-ident-from-tx-data, fixed to work on Datom records) before falling back toproperty-ident-by-title, which could return the pre-existing property's ident and leave the newly created one behind on undo.:create-pageinverse now deletes non-built-in tags that were created in the same transaction (resolved via the created page's:block/tagsabsent fromdb-before), before the page delete.get-top-level-blocksdetermined selection direction by comparing raw:block/order, which is only unique within a parent; blocks from different parents now compare by document path (:db/idof the page + ancestor:block/orderchain).Regression tests added in
frontend.worker.undo-redo-testandlogseq.outliner.op-construct-test. Verified:frontend.worker.undo-redo-test(33 tests),frontend.undo-redo-test, outliner nbb suite (136 tests),bb lint:kondo-git-changes— all green.Link to Devin session: https://app.devin.ai/sessions/6139319108654943bb5de5f78070ce63
Open in Devin Desktop: https://app.devin.ai/desktop/session/6139319108654943bb5de5f78070ce63?variant=devin
Requested by: @tiensonqin