From f052e31ff0b4c0e10f5f9fbd45bd53dcdc34800c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 7 Aug 2025 09:29:19 +0200 Subject: [PATCH] :bug: Fix incorrect handling of assign operation on changes protocol --- common/src/app/common/files/changes.cljc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index afd1128e8a..c32f57a3b9 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -1091,21 +1091,23 @@ ;; === Operations -(def ^:private decode-shape - (sm/decoder cts/schema:shape sm/json-transformer)) +(def decode-shape-attrs + (sm/decoder cts/schema:shape-attrs sm/json-transformer)) (defmethod process-operation :assign [{:keys [type] :as shape} {:keys [value] :as op}] (let [modifications (assoc value :type type) - modifications (decode-shape modifications)] + modifications (decode-shape-attrs modifications)] (reduce-kv (fn [shape k v] - (process-operation shape {:type :set - :attr k - :val v - :ignore-touched (:ignore-touched op) - :ignore-geometry (:ignore-geometry op)})) + (if (not= v (get shape k)) + (process-operation shape {:type :set + :attr k + :val v + :ignore-touched (:ignore-touched op) + :ignore-geometry (:ignore-geometry op)}) + shape)) shape - modifications))) + (dissoc modifications :type)))) (defmethod process-operation :set [shape op]