From 60b6d90b6cc60e55b39a8e776c7bd72539261e73 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Thu, 2 Jan 2025 20:46:00 +0000 Subject: [PATCH] Rename syncServer to syncService --- .../apply-remote-changes-locally.ts | 6 +++--- plugin/src/sync-operations/syncer.ts | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugin/src/sync-operations/apply-remote-changes-locally.ts b/plugin/src/sync-operations/apply-remote-changes-locally.ts index 088935b5..d1a8f69f 100644 --- a/plugin/src/sync-operations/apply-remote-changes-locally.ts +++ b/plugin/src/sync-operations/apply-remote-changes-locally.ts @@ -7,11 +7,11 @@ let isRunning = false; export async function applyRemoteChangesLocally({ database, - syncServer, + syncService, syncer, }: { database: Database; - syncServer: SyncService; + syncService: SyncService; syncer: Syncer; }): Promise { if (!database.getSettings().isSyncEnabled) { @@ -29,7 +29,7 @@ export async function applyRemoteChangesLocally({ isRunning = true; try { - const remote = await syncServer.getAll(database.getLastSeenUpdateId()); + const remote = await syncService.getAll(database.getLastSeenUpdateId()); if (remote.latestDocuments.length === 0) { Logger.getInstance().debug("No remote changes to apply"); diff --git a/plugin/src/sync-operations/syncer.ts b/plugin/src/sync-operations/syncer.ts index 8d08a0f1..4d3e52f6 100644 --- a/plugin/src/sync-operations/syncer.ts +++ b/plugin/src/sync-operations/syncer.ts @@ -13,7 +13,7 @@ import type { components } from "src/services/types.js"; export class Syncer { private readonly database: Database; - private readonly syncServer: SyncService; + private readonly syncService: SyncService; private readonly operations: FileOperations; private readonly history: SyncHistory; @@ -27,17 +27,17 @@ export class Syncer { public constructor({ database, - syncServer, + syncService, operations, history, }: { database: Database; - syncServer: SyncService; + syncService: SyncService; operations: FileOperations; history: SyncHistory; }) { this.database = database; - this.syncServer = syncServer; + this.syncService = syncService; this.operations = operations; this.history = history; @@ -87,7 +87,7 @@ export class Syncer { const contentBytes = await this.operations.read(relativePath); const contentHash = hash(contentBytes); - const response = await this.syncServer.create({ + const response = await this.syncService.create({ relativePath, contentBytes, createdDate: updateTime, @@ -162,7 +162,7 @@ export class Syncer { return; } - await this.syncServer.delete({ + await this.syncService.delete({ documentId: metadata.documentId, relativePath, // We got the event now, so it must have been deleted just now @@ -223,7 +223,7 @@ export class Syncer { return; } - const response = await this.syncServer.put({ + const response = await this.syncService.put({ documentId: metadata.documentId, parentVersionId: metadata.parentVersionId, relativePath, @@ -462,7 +462,7 @@ export class Syncer { } const content = ( - await this.syncServer.get({ + await this.syncService.get({ documentId: remoteVersion.documentId, }) ).contentBase64; @@ -527,7 +527,7 @@ export class Syncer { } const content = ( - await this.syncServer.get({ + await this.syncService.get({ documentId: remoteVersion.documentId, }) ).contentBase64;