Fix reset flow

This commit is contained in:
Andras Schmelczer 2025-03-22 17:21:59 +00:00
parent bd44fe9c74
commit 8cfbaa1bda
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
4 changed files with 28 additions and 3 deletions

View file

@ -162,8 +162,8 @@ export class SyncClient {
}
public async waitAndStop(): Promise<void> {
await this.syncer.waitForSyncQueue();
await this.syncer.applyRemoteChangesLocally();
await this.syncer.waitForSyncQueue();
this.stop();
}
@ -172,11 +172,12 @@ export class SyncClient {
/// The SyncClient can be used again after calling this method.
public async reset(): Promise<void> {
this.stop();
this.connectionStatus.reset();
this.connectionStatus.startReset();
await this.syncer.reset();
this.history.reset();
this.database.reset();
this._logger.reset();
this.connectionStatus.finishReset();
void this.start();
}