From 65dfeb3d87e548418d9067554fde65889c5d9d53 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 1 Oct 2026 11:42:23 +0200 Subject: [PATCH] :recycle: Add skip-validate-changes helper apply-changes-local and the page index worker drop the :validate-shapes changes with the same inline filter. Move it to app.common.files.changes as skip-validate-changes, next to the :validate-shapes change, so it is easy to find every place that skips the validation if it changes in the future. AI-assisted-by: claude-opus-5-5 --- common/src/app/common/files/changes.cljc | 6 ++++++ common/src/app/common/files/changes_builder.cljc | 2 +- common/test/common_tests/files_changes_test.cljc | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 2ad7753e8a..7202eb84f1 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -1181,6 +1181,12 @@ ;; --- Validate Shapes +(defn skip-validate-changes + "Remove the :validate-shapes changes, for data where the shapes can't + be validated (e.g. without the full file or its libraries)." + [changes] + (remove #(= :validate-shapes (:type %)) changes)) + #?(:clj (defmethod process-change :validate-shapes [data _ _] diff --git a/common/src/app/common/files/changes_builder.cljc b/common/src/app/common/files/changes_builder.cljc index a42e1dcedb..01b7ee3b49 100644 --- a/common/src/app/common/files/changes_builder.cljc +++ b/common/src/app/common/files/changes_builder.cljc @@ -199,7 +199,7 @@ new-changes (if (< index (count redo-changes)) (->> (subvec (:redo-changes changes) index) ;; Validation only makes sense on the real file data - (remove #(= :validate-shapes (:type %))) + (cfc/skip-validate-changes) (map #(-> % (assoc :page-id uuid/zero) (dissoc :component-id)))) diff --git a/common/test/common_tests/files_changes_test.cljc b/common/test/common_tests/files_changes_test.cljc index ca73e9b020..074a71ce6b 100644 --- a/common/test/common_tests/files_changes_test.cljc +++ b/common/test/common_tests/files_changes_test.cljc @@ -1644,3 +1644,10 @@ (t/is (seq (:redo-changes changes))) (t/is (not-any? #(= :validate-shapes (:type %)) (:redo-changes changes))))) +(t/deftest skip-validate-changes + (let [changes [{:type :mod-obj :id (uuid/next)} + {:type :validate-shapes :page-id (uuid/next) :shape-ids []} + {:type :del-obj :id (uuid/next)}]] + (t/is (= [:mod-obj :del-obj] + (map :type (ch/skip-validate-changes changes)))))) +