This commit is contained in:
Andras Schmelczer 2025-11-23 20:27:16 +00:00
parent 4b195b070d
commit 18be9f4dd8
19 changed files with 301 additions and 226 deletions

View file

@ -157,6 +157,13 @@ export class CursorTracker {
});
}
public reset(): void {
this.knownRemoteCursors = [];
this.lastLocalCursorState = [];
this.lastLocalCursorStateWithoutDirtyDocuments = [];
this.updateLock.reset();
}
private getRelevantAndPruneKnownClientCursors(): MaybeOutdatedClientCursors[] {
const result: MaybeOutdatedClientCursors[] = [];
const included = new Set<string>();
@ -250,11 +257,4 @@ export class CursorTracker {
? DocumentUpToDateness.UpToDate
: DocumentUpToDateness.Prior;
}
public reset(): void {
this.knownRemoteCursors = [];
this.lastLocalCursorState = [];
this.lastLocalCursorStateWithoutDirtyDocuments = [];
this.updateLock.reset();
}
}

View file

@ -299,6 +299,13 @@ export class Syncer {
}
}
public reset(): void {
this._isFirstSyncComplete = false;
this.syncQueue.clear();
this.remoteDocumentsLock.reset();
this.runningScheduleSyncForOfflineChanges = undefined;
}
private sendHandshakeMessage(): void {
const message: WebSocketClientMessage = {
type: "handshake",
@ -513,11 +520,4 @@ export class Syncer {
this.database.setHasInitialSyncCompleted(true);
}
public reset(): void {
this._isFirstSyncComplete = false;
this.syncQueue.clear();
this.remoteDocumentsLock.reset();
this.runningScheduleSyncForOfflineChanges = undefined;
}
}