From f3d985cc573577c620d89451fc3af5f06b75412b Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sat, 28 Mar 2026 12:07:57 +0000 Subject: [PATCH] Remove duplicate errors --- .../src/file-operations/file-not-found-error.ts | 9 --------- .../sync-client/src/services/authentication-error.ts | 6 ------ .../src/services/server-version-mismatch-error.ts | 6 ------ frontend/sync-client/src/services/sync-reset-error.ts | 6 ------ .../sync-client/src/sync-operations/cursor-tracker.ts | 4 ++-- 5 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 frontend/sync-client/src/file-operations/file-not-found-error.ts delete mode 100644 frontend/sync-client/src/services/authentication-error.ts delete mode 100644 frontend/sync-client/src/services/server-version-mismatch-error.ts delete mode 100644 frontend/sync-client/src/services/sync-reset-error.ts diff --git a/frontend/sync-client/src/file-operations/file-not-found-error.ts b/frontend/sync-client/src/file-operations/file-not-found-error.ts deleted file mode 100644 index b8acd265..00000000 --- a/frontend/sync-client/src/file-operations/file-not-found-error.ts +++ /dev/null @@ -1,9 +0,0 @@ -export class FileNotFoundError extends Error { - public constructor( - message: string, - public readonly filePath: string - ) { - super(message); - this.name = "FileNotFoundError"; - } -} diff --git a/frontend/sync-client/src/services/authentication-error.ts b/frontend/sync-client/src/services/authentication-error.ts deleted file mode 100644 index 6be4af24..00000000 --- a/frontend/sync-client/src/services/authentication-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class AuthenticationError extends Error { - public constructor(message: string) { - super(message); - this.name = "AuthenticationError"; - } -} diff --git a/frontend/sync-client/src/services/server-version-mismatch-error.ts b/frontend/sync-client/src/services/server-version-mismatch-error.ts deleted file mode 100644 index 0b9960ea..00000000 --- a/frontend/sync-client/src/services/server-version-mismatch-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class ServerVersionMismatchError extends Error { - public constructor(message: string) { - super(message); - this.name = "ServerVersionMismatchError"; - } -} diff --git a/frontend/sync-client/src/services/sync-reset-error.ts b/frontend/sync-client/src/services/sync-reset-error.ts deleted file mode 100644 index 7b74e0b9..00000000 --- a/frontend/sync-client/src/services/sync-reset-error.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class SyncResetError extends Error { - public constructor() { - super("SyncClient has been reset, cleaning up"); - this.name = "SyncResetError"; - } -} diff --git a/frontend/sync-client/src/sync-operations/cursor-tracker.ts b/frontend/sync-client/src/sync-operations/cursor-tracker.ts index abbfc973..dbce144b 100644 --- a/frontend/sync-client/src/sync-operations/cursor-tracker.ts +++ b/frontend/sync-client/src/sync-operations/cursor-tracker.ts @@ -142,7 +142,7 @@ export class CursorTracker { const record = this.database.getLatestDocumentByRelativePath( doc.relative_path ); - if (record?.metadata?.hash !== hash(readContent)) { + if (record?.metadata?.hash !== (await hash(readContent))) { doc.vault_update_id = null; } } @@ -255,7 +255,7 @@ export class CursorTracker { return this.database.getLatestDocumentByRelativePath( document.relative_path - )?.metadata?.hash === hash(currentContent) + )?.metadata?.hash === (await hash(currentContent)) ? DocumentUpToDateness.UpToDate : DocumentUpToDateness.Prior; }