mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: ui not synced with final db
This commit is contained in:
@@ -356,7 +356,7 @@
|
||||
(when (and conn (= local-tx remote-tx)) ; rebase
|
||||
(when (empty? inflight)
|
||||
(when-let [ws (:ws client)]
|
||||
(when (ws-open? ws)
|
||||
(when (and (ws-open? ws) (worker-state/online?))
|
||||
(let [batch (pending-txs repo {:limit 50})]
|
||||
(when (seq batch)
|
||||
(let [tx-ids (mapv :tx-id batch)
|
||||
@@ -596,9 +596,10 @@
|
||||
(p/resolved nil)))))
|
||||
|
||||
(defn- apply-remote-tx!
|
||||
[repo client tx-data & {:keys [expected-checksum]}]
|
||||
[repo client tx-data* & {:keys [expected-checksum]}]
|
||||
(if-let [conn (worker-state/get-datascript-conn repo)]
|
||||
(let [local-txs (pending-txs repo)
|
||||
(let [tx-data (keep-last-update @conn tx-data*)
|
||||
local-txs (pending-txs repo)
|
||||
*computed-checksum (atom nil)
|
||||
reversed-tx-data (->> local-txs
|
||||
(mapcat :reversed-tx)
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
(:require [frontend.worker.db-listener :as db-listener]
|
||||
[frontend.worker.rtc.client-op :as client-op]
|
||||
[frontend.worker.rtc.debug-log :as rtc-debug-log]
|
||||
[frontend.worker.rtc.gen-client-op :as gen-client-op]))
|
||||
[frontend.worker.rtc.gen-client-op :as gen-client-op]
|
||||
[frontend.worker.state :as worker-state]))
|
||||
|
||||
(comment
|
||||
;; TODO: make it a qualified-keyword
|
||||
@@ -15,7 +16,8 @@
|
||||
{:keys [repo same-entity-datoms-coll id->same-entity-datoms]}
|
||||
{:keys [tx-data tx-meta db-before db-after]}]
|
||||
(when (and (client-op/rtc-db-graph? repo)
|
||||
(:persist-op? tx-meta true))
|
||||
(:persist-op? tx-meta true)
|
||||
(not (:enabled? @worker-state/*db-sync-config)))
|
||||
(rtc-debug-log/log-tx! repo tx-data tx-meta)
|
||||
(let [e->a->add?->v->t (update-vals
|
||||
id->same-entity-datoms
|
||||
|
||||
@@ -123,6 +123,10 @@
|
||||
[]
|
||||
(:auth/id-token @*state))
|
||||
|
||||
(defn online?
|
||||
[]
|
||||
@(:thread-atom/online-event @*state))
|
||||
|
||||
(comment
|
||||
(defn mobile?
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user