From c09f72c3d577618f9805b1b3c5c3bca8dd9a3052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 3 Jul 2025 15:31:45 +0200 Subject: [PATCH] :bug: Sanitize wrong ids in token themes (#6843) --- common/src/app/common/types/tokens_lib.cljc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/types/tokens_lib.cljc b/common/src/app/common/types/tokens_lib.cljc index 35f8261693..ecfd92b5da 100644 --- a/common/src/app/common/types/tokens_lib.cljc +++ b/common/src/app/common/types/tokens_lib.cljc @@ -610,13 +610,17 @@ (defn make-token-theme [& {:as attrs}] - (let [id (uuid/next)] + (let [new-id (uuid/next)] (-> attrs - (update :id d/nilv id) + (update :id (fn [id] + (-> (if (string? id) ;; TODO: probably this may be deleted in some time, when we may be sure + (uuid/parse* id) ;; that no file exists that has not been correctly migrated to + id) ;; convert :id into :external-id + (d/nilv new-id)))) (update :group d/nilv top-level-theme-group-name) (update :description d/nilv "") (update :is-source d/nilv false) - (update :external-id #(or % (str id))) + (update :external-id #(or % (str new-id))) (update :modified-at #(or % (dt/now))) (update :sets set) (check-token-theme-attrs)