From c9119099a9df2055cd90c31e232db2a33f9d9886 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Thu, 12 Dec 2024 03:35:46 +0900 Subject: [PATCH] FIX: Regression allowing async calls to finish before removing uploads (#30230) This PR fixes a recent regression in https://github.com/discourse/discourse/commit/e37952c9dbfe6c5bd2d914ba4a51c8ae7db3b0e3 that reverted a fix made in https://github.com/discourse/discourse/commit/1c4d5dae1cb39b35de9244a390d6a80fec2e1909, which allowed for async calls to finish first before removing in progress uploads. --- .../javascripts/discourse/app/lib/uppy/composer-upload.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js b/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js index c0531b74a09..9c29194d519 100644 --- a/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js +++ b/app/assets/javascripts/discourse/app/lib/uppy/composer-upload.js @@ -356,15 +356,15 @@ export default class UppyComposerUpload { } let upload = response.body; - // Only remove in progress after async resolvers finish: - this.#removeInProgressUpload(file.id); - cacheShortUploadUrl(upload.short_url, upload); - const markdown = await this.uploadMarkdownResolvers.reduce( (md, resolver) => resolver(upload) || md, getUploadMarkdown(upload) ); + // Only remove in progress after async resolvers finish: + this.#removeInProgressUpload(file.id); + cacheShortUploadUrl(upload.short_url, upload); + new ComposerVideoThumbnailUppy(getOwner(this)).generateVideoThumbnail( file, upload.url,