Skip to content

Commit 2a1ec47

Browse files
committed
fix: local-tx not initialized when creating a new graph
1 parent 18b8243 commit 2a1ec47

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/main/frontend/worker/db_core.cljs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
:skip-validate-db? true}))))
402402

403403
(defn- <create-or-open-db!
404-
[repo {:keys [config datoms sync-download-graph? remote-graph?] :as opts}]
404+
[repo {:keys [config datoms sync-download-graph?] :as opts}]
405405
(when-not (worker-state/get-sqlite-conn repo)
406406
(p/let [[db search-db client-ops-db :as dbs] (get-dbs repo)
407407
storage (new-sqlite-storage db)]
@@ -446,6 +446,8 @@
446446
(when-not @*publishing?
447447
(client-op/ensure-sqlite-schema! client-ops-db))
448448
(ensure-client-ops-cleanup-timer! repo)
449+
(when (nil? (client-op/get-local-tx repo))
450+
(client-op/update-local-tx repo 0))
449451
(let [initial-tx-report (when-not (or initial-data-exists?
450452
(seq datoms)
451453
sync-download-graph?)
@@ -459,9 +461,6 @@
459461
(gc-sqlite-dbs! db client-ops-db conn {})
460462
(maybe-run-recycle-gc! conn))
461463

462-
(when remote-graph?
463-
(client-op/update-local-tx repo 0))
464-
465464
(when initial-tx-report
466465
(db-sync/handle-local-tx! repo initial-tx-report))
467466

0 commit comments

Comments
 (0)