From cfe6fae77d416d0a587b0b61955c4b563b7c0113 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 19 Mar 2024 09:03:08 +0100 Subject: [PATCH 1/6] :bug: Fix incorrect version handling on file migration --- common/src/app/common/files/migrations.cljc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 105b64e5b..b62521b8f 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -73,7 +73,7 @@ [{:keys [version] :as file}] (if (int? version) file - (let [version (or version (-> file :data :version))] + (let [version (or (-> file :data :version) 0)] (-> file (assoc :version version) (update :data dissoc :version))))) From ab0b3c71a8fad0cd2bd32b32bf9bfc6e32d51293 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Tue, 19 Mar 2024 07:32:13 +0100 Subject: [PATCH 2/6] :bug: Improve fixing root shapes for v1 components on migration to v2 --- backend/src/app/features/components_v2.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index a798b54c7..8e548466e 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -433,7 +433,8 @@ (letfn [(fix-component [components id component] (let [root-shape (ctst/get-shape component (:id component))] (if (or (empty? (:objects component)) - (nil? root-shape)) + (nil? root-shape) + (nil? (:type root-shape))) (dissoc components id) components)))] From 126bab3ce49b31601cb359e75f32dabf9d526bcf Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 19 Mar 2024 09:15:04 +0100 Subject: [PATCH 3/6] :bug: Fix invalid page name on compv2 migration --- backend/src/app/features/components_v2.clj | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index 8e548466e..565d00320 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -215,10 +215,15 @@ (update :pages-index update-vals fix-container) (d/update-when :components update-vals fix-container)))) - fix-page-invalid-options + fix-invalid-page (fn [file-data] (letfn [(update-page [page] - (update page :options fix-options)) + (-> page + (update :name (fn [name] + (if (nil? name) + "Page" + name))) + (update :options fix-options))) (fix-background [options] (if (and (contains? options :background) @@ -993,7 +998,7 @@ (-> file-data (fix-file-data) - (fix-page-invalid-options) + (fix-invalid-page) (fix-misc-shape-issues) (fix-recent-colors) (fix-missing-image-metadata) From 67cdaa397caae2a8042c4cad03b121a81a713518 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 19 Mar 2024 11:21:16 +0100 Subject: [PATCH 4/6] :sparkles: Add minor improvements to devenv initial flags --- backend/scripts/repl | 6 ++---- backend/scripts/start-dev | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/scripts/repl b/backend/scripts/repl index 4e454b761..6336331e4 100755 --- a/backend/scripts/repl +++ b/backend/scripts/repl @@ -4,7 +4,7 @@ export PENPOT_HOST=devenv export PENPOT_TENANT=dev export PENPOT_FLAGS="\ $PENPOT_FLAGS \ - enable-registration + enable-login-with-ldap \ enable-login-with-password enable-login-with-oidc \ enable-login-with-google \ @@ -28,9 +28,7 @@ export PENPOT_FLAGS="\ enable-access-tokens \ disable-feature-components-v2 \ enable-file-validation \ - enable-file-schema-validation \ - disable-soft-file-schema-validation \ - disable-soft-file-validation"; + enable-file-schema-validation"; # Setup default upload media file size to 100MiB diff --git a/backend/scripts/start-dev b/backend/scripts/start-dev index 89df83d96..1a2fa2842 100755 --- a/backend/scripts/start-dev +++ b/backend/scripts/start-dev @@ -15,13 +15,12 @@ export PENPOT_FLAGS="\ enable-feature-fdata-pointer-map \ enable-feature-fdata-objects-map \ disable-secure-session-cookies \ + enable-rpc-climit \ enable-smtp \ enable-access-tokens \ disable-feature-components-v2 \ enable-file-validation \ - enable-file-schema-validation \ - disable-soft-file-schema-validation \ - disable-soft-file-validation"; + enable-file-schema-validation"; export OPTIONS=" -A:jmx-remote -A:dev \ From edb0408300746c314e90e41488103a18a9a4aa88 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 19 Mar 2024 11:35:58 +0100 Subject: [PATCH 5/6] :bug: Fix issue on climit when it is not enabled --- backend/src/app/rpc/climit.clj | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/backend/src/app/rpc/climit.clj b/backend/src/app/rpc/climit.clj index 988fe29ad..3c23a7402 100644 --- a/backend/src/app/rpc/climit.clj +++ b/backend/src/app/rpc/climit.clj @@ -21,7 +21,6 @@ [app.worker :as-alias wrk] [clojure.edn :as edn] [clojure.spec.alpha :as s] - [cuerdas.core :as str] [datoteka.fs :as fs] [integrant.core :as ig] [promesa.exec :as px] @@ -241,16 +240,15 @@ [{:keys [::label ::profile-id ::rpc/climit ::mtx/metrics] :as cfg} f] (let [config (get climit ::config) cache (get climit ::cache)] - (reduce (fn [handler [limit-id limit-key :as ckey]] - (let [config (get config limit-id)] - (when-not config - (throw (IllegalArgumentException. - (str/ffmt "config not found for: %" limit-id)))) - + (if-let [config (get config limit-id)] (fn [& params] (let [limiter (cache/get cache ckey (partial create-limiter config))] - (invoke limiter metrics limit-id limit-key label profile-id handler params))))) + (invoke limiter metrics limit-id limit-key label profile-id handler params))) + + (do + (l/wrn :hint "config not found" :label label :id limit-id) + f))) f (get-limits cfg)))) From 5c6e8366c10bf7deb3dbf66d7f09c8cf472aa8ca Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 20 Mar 2024 09:33:53 +0100 Subject: [PATCH 6/6] :bug: Fix unexpected exception on fix-percent functions --- common/src/app/common/svg.cljc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/app/common/svg.cljc b/common/src/app/common/svg.cljc index d400f01f1..1b50a9dde 100644 --- a/common/src/app/common/svg.cljc +++ b/common/src/app/common/svg.cljc @@ -995,6 +995,9 @@ (= key :style) attrs + (= key :unicode) + attrs + (str/starts-with? (d/name key) "data-") attrs