From 0b26f16422310fca98cfe36945b904f5aff3ffaa Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 11 May 2026 16:15:22 +0800 Subject: [PATCH] fix: can't export client ops db on web --- src/main/frontend/worker/db_core.cljs | 3 +- src/test/frontend/worker/db_worker_test.cljs | 32 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/main/frontend/worker/db_core.cljs b/src/main/frontend/worker/db_core.cljs index 587882b319..c2b9d54481 100644 --- a/src/main/frontend/worker/db_core.cljs +++ b/src/main/frontend/worker/db_core.cljs @@ -905,7 +905,8 @@ (str "/" client-ops-repo-path) (str "client-ops" repo-path) (str "/client-ops" repo-path) - (str "client-ops-" repo-path)]] + (str "client-ops-" repo-path) + (str "/client-ops-" repo-path)]] (p/let [payload ( (export-client-ops-db-base64 test-repo) + (p/then (fn [result] + (is (contains? (set @export-calls) "/client-ops-/db.sqlite")) + (is (string? result)) + (is (= [4 5 6] + (vec (js/Uint8Array. (.from js/Buffer result "base64"))))) + (done))) + (p/catch (fn [error] + (is false (str error)) + (done)))))))))) + (deftest thread-api-db-core-registers-all-thread-apis-test (let [missing (->> expected-db-core-thread-apis (remove #(contains? @thread-api/*thread-apis %))