Skip to content

Commit dce3b41

Browse files
fix: refs not built for imported EDN
from UI form or when using cli in-app graph
1 parent f7207d2 commit dce3b41

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

deps/cli/src/logseq/cli/common/mcp/tools.cljs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@
126126
;; (cljs.pprint/pprint _txs)
127127
(when error
128128
(throw (ex-info (str "Error while building import data: " error) {})))
129-
(let [tx-meta {::sqlite-export/imported-data? true
130-
:import-db? true}]
129+
(let [tx-meta {::sqlite-export/imported-data? true}]
131130
(ldb/transact! conn (vec (concat init-tx block-props-tx misc-tx)) tx-meta))))
132131

133132
(defn- get-ident [idents title]

src/main/frontend/worker/pipeline.cljs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,13 @@
518518
(or from-disk? new-graph?)
519519
{:tx-report tx-report}
520520

521+
;; Rebuild refs for a new DB graph using EDN or when EDN data is imported.
522+
;; Ref rebuilding happens here because transact-pipeline doesn't rebuild refs
523+
;; for these cases
521524
(or (::gp-exporter/new-graph? tx-meta)
522-
(and (::sqlite-export/imported-data? tx-meta) (:import-db? tx-meta)))
525+
(and (::sqlite-export/imported-data? tx-meta)
526+
;; Undo and redo must be handled by default in order to work
527+
(not (:undo? tx-meta)) (not (:redo? tx-meta))))
523528
(invoke-hooks-for-imported-graph conn tx-report)
524529

525530
:else

0 commit comments

Comments
 (0)