From 8a1080dabeeac3d109299ec90eee70e75a922614 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Wed, 13 Dec 2023 12:13:50 +0100 Subject: [PATCH] fix: uploading the same files parallel Fixes uploading the same files parallel. Uppy is smart enough to not add duplicated files to the upload queue, we just need to early return in that case. --- changelog/unreleased/bugfix-parallel-uploads | 6 ++++++ packages/web-app-files/src/HandleUpload.ts | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/bugfix-parallel-uploads diff --git a/changelog/unreleased/bugfix-parallel-uploads b/changelog/unreleased/bugfix-parallel-uploads new file mode 100644 index 00000000000..3b0c615fe35 --- /dev/null +++ b/changelog/unreleased/bugfix-parallel-uploads @@ -0,0 +1,6 @@ +Bugfix: Uploading the same files parallel + +An issue where uploading the same files parallel would cause the upload to fail has been fixed. + +https://github.com/owncloud/web/pull/10156 +https://github.com/owncloud/web/issues/9220 diff --git a/packages/web-app-files/src/HandleUpload.ts b/packages/web-app-files/src/HandleUpload.ts index b25aa93e813..e239486c5c7 100644 --- a/packages/web-app-files/src/HandleUpload.ts +++ b/packages/web-app-files/src/HandleUpload.ts @@ -370,6 +370,10 @@ export class HandleUpload extends BasePlugin { * Eventually triggers to upload in Uppy. */ async handleUpload(files: UppyFile[]) { + if (!files.length) { + return + } + let filesToUpload = this.prepareFiles(files) // quota check