Skip to content

DB: Partial EDN import leaves new pages and blocks missing from search until index rebuild #1385

Open
logseq/logseq
#13886

Description

@tiensonqin

What happened

Import EDN data successfully creates pages and blocks, but the new content is omitted from Ctrl+K search. The page is visible in Pages and its blocks are intact. Reloading does not repair the missing search entries.

Editing one imported block makes that block searchable, while untouched imported content stays missing. Rebuild search index restores the missing page and block results.

This report is specifically about partial EDN import into an existing local DB graph. The related closed #317 described whole-SQLite-graph import after file migration; it did not contain this minimal partial-EDN reproduction.

Minimal reproduction

Use a local DB graph whose search works for an ordinary page created through the UI. Ensure the following page does not already exist.

  1. Press Ctrl+K, search for Import EDN data, and select that item under Commands, not Create page.
  2. Enter this complete synthetic payload:
{:pages-and-blocks
 [{:page {:block/title "QA-EDN-New"}
   :blocks [{:block/title "new copper"}
            {:block/title "new otter"}]}]
 :logseq.db.sqlite.export/export-type :selected-nodes}
  1. Click Import.
  2. Press Ctrl+K and search the exact page title QA-EDN-New.
  3. Search new copper as well.

Actual: the imported page is absent; the palette offers Create page. The imported block is also absent. A fuzzy unrelated result may appear for the block query, but the exact newly imported block does not.

  1. Dismiss search. If the input is nonempty, Escape first clears it; Escape again closes the palette.
  2. Open Pages in the left sidebar. Open QA-EDN-New from the table.

Actual: the page exists and contains both new copper and new otter in the correct order.

Expected: successful EDN import should update search so imported pages and blocks can immediately be found, without individually editing them or manually rebuilding the index.

Reload and recovery controls

These were performed with the equivalent first fixture QA-E-EDN-Multi, containing EDN alpha with child EDN child, followed by EDN beta:

  • Exact page search was absent before and after Ctrl+R. The intact page/hierarchy could still be opened through Pages.
  • Native-created control page QA-E-EDN-Destination was searchable in the same graph.
  • After changing only EDN beta to EDN beta edited and saving, that edited block became searchable. Untouched EDN alpha remained absent.
  • Ctrl+K → Rebuild search index restored both the untouched EDN alpha and the QA-E-EDN-Multi page result.
  • Importing another fresh two-block fixture after this successful index rebuild caused the same missing page/block search results again.

No imported data disappeared. A selected-nodes payload with a named page creates/imports into that named page; it is not expected to insert into the currently edited destination block.

Reproducibility and versions

Three import trials showed the problem in the same disposable target graph:

  1. Actual UI-exported two-root/one-child EDN, imported from a separate graph on e9fd02c8beb7c63858df5d5cb8667aff24ddd50e.
  2. A fresh two-block payload after manually rebuilding the index, on that same revision.
  3. The minimal payload above, newly imported after rebuilding and launching master 8ffbb220938acc00e1c70e8579e7c52ab97c2aa7.

Trial 3 is a fresh import on the latest tested revision, not merely reopening old imported data. That revision includes f3dacf9, the Cmd+K memoized refresh-key fix.

The second fixture's missing results also survived the full Electron restart/master rebuild. The first fixture's export/import preserved the hierarchy and left its source intact.

Read-only worker evidence

On 8ffbb22, the live worker was queried through the app runtime for the second fixture, QA-E-EDN-Repeat:

  • DB query found the page and both blocks repeat copper and repeat otter.
  • Both blocks' parent/page point to that page; their orders were a7 and a8.
  • The worker search API returned {:matched-count 0 :items []} for all three exact queries.

This confirms the earlier missing result is not just a command-palette display problem.

The first and second import logs show successful :batch-import-edn transactions at 12:23:07 and 12:41:20 UTC on 2026-10-01, with 33 and 25 datoms respectively. The native index rebuild was logged at approximately 12:34:55 UTC.

Source pointers / suspected cause

The runtime and recovery results are consistent with this source path:

No source changes, direct DB writes, or fix were applied.

Environment

  • Logseq 2.0.1 Electron development build
  • Latest tested master: 8ffbb220938acc00e1c70e8579e7c52ab97c2aa7
  • Both live renderer and Node worker verified at 8ffbb22, build 2026-10-01T12:46:50Z
  • Electron 42.3.0 / Chromium 148.0.7778.180
  • Debian GNU/Linux 13, x86_64 cloud Linux desktop
  • Native keyboard/mouse testing, synthetic local DB graphs, no sync
  • Web not tested: the available cloud browser blocks the local development server

Related reports checked

  • #317, closed: similar search symptom after full SQLite graph import following migration. Manual rebuild repaired it. This report isolates the still-reproducible partial-EDN transaction path.
  • #714, closed: whole SQLite import with RangeError/unfinished embeddings.
  • #1153, closed: property deletion removes index entries, a different triggering operation.
  • #1004: single-block EDN import failure; here import succeeds and content exists.
  • logseq/logseq#12929: import hardening, but does not change this search-listener skip.

Activity

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

    @yuxi-liu-wired

    Fixed in logseq/logseq#13886 (fix(import): EDN export and import keep pages, history, search and the target block). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.

  2. added 5 commits that reference this issue on Oct 28, 2026
    2daca4f
    882bbf6
    623be0c
    fae148f
    10fb9fb
  3. added 8 commits that reference this issue on Nov 11, 2026
    b75982b
    88d2db5
    0138440
    3a24450
    a89c048
    4447c2f
    7b9b5f6
    a899ff9
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