From 6198af6b3baa67705c85eafb04f1488e8c122301 Mon Sep 17 00:00:00 2001 From: Stefan Schonert Date: Tue, 4 Jul 2023 08:53:44 +0200 Subject: [PATCH 1/3] Add abort and complete to different queue --- packages/@uppy/aws-s3-multipart/src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/aws-s3-multipart/src/index.js b/packages/@uppy/aws-s3-multipart/src/index.js index 9ce6641a0b..efea19dbe5 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.js +++ b/packages/@uppy/aws-s3-multipart/src/index.js @@ -53,9 +53,10 @@ class HTTPCommunicationQueue { setOptions (options) { const requests = this.#requests + const finalRequests = new RateLimitedQueue(options.limit) if ('abortMultipartUpload' in options) { - this.#abortMultipartUpload = requests.wrapPromiseFunction(options.abortMultipartUpload) + this.#abortMultipartUpload = finalRequests.wrapPromiseFunction(options.abortMultipartUpload) } if ('createMultipartUpload' in options) { this.#createMultipartUpload = requests.wrapPromiseFunction(options.createMultipartUpload, { priority:-1 }) @@ -67,7 +68,7 @@ class HTTPCommunicationQueue { this.#listParts = requests.wrapPromiseFunction(options.listParts) } if ('completeMultipartUpload' in options) { - this.#sendCompletionRequest = requests.wrapPromiseFunction(options.completeMultipartUpload) + this.#sendCompletionRequest = finalRequests.wrapPromiseFunction(options.completeMultipartUpload) } if ('retryDelays' in options) { this.#retryDelayIterator = options.retryDelays?.values() From d9db74e770d051899d451829de40898b7d7ae366 Mon Sep 17 00:00:00 2001 From: Stefan Schonert Date: Thu, 6 Jul 2023 09:45:00 +0200 Subject: [PATCH 2/3] Revert from seperate queue. Use priority instead --- packages/@uppy/aws-s3-multipart/src/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/@uppy/aws-s3-multipart/src/index.js b/packages/@uppy/aws-s3-multipart/src/index.js index efea19dbe5..5f55aa0489 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.js +++ b/packages/@uppy/aws-s3-multipart/src/index.js @@ -53,10 +53,9 @@ class HTTPCommunicationQueue { setOptions (options) { const requests = this.#requests - const finalRequests = new RateLimitedQueue(options.limit) if ('abortMultipartUpload' in options) { - this.#abortMultipartUpload = finalRequests.wrapPromiseFunction(options.abortMultipartUpload) + this.#abortMultipartUpload = requests.wrapPromiseFunction(options.abortMultipartUpload, { priority:Infinity }) } if ('createMultipartUpload' in options) { this.#createMultipartUpload = requests.wrapPromiseFunction(options.createMultipartUpload, { priority:-1 }) @@ -68,7 +67,7 @@ class HTTPCommunicationQueue { this.#listParts = requests.wrapPromiseFunction(options.listParts) } if ('completeMultipartUpload' in options) { - this.#sendCompletionRequest = finalRequests.wrapPromiseFunction(options.completeMultipartUpload) + this.#sendCompletionRequest = requests.wrapPromiseFunction(options.completeMultipartUpload, { priority:Infinity }) } if ('retryDelays' in options) { this.#retryDelayIterator = options.retryDelays?.values() From b5c5246132de89a1901fc69ff728f173614c354d Mon Sep 17 00:00:00 2001 From: Stefan Schonert Date: Thu, 6 Jul 2023 10:49:39 +0200 Subject: [PATCH 3/3] Adjust priority to void conflicting with expiring requests --- packages/@uppy/aws-s3-multipart/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@uppy/aws-s3-multipart/src/index.js b/packages/@uppy/aws-s3-multipart/src/index.js index c8d607f0bc..c49cd99033 100644 --- a/packages/@uppy/aws-s3-multipart/src/index.js +++ b/packages/@uppy/aws-s3-multipart/src/index.js @@ -73,7 +73,7 @@ class HTTPCommunicationQueue { const requests = this.#requests if ('abortMultipartUpload' in options) { - this.#abortMultipartUpload = requests.wrapPromiseFunction(options.abortMultipartUpload, { priority:Infinity }) + this.#abortMultipartUpload = requests.wrapPromiseFunction(options.abortMultipartUpload, { priority:1 }) } if ('createMultipartUpload' in options) { this.#createMultipartUpload = requests.wrapPromiseFunction(options.createMultipartUpload, { priority:-1 }) @@ -85,7 +85,7 @@ class HTTPCommunicationQueue { this.#listParts = requests.wrapPromiseFunction(options.listParts) } if ('completeMultipartUpload' in options) { - this.#sendCompletionRequest = requests.wrapPromiseFunction(options.completeMultipartUpload, { priority:Infinity }) + this.#sendCompletionRequest = requests.wrapPromiseFunction(options.completeMultipartUpload, { priority:1 }) } if ('retryDelays' in options) { this.#retryDelayIterator = options.retryDelays?.values()