fix(nbstore): fix doc clock check logic (#10355)
This commit is contained in:
@@ -247,7 +247,7 @@ export class DocSyncPeer {
|
|||||||
!this.remote.isReadonly &&
|
!this.remote.isReadonly &&
|
||||||
clock &&
|
clock &&
|
||||||
(pushedClock === null ||
|
(pushedClock === null ||
|
||||||
pushedClock.getTime() !== clock.timestamp.getTime())
|
pushedClock.getTime() < clock.timestamp.getTime())
|
||||||
) {
|
) {
|
||||||
await this.jobs.pullAndPush(docId, signal);
|
await this.jobs.pullAndPush(docId, signal);
|
||||||
} else {
|
} else {
|
||||||
@@ -255,9 +255,10 @@ export class DocSyncPeer {
|
|||||||
const pulled =
|
const pulled =
|
||||||
(await this.syncMetadata.getPeerPulledRemoteClock(this.peerId, docId))
|
(await this.syncMetadata.getPeerPulledRemoteClock(this.peerId, docId))
|
||||||
?.timestamp ?? null;
|
?.timestamp ?? null;
|
||||||
|
const remoteClock = this.status.remoteClocks.get(docId);
|
||||||
if (
|
if (
|
||||||
pulled === null ||
|
remoteClock &&
|
||||||
pulled.getTime() !== this.status.remoteClocks.get(docId)?.getTime()
|
(pulled === null || pulled.getTime() < remoteClock.getTime())
|
||||||
) {
|
) {
|
||||||
await this.jobs.pull(docId, signal);
|
await this.jobs.pull(docId, signal);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user