From ef0017453862df1d0201a801063f11d5f969d821 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Fri, 23 May 2025 21:58:01 +0100 Subject: [PATCH] Fix E2E test by not creating deleted files --- .../src/sync-operations/unrestricted-syncer.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts b/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts index f6b2c8f8..58e88943 100644 --- a/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts +++ b/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts @@ -45,6 +45,13 @@ export class UnrestrictedSyncer { document.relativePath, SyncType.CREATE, async () => { + if (document.isDeleted) { + this.logger.debug( + `Document ${document.relativePath} has been already deleted, no need to update it` + ); + return; + } + const contentBytes = await this.operations.read( document.relativePath ); // this can throw FileNotFoundError @@ -125,7 +132,7 @@ export class UnrestrictedSyncer { async () => { const originalRelativePath = document.relativePath; - if (document.metadata === undefined || document.isDeleted) { + if (document.isDeleted || document.metadata === undefined) { this.logger.debug( `Document ${document.relativePath} has been already deleted, no need to update it` );