From 0cd2e9175f9bf723cbafad4acd7502fbf268f650 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Fri, 23 May 2025 21:57:41 +0100 Subject: [PATCH] Print pending id --- .../src/file-operations/safe-filesystem-operations.ts | 2 +- frontend/sync-client/src/sync-operations/syncer.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts b/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts index 433f1d7..6297af9 100644 --- a/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts +++ b/frontend/sync-client/src/file-operations/safe-filesystem-operations.ts @@ -138,7 +138,7 @@ export class SafeFileSystemOperations implements FileSystemOperations { /** * Decorate an operation to ensure that the file exists before running it. * If the operation fails, it will check if the file still exists and throw - * a FileNotFoundError if it doesn't + * a FileNotFoundError if it doesn't. */ private async safeOperation( path: RelativePath, diff --git a/frontend/sync-client/src/sync-operations/syncer.ts b/frontend/sync-client/src/sync-operations/syncer.ts index ca60831..aa7ff7f 100644 --- a/frontend/sync-client/src/sync-operations/syncer.ts +++ b/frontend/sync-client/src/sync-operations/syncer.ts @@ -128,12 +128,17 @@ export class Syncer { const [promise, resolve, reject] = createPromise(); + const id = uuidv4(); const document = this.database.createNewPendingDocument( - uuidv4(), + id, relativePath, promise ); + this.logger.debug( + `Creating new pending document ${relativePath} with id ${id}` + ); + try { await this.syncQueue.add(async () => this.internalSyncer.unrestrictedSyncLocallyCreatedFile(document)