From df70a52bba5c10fc0fc1ab3906052d7efaa8a833 Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Thu, 19 Feb 2026 11:36:25 -0500 Subject: [PATCH] fix: two bug with using --roundtrip Fails hard when db is invalid and doesn't respect --catch-validation-errors --- deps/cli/src/logseq/cli/commands/export_edn.cljs | 2 +- deps/db/src/logseq/db/sqlite/export.cljs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/cli/src/logseq/cli/commands/export_edn.cljs b/deps/cli/src/logseq/cli/commands/export_edn.cljs index dfe598cbb0..032e2c605b 100644 --- a/deps/cli/src/logseq/cli/commands/export_edn.cljs +++ b/deps/cli/src/logseq/cli/commands/export_edn.cljs @@ -35,7 +35,7 @@ (if diff (do (println "The exported EDN's have the following diff:") (pprint/pprint diff) - (js/process.exit 1)) + (when-not catch-validation-errors? (js/process.exit 1))) (println "The exported EDN roundtrips successfully!")))))) (defn- local-export [{{:keys [graph validate roundtrip] :as options} :opts}] diff --git a/deps/db/src/logseq/db/sqlite/export.cljs b/deps/db/src/logseq/db/sqlite/export.cljs index 45da9fb093..3fa5ec862b 100644 --- a/deps/db/src/logseq/db/sqlite/export.cljs +++ b/deps/db/src/logseq/db/sqlite/export.cljs @@ -1119,7 +1119,8 @@ (do (js/console.error "Exported EDN has the following invalid errors when imported into a new graph:") (pprint/pprint errors) - {:error (str "The exported EDN has " (count errors) " validation error(s)")}) + {:error (str "The exported EDN has " (count errors) " validation error(s)") + :db @import-conn}) {:db @import-conn})) (catch :default e (js/console.error "Unexpected export-edn validation error:" e)