Browse Source

fix: turn off unhelpful validation errors for published graphs

related to LOG-3257
Gabriel Horner 1 year ago
parent
commit
53f9752ce3
2 changed files with 4 additions and 2 deletions
  1. 1 1
      src/main/frontend/worker/db_worker.cljs
  2. 3 1
      src/main/frontend/worker/pipeline.cljs

+ 1 - 1
src/main/frontend/worker/db_worker.cljs

@@ -269,7 +269,7 @@
           new-db' (update new-db :eavt (fn [^BTSet s]
                                          (set! (.-storage s) (.-storage (:eavt @conn)))
                                          s))]
-      (d/reset-conn! conn new-db')
+      (d/reset-conn! conn new-db' {:reset-conn! true})
       (d/reset-schema! conn (:schema new-db))
       nil)))
 

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

@@ -49,7 +49,9 @@
   (when (and (not (:skip-validate-db? tx-meta false))
              (:dev? context)
              (not (:importing? context)) (sqlite-util/db-based-graph? repo))
-    (let [valid? (db-validate/validate-tx-report! tx-report (:validate-db-options context))]
+    (let [valid? (if (get-in tx-report [:tx-meta :reset-conn!])
+                   true
+                   (db-validate/validate-tx-report! tx-report (:validate-db-options context)))]
       (when (and (get-in context [:validate-db-options :fail-invalid?]) (not valid?))
         (worker-util/post-message :notification
                                   [["Invalid DB!"] :error]))))