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 433f1d75..6297af90 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 ca608314..aa7ff7fe 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)