ソースを参照

fix: remove deleted :block/unknown schema

:block/unknown was a side effect of the last storage approach
Gabriel Horner 2 年 前
コミット
0d4b46be71

+ 0 - 22
deps/db/src/logseq/db/frontend/malli_schema.cljs

@@ -265,15 +265,6 @@
    closed-value-block
    whiteboard-block])
 
-;; TODO: invalid macros should not generate unknown
-(def unknown-block
-  "A block that has an unknown type. This type of block should be removed when
-  the above TODOs have been addressed and the frontend ensures no unknown blocks
-  are being created"
-  [:map
-   [:block/uuid :uuid]
-   [:block/unknown? :boolean]])
-
 (def file-block
   [:map
    [:block/uuid :uuid]
@@ -308,19 +299,6 @@
   thoroughly validate properties, the entities and this schema should be
   prepared with update-properties-in-ents and update-properties-in-schema
   respectively"
-  [:sequential
-   [:or
-    page
-    block
-    file-block
-    schema-version
-    db-ident
-    macro
-    unknown-block]])
-
-(def DB-known
-  "A stricter version of the DB schema that doesn't allow for unknown blocks.
-   When we've fixed all known causes of unknown blocks this should be the DB schema"
   [:sequential
    [:or
     page

+ 2 - 2
src/main/frontend/modules/outliner/datascript.cljs

@@ -29,11 +29,11 @@
   "Validates the entities that have changed in the given datascript tx-report.
    Validation is only for DB graphs"
   [{:keys [db-after tx-data tx-meta]}]
-  (let [{:keys [known-schema? closed-schema? fail-invalid?]} (:dev/validate-db-options (state/get-config))
+  (let [{:keys [closed-schema? fail-invalid?]} (:dev/validate-db-options (state/get-config))
         changed-ids (->> tx-data (map :e) distinct)
         ent-maps* (->> changed-ids (mapcat #(d/datoms db-after :eavt %)) db-malli-schema/datoms->entity-maps vals)
         ent-maps (vec (db-malli-schema/update-properties-in-ents ent-maps*))
-        db-schema (cond-> (if known-schema? db-malli-schema/DB-known db-malli-schema/DB)
+        db-schema (cond-> db-malli-schema/DB
                     true
                     (db-malli-schema/update-properties-in-schema db-after)
                     closed-schema?