From dd4b38276ab0886f4fcdfe630de13a656da2e9b8 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 26 Feb 2026 21:04:02 +0800 Subject: [PATCH] Reveal stale :block/title sync bug in tests --- src/test/frontend/worker/db_sync_sim_test.cljs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/frontend/worker/db_sync_sim_test.cljs b/src/test/frontend/worker/db_sync_sim_test.cljs index 4c18f8fd4e..9b65aa184f 100644 --- a/src/test/frontend/worker/db_sync_sim_test.cljs +++ b/src/test/frontend/worker/db_sync_sim_test.cljs @@ -1,7 +1,6 @@ (ns frontend.worker.db-sync-sim-test (:require [cljs.test :refer [deftest is testing]] [clojure.data :as data] - [clojure.string :as string] [datascript.core :as d] [frontend.worker.handler.page :as worker-page] [frontend.worker.state :as worker-state] @@ -371,9 +370,8 @@ (let [parent-uuid (:block/uuid parent) parent (d/entity db [:block/uuid parent-uuid])] (when parent - (let [uuid ((or gen-uuid random-uuid)) - title (str "Block-" (rand-int! rng 1000000))] - (create-block! conn parent title uuid) + (let [uuid ((or gen-uuid random-uuid))] + (create-block! conn parent "" uuid) (swap! state update :blocks conj uuid) {:op :create-block :uuid uuid :parent parent-uuid})))))) @@ -384,7 +382,7 @@ block (d/entity db [:block/uuid (:block/uuid ent)])] (when (and block (not (ldb/page? block))) (let [uuid (:block/uuid block) - new-title (string/replace (:block/title (d/entity @conn [:block/uuid uuid])) "block" "title")] + new-title (str "title-" (:db/id block))] (update-title! conn uuid new-title) {:op :update-title :uuid uuid :title new-title}))))