Просмотр исходного кода

fix: importing from form shouldnt alter hnsw embeddings

Gabriel Horner 2 месяцев назад
Родитель
Сommit
683b2c54c8

+ 1 - 1
deps/outliner/src/logseq/outliner/op.cljs

@@ -159,7 +159,7 @@
                (js/console.error "Import EDN error: " e)
                (reset! *result {:error "An unexpected error occurred building the import. See the javascript console for details."})))
         ;; _ (cljs.pprint/pprint _txs)
-        tx-meta' (merge {:import-db? true} tx-meta)]
+        tx-meta' (merge {::sqlite-export/imported-data? true} tx-meta)]
     (ldb/transact! conn (vec (concat init-tx block-props-tx misc-tx)) tx-meta')))
 
 (defn ^:large-vars/cleanup-todo apply-ops!

+ 1 - 1
src/main/frontend/handler/db_based/import.cljs

@@ -75,7 +75,7 @@
             _ (state/set-current-repo! graph)
             {:keys [error]} (ui-outliner-tx/transact!
                              {:outliner-op :batch-import-edn}
-                             (outliner-op/batch-import-edn! edn-data {:tx-meta {::sqlite-export/imported-data? true}}))]
+                             (outliner-op/batch-import-edn! edn-data {:tx-meta {:import-db? true}}))]
             (if error
               (do
                 (notification/show! error :error)

+ 2 - 1
src/main/frontend/worker/pipeline.cljs

@@ -501,7 +501,8 @@
         (or from-disk? new-graph?)
         {:tx-report tx-report}
 
-        (or (::gp-exporter/new-graph? tx-meta) (::sqlite-export/imported-data? tx-meta))
+        (or (::gp-exporter/new-graph? tx-meta)
+            (and (::sqlite-export/imported-data? tx-meta) (:import-db? tx-meta)))
         (invoke-hooks-for-imported-graph conn tx-report)
 
         :else