From e4dbe77d2fd8912beebd695d9d7cf80a3ca924d6 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Fri, 8 Dec 2023 21:49:33 +0800 Subject: [PATCH] don't close socket when pausing because it prevented us from canceling an upload that is paused note that we here sacrifice the ability to pause uploads and have other uploads take over the paused upload's rate limit queue spot. this is sacrificed because we will soon remove the ability to pause/resume uploads anyways --- packages/@uppy/companion-client/src/RequestClient.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/@uppy/companion-client/src/RequestClient.js b/packages/@uppy/companion-client/src/RequestClient.js index c0fae7406..2152e37f1 100644 --- a/packages/@uppy/companion-client/src/RequestClient.js +++ b/packages/@uppy/companion-client/src/RequestClient.js @@ -87,7 +87,7 @@ export default class RequestClient { return stripSlash(companion && companion[host] ? companion[host] : host) } - async headers (emptyBody = false) { + async headers(emptyBody = false) { const defaultHeaders = { Accept: 'application/json', ...(emptyBody ? undefined : { @@ -397,15 +397,6 @@ export default class RequestClient { isPaused = newPausedState if (socket) sendState() - - if (newPausedState) { - // Remove this file from the queue so another file can start in its place. - socketAbortController?.abort?.() // close socket to free up the request for other uploads - } else { - // Resuming an upload should be queued, else you could pause and then - // resume a queued upload to make it skip the queue. - createWebsocket() - } } const onFileRemove = (targetFile) => {