From 3340471d234cd99356e5009b176edb5c35330a45 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 21 May 2026 13:48:41 +0200 Subject: [PATCH] :bug: Fix problems with repair and validation --- common/src/app/common/files/repair.cljc | 8 +++++--- common/src/app/common/files/validate.cljc | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/common/src/app/common/files/repair.cljc b/common/src/app/common/files/repair.cljc index 29e6d4fdf5..ee327ab9e2 100644 --- a/common/src/app/common/files/repair.cljc +++ b/common/src/app/common/files/repair.cljc @@ -644,9 +644,11 @@ (fn [shape] ;; Set the desired swap slot (let [slot (:swap-slot args)] - (when (some? slot) - (log/debug :hint (str " -> set swap-slot to " slot)) - (ctk/set-swap-slot shape slot))))] + (if (some? slot) + (do + (log/debug :hint (str " -> set swap-slot to " slot)) + (ctk/set-swap-slot shape slot)) + shape)))] (log/dbg :hint "repairing shape :missing-slot" :id (:id shape) :name (:name shape) :page-id page-id) (-> (pcb/empty-changes nil page-id) diff --git a/common/src/app/common/files/validate.cljc b/common/src/app/common/files/validate.cljc index 1c16c4dcbc..a957c5746c 100644 --- a/common/src/app/common/files/validate.cljc +++ b/common/src/app/common/files/validate.cljc @@ -704,7 +704,8 @@ (defn- get-orphan-shapes [{:keys [objects] :as page}] - (let [xf (comp (map #(contains? objects (:parent-id %))) + (let [xf (comp (filter #(and (some? (:parent-id %)) + (not (contains? objects (:parent-id %))))) (map :id))] (into [] xf (vals objects))))