From 7e669290105b557b0646f74cccebdd20d54741b3 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 3 Jun 2026 16:54:40 +0200 Subject: [PATCH 1/3] :bug: Fix crash when typography token value is an array (#9992) Add guard in parse-composite-typography-value to check if the converted value is a map before attempting map operations. When a typography token has an array value like ["Roboto"], return an invalid-token-value-typography error instead of crashing with IMap.-dissoc protocol error. Add regression test to verify the fix. --- .../src/app/main/data/style_dictionary.cljs | 56 ++++++++++--------- .../tokens/style_dictionary_test.cljs | 25 +++++++++ 2 files changed, 54 insertions(+), 27 deletions(-) diff --git a/frontend/src/app/main/data/style_dictionary.cljs b/frontend/src/app/main/data/style_dictionary.cljs index 280b431046..4045589a4f 100644 --- a/frontend/src/app/main/data/style_dictionary.cljs +++ b/frontend/src/app/main/data/style_dictionary.cljs @@ -302,36 +302,38 @@ {:errors [(wte/error-with-value :error.style-dictionary/invalid-token-value-typography value)]} :else - (let [converted (js->clj value :keywordize-keys true) - add-keyed-errors (fn [typography-map k errors] - (update typography-map :errors concat (map #(assoc % :typography-key k) errors))) - ;; Separate line-height to process in an extra step - without-line-height (dissoc converted :line-height) - valid-typography (reduce - (fn [acc [k v]] - (let [{:keys [errors value]} (parse-atomic-typography-value k v)] - (if (seq errors) - (add-keyed-errors acc k errors) - (assoc-in acc [:value k] (or value v))))) - {:value {}} - without-line-height) + (let [converted (js->clj value :keywordize-keys true)] + (if-not (map? converted) + {:errors [(wte/error-with-value :error.style-dictionary/invalid-token-value-typography value)]} + (let [add-keyed-errors (fn [typography-map k errors] + (update typography-map :errors concat (map #(assoc % :typography-key k) errors))) + ;; Separate line-height to process in an extra step + without-line-height (dissoc converted :line-height) + valid-typography (reduce + (fn [acc [k v]] + (let [{:keys [errors value]} (parse-atomic-typography-value k v)] + (if (seq errors) + (add-keyed-errors acc k errors) + (assoc-in acc [:value k] (or value v))))) + {:value {}} + without-line-height) - ;; Calculate line-height based on the resolved font-size and add it back to the map - line-height (when-let [line-height (:line-height converted)] - (-> (parse-sd-token-typography-line-height - line-height - (get-in valid-typography [:value :font-size]) - (get-in valid-typography [:errors :font-size])))) - valid-typography (cond - (:errors line-height) - (add-keyed-errors valid-typography :line-height (:errors line-height)) + ;; Calculate line-height based on the resolved font-size and add it back to the map + line-height (when-let [line-height (:line-height converted)] + (-> (parse-sd-token-typography-line-height + line-height + (get-in valid-typography [:value :font-size]) + (get-in valid-typography [:errors :font-size])))) + valid-typography (cond + (:errors line-height) + (add-keyed-errors valid-typography :line-height (:errors line-height)) - line-height - (assoc-in valid-typography [:value :line-height] line-height) + line-height + (assoc-in valid-typography [:value :line-height] line-height) - :else - valid-typography)] - valid-typography)))) + :else + valid-typography)] + valid-typography)))))) (defn collect-typography-errors [token] (group-by :typography-key (:errors token))) diff --git a/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs b/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs index 1dbe9d12cf..220dd1f36b 100644 --- a/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs +++ b/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs @@ -97,6 +97,31 @@ (-> errors first :error/code))))) (done)))))))) +;; Regression: a composite typography token whose value is a plain +;; array (e.g. ["Roboto"]) instead of a map must not crash with +;; "No protocol method IMap.-dissoc defined for type object". +;; It should return an invalid-token-value-typography error instead. +(t/deftest resolve-tokens-typography-array-value-test + (t/async + done + (t/testing "typography token with array value produces error instead of crashing" + (let [tokens (-> (ctob/make-tokens-lib) + (ctob/add-set (ctob/make-token-set :id (cthi/new-id! :core-set) + :name "core")) + (ctob/add-token (cthi/id :core-set) + (ctob/make-token {:name "typography.bad" + :value ["Roboto"] + :type :typography})) + (ctob/get-all-tokens-map))] + (-> (sd/resolve-tokens tokens) + (rx/sub! + (fn [resolved-tokens] + (t/is (contains? resolved-tokens "typography.bad")) + (t/is (nil? (get-in resolved-tokens ["typography.bad" :resolved-value]))) + (t/is (= :error.style-dictionary/invalid-token-value-typography + (get-in resolved-tokens ["typography.bad" :errors 0 :error/code]))) + (done)))))))) + (t/deftest resolve-tokens-interactive-test (t/async done From dfa88a28fda48243267ecd1c286aea72ae55b149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Torr=C3=B3?= Date: Thu, 4 Jun 2026 08:39:33 +0200 Subject: [PATCH 2/3] :bug: Fix text editor swap when WebGL render is enabled/disabled --- frontend/src/app/main/features.cljs | 2 +- frontend/src/app/util/text/content.cljs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/main/features.cljs b/frontend/src/app/main/features.cljs index 1acffc3ea4..1cab3b49df 100644 --- a/frontend/src/app/main/features.cljs +++ b/frontend/src/app/main/features.cljs @@ -63,7 +63,7 @@ ;; Ensure it's always enabled whenever render-wasm/v1 is active. (if (contains? features "render-wasm/v1") (conj features "text-editor/v2") - (disj features "text-editor/v2")))) + (disj features "text-editor/v2" "text-editor-wasm/v1")))) (defn get-enabled-features "An explicit lookup of enabled features for the current team" diff --git a/frontend/src/app/util/text/content.cljs b/frontend/src/app/util/text/content.cljs index a43ebac99f..4c14786a8e 100644 --- a/frontend/src/app/util/text/content.cljs +++ b/frontend/src/app/util/text/content.cljs @@ -14,7 +14,8 @@ (defn dom->cljs "Gets the editor content from a DOM structure" [root] - (fd/create-root root)) + (when (some? root) + (fd/create-root root))) (defn cljs->dom "Sets the editor content from a CLJS structure" From 97c3a9facff8d7676e228eacdc9e1c099afad476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Thu, 4 Jun 2026 10:11:58 +0200 Subject: [PATCH 3/3] :whale: Add improvements related to Docker and Podman compatibility (#10012) * :paperclip: Add tests for boolean parser coverage * :whale: Normalize boolean handling in nginx entrypoint * :whale: Quote boolean env vars in compose example (add Podman compatibility) * :fire: Remove deprecated and duplicated nginx.conf file for Storybook --- common/test/common_tests/schema_test.cljc | 17 ++++++++++++++ docker/images/docker-compose.yaml | 7 +++--- docker/images/files/nginx-entrypoint.sh | 13 ++++++++++- docker/images/nginx.storybook.conf | 27 ----------------------- 4 files changed, 33 insertions(+), 31 deletions(-) delete mode 100644 docker/images/nginx.storybook.conf diff --git a/common/test/common_tests/schema_test.cljc b/common/test/common_tests/schema_test.cljc index 6206d5d38b..b94d4ae4a4 100644 --- a/common/test/common_tests/schema_test.cljc +++ b/common/test/common_tests/schema_test.cljc @@ -171,3 +171,20 @@ (t/is (= candidate-2 (encode-j expected))))) +(t/deftest test-boolean + (let [decode-s (sm/decoder ::sm/boolean sm/string-transformer)] + (t/is (= true (decode-s "true"))) + (t/is (= true (decode-s "True"))) + (t/is (= true (decode-s "TrUe"))) + (t/is (= true (decode-s "TRUE"))) + (t/is (= false (decode-s "false"))) + (t/is (= false (decode-s "False"))) + (t/is (= false (decode-s "fAlSe"))) + (t/is (= false (decode-s "FALSE"))) + + (t/is (= true (decode-s "T"))) + (t/is (= false (decode-s "F"))) + (t/is (= true (decode-s "t"))) + (t/is (= false (decode-s "f"))) + (t/is (= true (decode-s "1"))) + (t/is (= false (decode-s "0"))))) diff --git a/docker/images/docker-compose.yaml b/docker/images/docker-compose.yaml index cd5c9bf113..f6979e5e43 100644 --- a/docker/images/docker-compose.yaml +++ b/docker/images/docker-compose.yaml @@ -109,6 +109,7 @@ services: << : [*penpot-flags, *penpot-http-body-size, *penpot-public-uri] # Set to "true" on hosts where IPv6 is disabled at kernel boot level. # PENPOT_DISABLE_IPV6_LISTEN: "true" + penpot-backend: image: "penpotapp/backend:${PENPOT_VERSION:-2.15}" restart: always @@ -161,7 +162,7 @@ services: ## based on real scenarios. If you want to help us, please leave it enabled. You can ## audit what data we send with the code available on github. - PENPOT_TELEMETRY_ENABLED: true + PENPOT_TELEMETRY_ENABLED: "true" PENPOT_TELEMETRY_REFERER: compose ## Example SMTP/Email configuration. By default, emails are sent to the mailcatch @@ -175,8 +176,8 @@ services: PENPOT_SMTP_PORT: 1025 PENPOT_SMTP_USERNAME: PENPOT_SMTP_PASSWORD: - PENPOT_SMTP_TLS: false - PENPOT_SMTP_SSL: false + PENPOT_SMTP_TLS: "false" + PENPOT_SMTP_SSL: "false" penpot-mcp: image: "penpotapp/mcp:${PENPOT_VERSION:-2.15}" diff --git a/docker/images/files/nginx-entrypoint.sh b/docker/images/files/nginx-entrypoint.sh index 813d587199..999e14ad3f 100644 --- a/docker/images/files/nginx-entrypoint.sh +++ b/docker/images/files/nginx-entrypoint.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash +is_truthy() { + local value="${1,,}" + [[ "$value" == "true" || "$value" == "t" || "$value" == "1" ]] +} + +is_falsy() { + local value="${1,,}" + [[ "$value" == "false" || "$value" == "f" || "$value" == "0" ]] +} + + ######################################### ## Air Gapped config ######################################### @@ -45,7 +56,7 @@ export PENPOT_EXPORTER_URI=${PENPOT_EXPORTER_URI:-http://penpot-exporter:6061} export PENPOT_NITRATE_URI=${PENPOT_NITRATE_URI:-http://penpot-nitrate:3000} export PENPOT_HTTP_SERVER_MAX_BODY_SIZE=${PENPOT_HTTP_SERVER_MAX_BODY_SIZE:-367001600} # Default to 350MiB export PENPOT_IPV6_LISTEN_DIRECTIVE=${PENPOT_IPV6_LISTEN_DIRECTIVE:-"listen [::]:8080 default_server reuseport backlog=16384;"} -if [ "${PENPOT_DISABLE_IPV6_LISTEN}" = "true" ]; then +if is_truthy "${PENPOT_DISABLE_IPV6_LISTEN:-}"; then export PENPOT_IPV6_LISTEN_DIRECTIVE="" fi envsubst "\$PENPOT_BACKEND_URI,\$PENPOT_EXPORTER_URI,\$PENPOT_NITRATE_URI,\$PENPOT_HTTP_SERVER_MAX_BODY_SIZE,\$PENPOT_IPV6_LISTEN_DIRECTIVE" \ diff --git a/docker/images/nginx.storybook.conf b/docker/images/nginx.storybook.conf deleted file mode 100644 index fb7106dc90..0000000000 --- a/docker/images/nginx.storybook.conf +++ /dev/null @@ -1,27 +0,0 @@ -server { - listen 8080 default_server; - server_name _; - - charset utf-8; - etag off; - - gzip on; - gzip_static on; - gzip_types text/plain text/css application/javascript application/json application/vnd.api+json application/xml application/x-javascript text/xml image/svg+xml; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_min_length 256; - gzip_vary on; - - error_log /dev/stderr; - access_log /dev/stdout; - - root /var/www; - index index.html; - - location / { - try_files $uri $uri/ /index.html; - } -}