From 7f7248033d1348388553f82e9805127d276c78c9 Mon Sep 17 00:00:00 2001 From: rcmerci Date: Tue, 7 May 2024 14:02:27 +0800 Subject: [PATCH] refactor(rtc): remove deprecated ns and fns --- src/main/frontend/worker/rtc/asset_sync.cljs | 164 ------------------ src/main/frontend/worker/rtc/macro.clj | 24 --- src/main/frontend/worker/rtc/ws.cljs | 95 ---------- .../worker/rtc/asset_sync_effects_test.cljs | 24 --- src/test/frontend/worker/rtc/fixture.cljs | 85 +-------- .../worker/rtc/local_tx_to_remote_test.cljs | 6 +- src/test/frontend/worker/rtc/mock.cljs | 44 ----- .../frontend/worker/rtc/rtc_fns_test.cljs | 73 ++++---- 8 files changed, 41 insertions(+), 474 deletions(-) delete mode 100644 src/main/frontend/worker/rtc/asset_sync.cljs delete mode 100644 src/main/frontend/worker/rtc/macro.clj delete mode 100644 src/main/frontend/worker/rtc/ws.cljs delete mode 100644 src/test/frontend/worker/rtc/asset_sync_effects_test.cljs delete mode 100644 src/test/frontend/worker/rtc/mock.cljs diff --git a/src/main/frontend/worker/rtc/asset_sync.cljs b/src/main/frontend/worker/rtc/asset_sync.cljs deleted file mode 100644 index ba2c4e0cd..000000000 --- a/src/main/frontend/worker/rtc/asset_sync.cljs +++ /dev/null @@ -1,164 +0,0 @@ -(ns frontend.worker.rtc.asset-sync - "Fns for syncing assets" - {:clj-kondo/ignore true} ;; TODO: remove when this ns is ready - (:require [malli.core :as m] - [malli.util :as mu] - [cljs.core.async :as async :refer [! chan go go-loop]] - [frontend.worker.rtc.const :as rtc-const] - [frontend.worker.rtc.op-mem-layer :as op-mem-layer] - [frontend.worker.rtc.ws :as ws] - [frontend.worker.async-util :include-macros true :refer [ asset-entity :asset/meta :name) - "default-name")}]}))] - (when (:ex-data r) - (throw (ex-info (:ex-message r) (:ex-data r))))) - - :remove-asset - (let [r (clj (js/JSON.parse (.-data e)) :keywordize-keys true)] - (offer! data-from-ws-chan data)))) - - (set! (.-onclose ws) (fn [e] - (println :ws-stopped) - (js/console.error e))) - ws)) - -(defn send! - [ws message] - (assert (= WebSocketOPEN (.-readyState ws))) - (let [decoded-message (rtc-const/data-to-ws-coercer message)] - (.send ws (js/JSON.stringify (clj->js (rtc-const/data-to-ws-encoder decoded-message)))))) - -(declare (.-readyState ws) WebSocketOPEN)) - (let [ws-opened-ch (chan) - ws* (ws-listen @(:*token state) (:data-from-ws-chan state) ws-opened-ch)] - (clj (js/JSON.parse body) :keywordize-keys true) - {:req-id (get-req-id) - :ex-message "get s3 object failed" - :ex-data {:type :get-s3-object-failed :status status :body body}})) - resp)] - (rtc-const/data-from-ws-coercer resp*))))) - - -(defn stop - [ws] - (set! (.-onopen ws) nil) - (set! (.-onclose ws) nil) - (set! (.-onmessage ws) nil) - (set! (.-onerror ws) nil) - (.close ws)) - -(defn get-state - [ws] - (case (.-readyState ws) - 0 :connecting - 1 :open - 2 :closing - 3 :closed)) diff --git a/src/test/frontend/worker/rtc/asset_sync_effects_test.cljs b/src/test/frontend/worker/rtc/asset_sync_effects_test.cljs deleted file mode 100644 index 0722efbdf..000000000 --- a/src/test/frontend/worker/rtc/asset_sync_effects_test.cljs +++ /dev/null @@ -1,24 +0,0 @@ -(ns frontend.worker.rtc.asset-sync-effects-test - "This ns include tests abouts asset-sync with other components. - These tests need to start the asset-sync-loop." - #_:clj-kondo/ignore - (:require [clojure.test :as t :refer [deftest is use-fixtures]] - [frontend.test.helper :include-macros true :as test-helper] - [frontend.worker.rtc.fixture :as rtc-fixture] - #_:clj-kondo/ignore - [spy.core :as spy])) - -(use-fixtures :each - test-helper/db-based-start-and-destroy-db-map-fixture - rtc-fixture/listen-test-db-to-gen-rtc-ops-fixture - rtc-fixture/start-and-stop-asset-sync-loop-fixture - rtc-fixture/clear-op-mem-stores-fixture) - - -;; FIXME: Re-enable when this test doesn't fail when whole test suite is run -;; e.g. https://github.com/logseq/logseq/actions/runs/7627378707/job/20775904183 -#_(deftest asset-sync-loop-init-test - (let [ws @(:*ws @rtc-fixture/*test-asset-sync-state) - handler-fn (:handler-fn ws) - ws-msg (first (spy/last-call handler-fn))] - (is (= "list-graphs" (:action ws-msg))))) diff --git a/src/test/frontend/worker/rtc/fixture.cljs b/src/test/frontend/worker/rtc/fixture.cljs index 8d7ac73ca..f2b6d45b1 100644 --- a/src/test/frontend/worker/rtc/fixture.cljs +++ b/src/test/frontend/worker/rtc/fixture.cljs @@ -1,92 +1,10 @@ (ns frontend.worker.rtc.fixture - (:require [cljs.core.async :as async :refer [! chan go]] - [cljs.test :as t] - [datascript.core :as d] - [frontend.db :as db] + (:require [datascript.core :as d] [frontend.db.conn :as conn] - [frontend.state :as state] [frontend.test.helper :as test-helper] [frontend.worker.db-listener :as worker-db-listener] - [frontend.worker.rtc.asset-sync :as asset-sync] - [frontend.worker.rtc.core :as rtc-core] - [frontend.worker.rtc.mock :as rtc-mock] [frontend.worker.rtc.op-mem-layer :as op-mem-layer])) -(def *test-rtc-state (atom nil)) -(def *test-asset-sync-state (atom nil)) -(def test-graph-uuid "e6d04ed7-bbc4-4ed2-a91b-69f3c0b9459d") -(def test-graph-init-local-t 1) - -(defn- init-state-helper - [] - (let [data-from-ws-chan (chan (async/sliding-buffer 100)) - ws (rtc-mock/mock-websocket data-from-ws-chan)] - (assoc (rtc-core/init-state ws data-from-ws-chan "" "user-uuid" true) - :*auto-push-client-ops? (atom false)))) - -(defn- init-state-helper-for-asset-sync-loop - [] - (let [data-from-ws-chan (chan (async/sliding-buffer 100)) - ws (rtc-mock/mock-websocket data-from-ws-chan) - rtc-state (rtc-core/init-state ws data-from-ws-chan "" "user-uuid" true)] - (assoc (asset-sync/init-state-from-rtc-state rtc-state) - :*auto-push-assets-update-ops? (atom false)))) - -(defn- (:*stop-rtc-loop-chan @*test-rtc-state) deref)] - (prn :stopping-rtc-loop) - (>! stop-rtc-loop-chan true)) - (reset! *test-rtc-state nil) - (done)))}) - -(def start-and-stop-asset-sync-loop-fixture - {:before - #(t/async done - (go - ( (:*stop-asset-sync-loop-chan @*test-asset-sync-state) deref)] - (prn :stopping-asset-sync-loop) - (>! stop-asset-sync-loop-chan true)) - (reset! *test-asset-sync-state nil) - (done)))}) - - (def listen-test-db-to-gen-rtc-ops-fixture {:before #(let [test-db-conn (conn/get-db test-helper/test-db-name-db-version false)] @@ -97,7 +15,6 @@ #(when-let [test-db-conn (conn/get-db test-helper/test-db-name-db-version false)] (d/unlisten! test-db-conn :frontend.worker.db-listener/listen-db-changes!))}) - (def clear-op-mem-stores-fixture {:before #(do (op-mem-layer/remove-ops-store! test-helper/test-db-name-db-version) (op-mem-layer/init-empty-ops-store! test-helper/test-db-name-db-version)) diff --git a/src/test/frontend/worker/rtc/local_tx_to_remote_test.cljs b/src/test/frontend/worker/rtc/local_tx_to_remote_test.cljs index d5b410a35..3e7aacd6c 100644 --- a/src/test/frontend/worker/rtc/local_tx_to_remote_test.cljs +++ b/src/test/frontend/worker/rtc/local_tx_to_remote_test.cljs @@ -6,7 +6,7 @@ [frontend.state :as state] [frontend.test.helper :as test-helper] [frontend.worker.rtc.const :as rtc-const] - [frontend.worker.rtc.core :as rtc-core] + [frontend.worker.rtc.client :as r.client] [frontend.worker.rtc.fixture :as rtc-fixture] [frontend.worker.state :as worker-state] [logseq.common.config :as common-config] @@ -32,8 +32,8 @@ :conn conn}} gen-ops-fn (fn [] (let [r (rtc-const/to-ws-ops-decoder - (rtc-core/sort-remote-ops - (rtc-core/gen-block-uuid->remote-ops repo conn "user-uuid")))] + (#'r.client/sort-remote-ops + (#'r.client/gen-block-uuid->remote-ops repo conn "user-uuid")))] (is (rtc-const/to-ws-ops-validator r) r) r))] (testing "create a new page" diff --git a/src/test/frontend/worker/rtc/mock.cljs b/src/test/frontend/worker/rtc/mock.cljs deleted file mode 100644 index 2b6d6617e..000000000 --- a/src/test/frontend/worker/rtc/mock.cljs +++ /dev/null @@ -1,44 +0,0 @@ -(ns frontend.worker.rtc.mock - (:require [clojure.core.async :as async] - [frontend.worker.rtc.const :as rtc-const] - [spy.core :as spy])) - -;;; websocket -(defrecord Mock-WebSocket [onopen onmessage onclose onerror readyState push-data-to-client-chan ^:mutable handler-fn] - Object - (close [_] - (prn :mock-ws :closed) - (when (fn? onclose) (onclose))) - (send [_ s] - (let [msg (-> s - js/JSON.parse - (js->clj :keywordize-keys true) - rtc-const/data-to-ws-coercer)] - (handler-fn msg push-data-to-client-chan))) - - (set-handler-fn [_ f] - (set! handler-fn f))) - -(defn default-handler - [msg push-data-to-client-chan] - (case (:action msg) - "register-graph-updates" - (async/offer! push-data-to-client-chan (select-keys msg [:req-id])) - "list-graphs" - (async/offer! push-data-to-client-chan (assoc (select-keys msg [:req-id]) - :graphs [])) - ;; default - nil)) - - -(defn mock-websocket - [data-from-ws-chan] - (->Mock-WebSocket nil (async/chan 10) nil nil 1 - data-from-ws-chan (spy/spy default-handler))) - - -;; (defn set-ws-handler-fn -;; [ws f] -;; (.set-handler-fn ws f)) - -;;; websocket ends ;;;; diff --git a/src/test/frontend/worker/rtc/rtc_fns_test.cljs b/src/test/frontend/worker/rtc/rtc_fns_test.cljs index e419672a1..a4ac5aeb2 100644 --- a/src/test/frontend/worker/rtc/rtc_fns_test.cljs +++ b/src/test/frontend/worker/rtc/rtc_fns_test.cljs @@ -6,7 +6,8 @@ [frontend.state :as state] [frontend.test.helper :as test-helper] [frontend.worker.rtc.const :as rtc-const] - [frontend.worker.rtc.core :as rtc-core] + [frontend.worker.rtc.remote-update :as r.remote] + [frontend.worker.rtc.client :as r.client] [frontend.worker.rtc.op-mem-layer :as op-mem-layer] [frontend.worker.state :as worker-state] [logseq.common.config :as common-config] @@ -34,7 +35,7 @@ [["update" {:block-uuid uuid1 :updated-attrs {:content nil} :epoch 1}]] - r (rtc-core/filter-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)] + r (#'r.remote/filter-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)] (is (= {uuid1 {:op :move :self uuid1 @@ -55,7 +56,7 @@ [["update" {:block-uuid uuid1 :updated-attrs {:content nil} :epoch 1}]] - r (rtc-core/filter-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)] + r (#'r.remote/filter-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)] (is (= {uuid1 {:op :update-attrs :self uuid1 @@ -71,7 +72,7 @@ :block-uuid uuid1}} unpushed-ops [["move" {:block-uuid uuid1 :epoch 1}]] - r (rtc-core/filter-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)] + r (#'r.remote/filter-remote-data-by-local-unpushed-ops affected-blocks-map unpushed-ops)] (is (empty? r))))) @@ -104,9 +105,9 @@ ["move" {:block-uuid (str uuid3) :epoch 3}] ["update" {:block-uuid (str uuid4) :epoch 4}]]) (let [_ (op-mem-layer/new-branch! repo) - r1 (rtc-core/gen-block-uuid->remote-ops repo conn "user-uuid" :n 1) + r1 (#'r.client/gen-block-uuid->remote-ops repo conn "user-uuid" :n 1) _ (op-mem-layer/rollback! repo) - r2 (rtc-core/gen-block-uuid->remote-ops repo conn "user-uuid" :n 2)] + r2 (#'r.client/gen-block-uuid->remote-ops repo conn "user-uuid" :n 2)] (is (= {uuid2 [:move]} (update-vals r1 keys))) (is (= {uuid2 [:move] @@ -151,12 +152,12 @@ :parents [page-uuid] :left page-uuid :content "uuid1-remote"}}} - move-ops (#'rtc-core/move-ops-map->sorted-move-ops + move-ops (#'r.remote/move-ops-map->sorted-move-ops (:move-ops-map - (#'rtc-core/affected-blocks->diff-type-ops + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-move-ops repo conn date-formatter move-ops) + (#'r.remote/apply-remote-move-ops repo conn date-formatter move-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1-remote uuid1-client uuid2-client} (set (map :block/uuid page-blocks)))) (is (= page-uuid (:block/uuid (:block/left (d/entity @conn [:block/uuid uuid1-remote])))))))) @@ -175,12 +176,12 @@ :self uuid1-remote :parents [uuid2-remote] :left uuid2-remote}}} - move-ops (#'rtc-core/move-ops-map->sorted-move-ops + move-ops (#'r.remote/move-ops-map->sorted-move-ops (:move-ops-map - (#'rtc-core/affected-blocks->diff-type-ops + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-move-ops repo conn date-formatter move-ops) + (#'r.remote/apply-remote-move-ops repo conn date-formatter move-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1-remote uuid2-remote uuid1-client uuid2-client} (set (map :block/uuid page-blocks)))) (is (= uuid1-client (:block/uuid (:block/left (d/entity @conn [:block/uuid uuid2-remote]))))) @@ -229,9 +230,9 @@ :type ["property"]}}} update-ops (vals (:update-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-ops repo conn date-formatter update-ops) + (#'r.remote/apply-remote-update-ops repo conn date-formatter update-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1-client uuid2-client uuid1-remote} (set (map :block/uuid page-blocks)))) (is (= [uuid1-client #{"property"}] @@ -252,9 +253,9 @@ :type nil}}} update-ops (vals (:update-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-ops repo conn date-formatter update-ops) + (#'r.remote/apply-remote-update-ops repo conn date-formatter update-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1-client uuid2-client uuid1-remote} (set (map :block/uuid page-blocks)))) (is (= [nil nil] ((juxt :block/link :block/type) (d/entity @conn [:block/uuid uuid1-remote]))))))) @@ -269,9 +270,9 @@ :link uuid1-not-exist}}} update-ops (vals (:update-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-ops repo conn date-formatter update-ops) + (#'r.remote/apply-remote-update-ops repo conn date-formatter update-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1-client uuid2-client uuid1-remote} (set (map :block/uuid page-blocks)))) (is (= [nil nil] ((juxt :block/link :block/type) (d/entity @conn [:block/uuid uuid1-remote]))))))) @@ -286,13 +287,13 @@ :tags [tag1-uuid]}}} update-ops (vals (:update-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (d/transact! conn [{:block/uuid tag1-uuid :block/type #{"class"}, :block/name "task", :block/original-name "Task"}]) (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-ops repo conn date-formatter update-ops) + (#'r.remote/apply-remote-update-ops repo conn date-formatter update-ops) (is (= #{tag1-uuid} (set (map :block/uuid (:block/tags (d/entity @conn [:block/uuid uuid1-remote])))))))))) (deftest ^:fix-me apply-remote-remove-ops-test @@ -328,9 +329,9 @@ remove-ops (vals (:remove-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-remove-ops repo conn date-formatter remove-ops) + (#'r.remote/apply-remote-remove-ops repo conn date-formatter remove-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1-client uuid2-client} (set (map :block/uuid page-blocks))))))) (testing "apply-remote-remove-ops-test2" @@ -340,9 +341,9 @@ :block-uuid uuid1-client}}} remove-ops (vals (:remove-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-remove-ops repo conn date-formatter remove-ops) + (#'r.remote/apply-remote-remove-ops repo conn date-formatter remove-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid2-client} (set (map :block/uuid page-blocks))))))))) @@ -394,9 +395,9 @@ server: ;; remove 2 remove-ops (vals (:remove-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-remove-ops repo conn date-formatter remove-ops) + (#'r.remote/apply-remote-remove-ops repo conn date-formatter remove-ops) (let [page-blocks (ldb/get-page-blocks @conn (:db/id (ldb/get-page @conn page-name)) {})] (is (= #{uuid1 uuid3} (set (map :block/uuid page-blocks)))) (is (= page-uuid (:block/uuid (:block/left (d/entity @conn [:block/uuid uuid3])))))))))) @@ -417,9 +418,9 @@ server: ;; remove 2 :original-name (str page1-uuid)}}} update-page-ops (vals (:update-page-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-page-ops repo conn date-formatter update-page-ops) + (#'r.remote/apply-remote-update-page-ops repo conn date-formatter update-page-ops) (is (= page1-uuid (:block/uuid (d/entity @conn [:block/uuid page1-uuid])))))) (testing "apply-remote-update-page-ops-test2" @@ -431,9 +432,9 @@ server: ;; remove 2 :original-name (str page1-uuid "-rename")}}} update-page-ops (vals (:update-page-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-page-ops repo conn date-formatter update-page-ops) + (#'r.remote/apply-remote-update-page-ops repo conn date-formatter update-page-ops) (is (= (str page1-uuid "-rename") (:block/name (d/entity @conn [:block/uuid page1-uuid])))))) (testing "apply-remote-remove-page-ops-test1" @@ -443,9 +444,9 @@ server: ;; remove 2 :block-uuid page1-uuid}}} remove-page-ops (vals (:remove-page-ops-map - (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] + (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws))))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-remove-page-ops repo conn remove-page-ops) + (#'r.remote/apply-remote-remove-page-ops repo conn remove-page-ops) (is (nil? (d/entity @conn [:block/uuid page1-uuid]))))))) ;; TODO: add back once page merge get supported @@ -493,12 +494,12 @@ server: ;; remove 2 :parents [page2-uuid] :left uuid1-remote :content "uuid2-remote"}}} - all-ops (#'rtc-core/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws)) + all-ops (#'r.remote/affected-blocks->diff-type-ops repo (:affected-blocks data-from-ws)) update-page-ops (vals (:update-page-ops-map all-ops)) - move-ops (#'rtc-core/move-ops-map->sorted-move-ops (:move-ops-map all-ops))] + move-ops (#'r.remote/move-ops-map->sorted-move-ops (:move-ops-map all-ops))] (is (rtc-const/data-from-ws-validator data-from-ws)) - (rtc-core/apply-remote-update-page-ops repo conn date-formatter update-page-ops) - (rtc-core/apply-remote-move-ops repo conn date-formatter move-ops) + (#'r.remote/apply-remote-update-page-ops repo conn date-formatter update-page-ops) + (#'r.remote/apply-remote-move-ops repo conn date-formatter move-ops) (let [page (ldb/get-page @conn page-name)] (is (= #{uuid1-client uuid2-client uuid1-remote uuid2-remote} (set (map :block/uuid (ldb/get-page-blocks @conn (:db/id page) {})))))