Repository navigation
fix(import): handle missing block embeds - #12887
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes file-graph import failures caused by block embeds ({{embed ((uuid))}}) that produce :block/link lookup refs to missing block UUIDs, which could previously cause db-worker-node to reject a transaction and leave the graph partially imported. It also tightens failure propagation and sequencing so worker/import failures stop the import flow rather than letting the UI continue.
Changes:
- Include
:block/linkUUID targets in the import block index (matching existing:block/refshandling) and retract dangling:block/linkvalues during missing-ref cleanup. - Propagate export/import failures by rethrowing after user notification, rather than swallowing errors and continuing.
- Ensure file-graph import waits for each
on-tx-reportcompletion before proceeding to the next report.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/frontend/components/imports.cljs | Await on-tx-report sequentially to prevent UI from continuing after worker transact failures. |
| deps/graph-parser/src/logseq/graph_parser/exporter.cljs | Index :block/link UUID targets; retract missing embed links; rethrow on import/export errors so failures abort. |
| deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs | Extend import cleanup coverage for missing embeds and add a failure-propagation test for aborting on export-file failure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
megayu
force-pushed
the
fix/og-import-missing-embeds
branch
from
July 9, 2026 07:59
ab14006 to
1c9b28b
Compare
1 of 2 tasks
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 1, 2026
Co-authored-by: Tienson Qin <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
Co-authored-by: Tienson Qin <[email protected]>
devin-ai-integration Bot
pushed a commit
that referenced
this pull request
Oct 8, 2026
Co-authored-by: Tienson Qin <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
logseq/db-test#927
This fixes a file graph import failure where db-worker-node can reject an import transaction with
:entity-id/missing.The failure was diagnosed from logs showing transactions containing blocks like:
followed by:
That shape is produced by block embeds such as
{{embed ((uuid))}}. Before this change, the importer created placeholder/index entries for normal:block/refstargets, but not for:block/linktargets. If the worker received a:block/linkpointing to a missing UUID, the transaction could fail and the import flow could continue processing later files, leaving a partially imported graph.This change:
:block/linkUUID targets in the import block index, matching existing:block/refshandling.