From bfffde8b2dd9f277433a81f3924a23530ea16dff Mon Sep 17 00:00:00 2001 From: Gabriel Horner Date: Fri, 22 Nov 2024 11:24:18 -0500 Subject: [PATCH] fix: import of some class pages can still lose identity Some pages that turn into classes were still having split uuids. Underlying cause was that existing page uuid was incorrect --- deps/graph-parser/src/logseq/graph_parser/exporter.cljs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/deps/graph-parser/src/logseq/graph_parser/exporter.cljs b/deps/graph-parser/src/logseq/graph_parser/exporter.cljs index 32416ecce5..7ee9d61886 100644 --- a/deps/graph-parser/src/logseq/graph_parser/exporter.cljs +++ b/deps/graph-parser/src/logseq/graph_parser/exporter.cljs @@ -978,10 +978,12 @@ ;; Fetch all named ents once per import file to speed up named lookups all-existing-page-uuids (get-all-existing-page-uuids @conn) all-pages (map #(modify-page-tx % all-existing-page-uuids) all-pages*) + all-new-page-uuids (->> all-pages + (remove #(all-existing-page-uuids (or (::original-name %) (:block/name %)))) + (map (juxt (some-fn ::original-name :block/name) :block/uuid)) + (into {})) ;; Stateful because new page uuids can occur via tags - page-names-to-uuids (atom (merge all-existing-page-uuids - (into {} (map (juxt (some-fn ::original-name :block/name) :block/uuid) - (remove all-existing-page-uuids all-pages))))) + page-names-to-uuids (atom (merge all-existing-page-uuids all-new-page-uuids)) per-file-state {:page-names-to-uuids page-names-to-uuids :classes-tx (:classes-tx options)} all-pages-m (mapv #(handle-page-properties % @conn per-file-state all-pages options)