Fix resetting

This commit is contained in:
Andras Schmelczer 2025-11-23 16:41:42 +00:00
parent d8058d396c
commit c94d732f24
11 changed files with 161 additions and 56 deletions

View file

@ -250,4 +250,11 @@ export class CursorTracker {
? DocumentUpToDateness.UpToDate
: DocumentUpToDateness.Prior;
}
public reset(): void {
this.knownRemoteCursors = [];
this.lastLocalCursorState = [];
this.lastLocalCursorStateWithoutDirtyDocuments = [];
this.updateLock.reset();
}
}

View file

@ -32,7 +32,6 @@ export class Syncer {
private readonly syncQueue: PQueue;
private _isFirstSyncComplete = false;
private runningScheduleSyncForOfflineChanges: Promise<void> | undefined;
public constructor(
@ -514,4 +513,11 @@ export class Syncer {
this.database.setHasInitialSyncCompleted(true);
}
public reset(): void {
this._isFirstSyncComplete = false;
this.syncQueue.clear();
this.remoteDocumentsLock.reset();
this.runningScheduleSyncForOfflineChanges = undefined;
}
}