From fcd2c93a19b6bad823d8543ab4ebc4da613b063e Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sun, 20 Oct 2024 00:13:07 -0400 Subject: [PATCH] ensure that "thumbnail stored" / "web stored" messages only appear after success --- packages/backend/src/core/DriveService.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index 781b435c9a..e75928d83e 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -234,16 +234,22 @@ export class DriveService { if (alts.thumbnail) { promises.push(this.internalStorageService.saveFromBuffer(thumbnailAccessKey, alts.thumbnail.data)); - this.registerLogger.info(`thumbnail stored: ${thumbnailAccessKey}`); } if (alts.webpublic) { promises.push(this.internalStorageService.saveFromBuffer(webpublicAccessKey, alts.webpublic.data)); - this.registerLogger.info(`web stored: ${webpublicAccessKey}`); } const [url, thumbnailUrl, webpublicUrl] = await Promise.all(promises); + if (thumbnailUrl) { + this.registerLogger.info(`thumbnail stored: ${thumbnailAccessKey}`); + } + + if (webpublicUrl) { + this.registerLogger.info(`web stored: ${webpublicAccessKey}`); + } + file.storedInternal = true; file.url = url; file.thumbnailUrl = thumbnailUrl ?? null;