Repository navigation
fix(undo): restore deleted pages with inner refs - #13528
Merged
tiensonqin merged 1 commit intoSep 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Sep 30, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
Undo of deleting today's journal or a tag or property page restores the page's top-level blocks with 1 insert op each. A block that refers to a block of a later op (a node property value) fails to insert, the replay reports :error and undo clears the history. The block-delete path already defers those refs to save-block ops after all inserts; the page-delete paths now share that step.
tiensonqin
force-pushed
the
fix/undo-delete-page-inner-refs
branch
from
September 30, 2026 09:20
1d15844 to
0ab2f6b
Compare
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Sep 30, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Sep 30, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 1, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 1, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 4, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 4, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 8, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 8, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 11, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 13, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
logseq#13476, logseq#13462 and logseq#13458 are in upstream master e2ca31b. logseq#13528 joins.
yuxi-liu-wired
added a commit
to yuxi-liu-wired/logseq
that referenced
this pull request
Oct 16, 2026
logseq#13545, logseq#13546 and logseq#13547 replace the 9 open pull requests they bundle; logseq#13468, logseq#13437, logseq#13475 and logseq#13528 are in upstream master.
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.
Fixes logseq/db-test#1379
What changes
Undo of deleting today's journal, or a tag or property page, did nothing when one of the page's top-level blocks referred to a later one, and it cleared the undo history. For a tag page, the tag stayed deleted. This is the case #13458 fixed for block deletes, on the page-delete path. The review of #13458 pointed it out.
Steps
Cause
build-inverse-delete-page(construct.cljc:944) restores the page's top-level blocks with 1:insert-blocksop each, in both its tag/property branch and its today's-journal branch. A block whose ref value points at a block of a later op fails to insert ("Nothing found for entity id"), the replay reports:error, and undo clears the history (undo_redo.cljs:243). #13458 addeddefer-refs-to-later-plansto the block-delete inverse only.Fix
restore-plans->ops(construct.cljc:844): an insert op per restore plan, then the:save-blockops that set the refs between plans. The block-delete inverse and both page-delete branches use it. The inverse of a delete without such refs is unchanged.Tests
frontend.worker.undo-redo-test: 2 new tests,undo-delete-of-today-page-with-blocks-referring-to-each-other-testandundo-delete-of-tag-page-with-blocks-referring-to-each-other-test. On master they have 7 failures in 9 assertions. With the fix the namespace ran 47 tests with 247 assertions and 0 failures, inTZ=Etc/GMT+12and inTZ=Pacific/Kiritimati.logseq.outliner.move-property-value-undo-test: 4 tests, 63 assertions, 0 failures.Allow edits from maintainers.