From bcc0b0d3131d67337c5b89b2cb0104f2547ff035 Mon Sep 17 00:00:00 2001 From: Dexterity <173429049+Dexterity104@users.noreply.github.com> Date: Tue, 19 May 2026 11:37:48 -0400 Subject: [PATCH] :sparkles: Validate shape on add-object to catch malformed inputs early (#9291) Co-authored-by: Andrey Antukh --- common/src/app/common/files/changes_builder.cljc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/src/app/common/files/changes_builder.cljc b/common/src/app/common/files/changes_builder.cljc index 49a78726f5..f1cfb402d1 100644 --- a/common/src/app/common/files/changes_builder.cljc +++ b/common/src/app/common/files/changes_builder.cljc @@ -19,6 +19,7 @@ [app.common.types.component :as ctk] [app.common.types.file :as ctf] [app.common.types.path :as path] + [app.common.types.shape :as cts] [app.common.types.shape.layout :as ctl] [app.common.types.tokens-lib :as ctob] [app.common.uuid :as uuid] @@ -410,12 +411,9 @@ (add-object changes obj nil)) ([changes obj {:keys [index ignore-touched] :or {index ::undefined ignore-touched false}}] - - ;; FIXME: add shape validation - (assert-page-id! changes) (assert-objects! changes) - (let [obj (cond-> obj + (let [obj (cond-> (cts/check-shape obj) (not= index ::undefined) (assoc ::index index))