Update linking page mirrors when a page is renamed by tiensonqin · Pull Request #13147 · logseq/logseq · GitHub
Skip to content

Update linking page mirrors when a page is renamed - #13147

Open
tiensonqin wants to merge 2 commits into
masterfrom
logseq/markdown-mirror-rename-refs-7ef1
Open

Update linking page mirrors when a page is renamed#13147
tiensonqin wants to merge 2 commits into
masterfrom
logseq/markdown-mirror-rename-refs-7ef1

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

When a page is renamed, Markdown mirrors of pages that link to it kept stale [[Old Name]] wiki links until a manual regenerate or an edit of the linking page.

affected-page-ids only queued the pages of entities in tx-data. :rename-page only updates the renamed page's :block/title / :block/name. Linking blocks store [[uuid]] and do not change, so their pages were never remirrored. Export already resolves those UUIDs to the current title, so remirroring the linking page is enough.

This change also queues pages of blocks that reference the renamed page via :block/_refs when a page entity's title or name is added. Regular block title edits are unchanged.

Fixes logseq/db-test#1132

Test plan

  • affected-page-ids includes both the renamed page and the linking page
  • After rename + <handle-tx-report!, Source.md contains [[TargetNew]] and not [[TargetOld]]
  • Existing rename path cleanup tests remain green

Test evidence

LOGSEQ_STABLE_IDENTS=1 node static/tests.js -n frontend.worker.markdown-mirror-test

Ran 46 tests containing 77 assertions.
0 failures, 0 errors.

Focused rename cases:

Ran 4 tests containing 10 assertions.
0 failures, 0 errors.

Includes affected-page-ids-includes-linking-pages-on-page-rename-test, rename-updates-linking-page-mirror-test, rename-removes-old-mirror-path-test, and rename-with-unchanged-content-removes-old-mirror-path-test.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 31, 2026 16:51
Page renames only remirrored the renamed page. Linking pages still stored
[[uuid]] titles, so their Markdown mirrors kept stale [[Old Name]] wiki links
until a manual regenerate. Queue referring pages when a page title or name
changes.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@tiensonqin
tiensonqin marked this pull request as ready for review August 31, 2026 16:54
Copilot AI lite review requested due to automatic review settings August 31, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page name changes are not automatically reflected in linked block mirrors

3 participants