Stop exposing Syncer from SyncClient

This commit is contained in:
Andras Schmelczer 2025-03-22 13:48:01 +00:00
parent 93b43f57b7
commit 2722f7c7fc
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
11 changed files with 84 additions and 55 deletions

View file

@ -134,9 +134,7 @@ export class MockAgent extends MockClient {
public async finish(): Promise<void> {
await this.client.setSetting("isSyncEnabled", true);
await Promise.all(this.pendingActions);
this.client.stop();
await this.client.syncer.waitForSyncQueue();
await this.client.syncer.applyRemoteChangesLocally();
await this.client.waitAndStop();
}
public assertFileSystemsAreConsistent(otherAgent: MockAgent): void {

View file

@ -72,7 +72,7 @@ export class MockClient implements FileSystemOperations {
this.localFiles.set(path, newContent);
this.runCallback(() => {
void this.client.syncer.syncLocallyCreatedFile(path);
void this.client.syncLocallyCreatedFile(path);
});
}
@ -114,7 +114,7 @@ export class MockClient implements FileSystemOperations {
);
this.runCallback(() => {
void this.client.syncer.syncLocallyUpdatedFile({
void this.client.syncLocallyUpdatedFile({
relativePath: path
});
});
@ -132,11 +132,11 @@ export class MockClient implements FileSystemOperations {
this.runCallback(() => {
if (hasExisted) {
void this.client.syncer.syncLocallyUpdatedFile({
void this.client.syncLocallyUpdatedFile({
relativePath: path
});
} else {
void this.client.syncer.syncLocallyCreatedFile(path);
void this.client.syncLocallyCreatedFile(path);
}
});
}
@ -148,7 +148,7 @@ export class MockClient implements FileSystemOperations {
this.localFiles.delete(path);
this.runCallback(() => {
void this.client.syncer.syncLocallyDeletedFile(path);
void this.client.syncLocallyDeletedFile(path);
});
}
@ -170,7 +170,7 @@ export class MockClient implements FileSystemOperations {
);
this.runCallback(() => {
void this.client.syncer.syncLocallyUpdatedFile({
void this.client.syncLocallyUpdatedFile({
oldPath,
relativePath: newPath
});