From ddeb540df6cff2245572b2985d1929c727c39827 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 19 Jun 2023 13:06:01 +0200 Subject: [PATCH 1/4] :bug: Fix pointer map related issues on get-page rpc method mainly used on render.html endpoint which is used by exporter --- backend/src/app/rpc/commands/files.clj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index 1d14b75de5..ca081eac40 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -490,7 +490,10 @@ (let [file (get-file conn file-id features) page-id (or page-id (-> file :data :pages first)) - page (dm/get-in file [:data :pages-index page-id])] + page (dm/get-in file [:data :pages-index page-id]) + page (if (pmap/pointer-map? page) + (deref page) + page)] (cond-> (prune-thumbnails page) (uuid? object-id) (prune-objects object-id)))) @@ -516,7 +519,10 @@ [{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id file-id] :as params}] (dm/with-open [conn (db/open pool)] (check-read-permissions! conn profile-id file-id) - (get-page conn params))) + + (binding [pmap/*load-fn* (partial load-pointer conn file-id)] + (get-page conn params)))) + ;; --- COMMAND QUERY: get-team-shared-files From d0168767109d7c1852845919c7dcc9e560c87859 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 19 Jun 2023 13:07:26 +0200 Subject: [PATCH 2/4] :bug: Add missing file-id validation on get-page rpc method --- backend/src/app/rpc/commands/files.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/app/rpc/commands/files.clj b/backend/src/app/rpc/commands/files.clj index ca081eac40..d1da43c976 100644 --- a/backend/src/app/rpc/commands/files.clj +++ b/backend/src/app/rpc/commands/files.clj @@ -500,6 +500,7 @@ (sm/def! ::get-page [:map {:title "GetPage"} + [:file-id ::sm/uuid] [:page-id {:optional true} ::sm/uuid] [:object-id {:optional true} ::sm/uuid] [:features {:optional true} ::features]]) From dac18e876f29f55420cd64f578bfa7f668daa97e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 19 Jun 2023 13:07:46 +0200 Subject: [PATCH 3/4] :bug: Fix validation error on password recovery submit operation --- frontend/src/app/main/data/users.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/users.cljs b/frontend/src/app/main/data/users.cljs index 9d9bf0ccff..5639d75805 100644 --- a/frontend/src/app/main/data/users.cljs +++ b/frontend/src/app/main/data/users.cljs @@ -500,7 +500,7 @@ (defn recover-profile [data] - (dm/assert! (sm/valid? ::recover-profile data)) + (dm/assert! (sm/valid? schema:recover-profile data)) (ptk/reify ::recover-profile ptk/WatchEvent (watch [_ _ _] From 4d850ebe6e636c85cb9aa835b05aad90a5ce1781 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 19 Jun 2023 13:08:11 +0200 Subject: [PATCH 4/4] :bug: Add proper features initialization on render entrypoint --- frontend/src/app/render.cljs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/render.cljs b/frontend/src/app/render.cljs index 1b6a0fc7af..9f3db68afe 100644 --- a/frontend/src/app/render.cljs +++ b/frontend/src/app/render.cljs @@ -14,7 +14,7 @@ [app.common.types.components-list :as ctkl] [app.common.uri :as u] [app.main.data.fonts :as df] - [app.main.features :as features] + [app.main.features :as feat] [app.main.render :as render] [app.main.repo :as repo] [app.main.store :as st] @@ -52,6 +52,7 @@ (defn ^:export init [] + (st/emit! (feat/initialize)) (init-ui)) (defn reinit @@ -95,7 +96,7 @@ (mf/defc object-svg [{:keys [page-id file-id object-id render-embed?]}] - (let [components-v2 (features/use-feature :components-v2) + (let [components-v2 (feat/use-feature :components-v2) fetch-state (mf/use-fn (mf/deps file-id page-id object-id components-v2) (fn [] @@ -135,7 +136,7 @@ (mf/defc objects-svg [{:keys [page-id file-id object-ids render-embed?]}] - (let [components-v2 (features/use-feature :components-v2) + (let [components-v2 (feat/use-feature :components-v2) fetch-state (mf/use-fn (mf/deps file-id page-id components-v2) (fn []