Skip to content

DB: Restoring an ancestor can leave a previously opened nested page body empty #1388

Closed
logseq/logseq
#13577

Description

@tiensonqin

Summary

A nested #Page can reopen with an empty body after its ancestor is restored from Recycle, even though the descendant's saved blocks are still present. The page breadcrumb updates to the live parent correctly. Visiting the restored parent and opening the child through its page icon refreshes the missing content.

This is a rendering/refresh problem, not observed permanent data loss.

Environment

  • Logseq DB development build from clean master 8ffbb220938acc00e1c70e8579e7c52ab97c2aa7
  • Logseq 2.0.1, Electron 42.3.0, Chromium 148.0.7778.180
  • Debian 13, Linux x86_64
  • Both loaded renderer and Node DB worker report revision 8ffbb22, build 2026-10-01T14:32:34Z
  • Local disposable DB graph; no sync, plugins, or direct database edits
  • Verified through the actual Electron GUI. Web was not tested
  • Latest origin/master still equals this SHA at 2026-10-01 16:46 UTC

Minimal fixture

An ordinary page QA-E-Visibility containing a block QA visibility child tagged with the built-in #Page. Open that child page and save one or more ordinary content blocks, e.g. QA visibility content intact.

Reproduction

  1. Create the fixture above. Reload while on the child and verify its saved content is visible. Its breadcrumb is Library / QA-E-Visibility.
  2. Click the parent breadcrumb. Right-click the ordinary parent's title, choose Delete page, and confirm the recoverable deletion. Do not independently delete the child.
  3. Return to the child through navigation history if deletion has not already returned there. Its breadcrumb now reads Recycle / QA-E-Visibility.
  4. Press Ctrl+R while on this inherited-recycled child. It shows an empty body.
  5. Click the Recycle breadcrumb. On the parent's row, click Restore, not Delete.
  6. Click the application's Back arrow to return to the child.
  7. Observe that the breadcrumb is live again (Library / QA-E-Visibility), but the body still appears empty instead of showing the saved content.
  8. Click the parent breadcrumb, then click the child page's icon in the parent. The original content appears again without any content edits or database repair.

Expected

Restoring the ancestor should refresh the descendant's content when the live child is opened, with no intermediate empty view requiring another navigation path.

Actual and frequency

  • Observed twice in two ancestor delete/restore cycles on the same parent/child pair in one local graph.
  • In the isolated second cycle, two saved blocks were visibly verified after reload before deletion (16:40:09 UTC).
  • Reloading the child while inherited-recycled produced the empty view (16:42:53).
  • Restore parent -> Back returned to a live-breadcrumb child with no displayed content (16:44:03).
  • Parent breadcrumb -> child page icon recovered both original blocks (16:45:06), with no intervening content edit or reload.
  • In the first cycle, opening the restored child from All Pages also showed the empty body. Typing an additional sentinel into that apparent empty list and reloading displayed both the original and new blocks. This first recovery combined an edit and reload; the second cycle above isolates a navigation-only recovery.

Controls / related reports

Source lead (hypothesis, not a confirmed root cause)

At this SHA, children membership reads consider the full recycled ancestor chain, while incremental membership changes are derived from directly changed entities. Restoring an ordinary ancestor page may therefore leave the previously loaded empty descendant membership view without a refresh. Ready subscription slots can be reused.

Activity

  1. yuxi-liu-wired commented on Oct 28, 2026

    @yuxi-liu-wired

    Still on current master (d06ded9971), with the cause the report suggests: direct-children-membership returns no rows while any ancestor is recycled, but membership-at in src/main/frontend/worker/render_delta.cljs only looks at an entity's own deleted-at. Restoring an ancestor therefore emits no children patches for the parents inside the restored subtree, and the renderer keeps their cached empty child lists until a reload. A fix is a render-protocol choice: emit children patches for every parent in the restored subtree, or have a restore invalidate the renderer's cache for that subtree.

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