From ddeb540df6cff2245572b2985d1929c727c39827 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 19 Jun 2023 13:06:01 +0200 Subject: [PATCH] :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