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
Restoring a page from the Recycle leaves the links to it as plain text #1349
The graph is as it was before step 3: the block reads "see [[Foo]]" with a working link, and Foo's Linked References list the block.
Actual
The block reads "see Foo", plain text, and Foo has no linked references. Restoring does not bring the link back.
Cause
Deleting an ordinary page (delete!, deps/outliner/src/logseq/outliner/page.cljs:144-155) rewrites every block that links to it: db-refs->page replaces the [[<uuid>]] in the block's text by the page's title as plain text (content-id-ref->page, deps/db/src/logseq/db/frontend/content.cljs:29-38) and retracts the block's ref to the page. The page itself goes to the Recycle. restore-tx-data (deps/outliner/src/logseq/outliner/recycle.cljs) moves the page back and retracts the recycle attributes, and nothing records or reverses the text rewrite.
db-test#1310 is the same rewrite seen through undo (of a tag delete); this is the Recycle's own restore of an ordinary page.
Found by the page model property test (frontend.worker.page-model-property-test, branch test/page-model-fuzz) on upstream master 16c4ed1a0, with the check "trash then restore is identity": the graph after the delete and the restore equals the graph before, apart from timestamps and the Recycle's own attributes. Shortest sequence: FUZZ_REPLAY='[[:create 0 0 0] [:link 0 0 0] [:trash 1 0 0]]'. The same difference shows with an unrelated edit between the delete and the restore, compared with that edit alone.
Still on current master (d06ded9971). Moving a page to the Recycle Bin runs delete!, which rewrites every [[uuid]] ref to the page as plain text (db-refs->page, deps/outliner/src/logseq/outliner/page.cljs:143-153); restoring only clears the recycle attributes (restore-tx-data in deps/outliner/src/logseq/outliner/recycle.cljs), so the links stay text.
Two ways to fix it; which one is a maintainer's call:
(a) Do not rewrite refs when a page is only recycled. Refs to a recycled page already render struck through (block.cljs, around lines 855-874), and a permanent delete already turns refs into titles (delete_blocks.cljs). This reverses f819dc4242 ("fix: recycle page refs..."), which added the rewrite on purpose.
(b) Keep the rewrite, record which blocks were rewritten when the page is recycled, and turn them back into refs on restore.
Confirmed on installed 2.0.2 / 533ac43 with a past journal page via native apply-outliner-ops: delete-page rewrites an incoming UUID link to plain date text; restore-recycled leaves both text and missing :block/refs unchanged. SQLite/EDN roundtrip controls preserve the original refs. Disposable no-sync fixture; actual GUI restore not exercised.
Activity
yuxi-liu-wired commentedon Oct 27, 2026
Still on current master (d06ded9971). Moving a page to the Recycle Bin runs
delete!, which rewrites every[[uuid]]ref to the page as plain text (db-refs->page,deps/outliner/src/logseq/outliner/page.cljs:143-153); restoring only clears the recycle attributes (restore-tx-dataindeps/outliner/src/logseq/outliner/recycle.cljs), so the links stay text.Two ways to fix it; which one is a maintainer's call:
block.cljs, around lines 855-874), and a permanent delete already turns refs into titles (delete_blocks.cljs). This reverses f819dc4242 ("fix: recycle page refs..."), which added the rewrite on purpose.Happy to send a PR for either.
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
JaredStemper commentedon Nov 11, 2026
Confirmed on installed 2.0.2 / 533ac43 with a past journal page via native apply-outliner-ops: delete-page rewrites an incoming UUID link to plain date text; restore-recycled leaves both text and missing :block/refs unchanged. SQLite/EDN roundtrip controls preserve the original refs. Disposable no-sync fixture; actual GUI restore not exercised.
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…
fix(recycle): a page removed for good leaves the blocks that linked t…