Skip to content

[codex] Harden file graph import - #12815

Merged
tiensonqin merged 5 commits into
masterfrom
logseq/import-file-graph-hardening
Jun 23, 2026
Merged

tiensonqin merged 5 commits into
masterfrom
logseq/import-file-graph-hardening

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Validation

No CLJS recompilation was run.

Copilot AI review requested due to automatic review settings June 23, 2026 17:24

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.

Pull request overview

Hardens the file-graph-to-DB import pipeline to better handle malformed/edge-case graphs (missing/duplicate refs, legacy journal filename refs, empty files, linked external PDF annotations, repeated task metadata, and very large flat files), and adds regression tests + documentation to prevent reintroductions.

Changes:

  • Adds importer logic to (a) avoid transacting nil :block/refs, (b) repair duplicated block UUIDs, (c) resolve legacy yyyy_MM_dd journal filename refs, (d) support linked file://...pdf annotations, (e) ensure repeat-type built-in property exists when repeat metadata appears, and (f) reduce lazy-seq stack overflow risk for large imports.
  • Adds new regression coverage for recursive self refs, empty files, mixed repeated timestamps, external linked PDF annotations, legacy journal filename refs, missing pages, duplicated IDs, and large flat files.
  • Documents audited OG import issue classes and which cases are now fixed/covered.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
docs/og_import_graph_cases.md New documentation of audited import issue classes and mapped regression tests/cases.
deps/outliner/test/logseq/outliner/pipeline_test.cljs Adds regression test ensuring ref rebuild does not introduce self-recursive refs.
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs Adds multiple importer regression tests covering edge-case graphs and large imports.
deps/graph-parser/src/logseq/graph_parser/exporter.cljs Implements importer hardening for legacy journal filename refs, empty files (nil refs), repeat-type property presence, external file:// PDF assets, and large-file tx building.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


GitHub `logseq/db-test` issues with the `import` label were audited on 2026-06-24. The file-graph importer cases fall into these classes:

- Block identity and references: #213, #226, #340, #426, #525, #641, #679, #684, #748, #927, #931.
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.

2 participants