fix: refs not built for imported EDN

from UI form or when using cli in-app graph
This commit is contained in:
Gabriel Horner
2025-12-16 10:08:17 -05:00
parent f7207d2d2a
commit dce3b4111f
2 changed files with 7 additions and 3 deletions

View File

@@ -126,8 +126,7 @@
;; (cljs.pprint/pprint _txs)
(when error
(throw (ex-info (str "Error while building import data: " error) {})))
(let [tx-meta {::sqlite-export/imported-data? true
:import-db? true}]
(let [tx-meta {::sqlite-export/imported-data? true}]
(ldb/transact! conn (vec (concat init-tx block-props-tx misc-tx)) tx-meta))))
(defn- get-ident [idents title]

View File

@@ -518,8 +518,13 @@
(or from-disk? new-graph?)
{:tx-report tx-report}
;; Rebuild refs for a new DB graph using EDN or when EDN data is imported.
;; Ref rebuilding happens here because transact-pipeline doesn't rebuild refs
;; for these cases
(or (::gp-exporter/new-graph? tx-meta)
(and (::sqlite-export/imported-data? tx-meta) (:import-db? tx-meta)))
(and (::sqlite-export/imported-data? tx-meta)
;; Undo and redo must be handled by default in order to work
(not (:undo? tx-meta)) (not (:redo? tx-meta))))
(invoke-hooks-for-imported-graph conn tx-report)
:else