From 87d6b3299780f86a86d4a4ca77f0746bcd4b44e9 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 8 Jul 2024 21:00:12 +0200 Subject: [PATCH 1/2] make streaming upload default `true` --- docs/companion.md | 6 ++---- packages/@uppy/companion/src/config/companion.js | 2 +- packages/@uppy/companion/src/standalone/helper.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/companion.md b/docs/companion.md index 6ebaea4451..0f6f18d39a 100644 --- a/docs/companion.md +++ b/docs/companion.md @@ -290,7 +290,7 @@ const options = { allowLocalUrls: false, logClientVersion: true, periodicPingUrls: [], - streamingUpload: false, + streamingUpload: true, clientSocketConnectTimeout: 60000, metrics: true, }; @@ -608,9 +608,7 @@ Prometheus metrics (by default metrics are enabled.) A boolean flag to tell Companion whether to enable streaming uploads. If enabled, it will lead to _faster uploads_ because companion will start uploading at the same time as downloading using `stream.pipe`. If `false`, files will be -fully downloaded first, then uploaded. Defaults to `false`, but we recommended -enabling it, especially if you’re expecting to upload large files. In future -versions the default might change to `true`. +fully downloaded first, then uploaded. Defaults to `true`. #### `maxFileSize` `COMPANION_MAX_FILE_SIZE` diff --git a/packages/@uppy/companion/src/config/companion.js b/packages/@uppy/companion/src/config/companion.js index 3acdbd06d8..866cbfb5aa 100644 --- a/packages/@uppy/companion/src/config/companion.js +++ b/packages/@uppy/companion/src/config/companion.js @@ -19,7 +19,7 @@ const defaultOptions = { enableUrlEndpoint: false, allowLocalUrls: false, periodicPingUrls: [], - streamingUpload: false, + streamingUpload: true, clientSocketConnectTimeout: 60000, metrics: true, } diff --git a/packages/@uppy/companion/src/standalone/helper.js b/packages/@uppy/companion/src/standalone/helper.js index 9f85d51be0..cde6b60fbf 100644 --- a/packages/@uppy/companion/src/standalone/helper.js +++ b/packages/@uppy/companion/src/standalone/helper.js @@ -173,7 +173,7 @@ const getConfigFromEnv = () => { allowLocalUrls: process.env.COMPANION_ALLOW_LOCAL_URLS === 'true', // cookieDomain is kind of a hack to support distributed systems. This should be improved but we never got so far. cookieDomain: process.env.COMPANION_COOKIE_DOMAIN, - streamingUpload: process.env.COMPANION_STREAMING_UPLOAD === 'true', + streamingUpload: process.env.COMPANION_STREAMING_UPLOAD ? process.env.COMPANION_STREAMING_UPLOAD === 'true' : undefined, maxFileSize: process.env.COMPANION_MAX_FILE_SIZE ? parseInt(process.env.COMPANION_MAX_FILE_SIZE, 10) : undefined, chunkSize: process.env.COMPANION_CHUNK_SIZE ? parseInt(process.env.COMPANION_CHUNK_SIZE, 10) : undefined, clientSocketConnectTimeout: process.env.COMPANION_CLIENT_SOCKET_CONNECT_TIMEOUT From f75d3f1ef5d1b0216e365ea8e5a924db872b059d Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 8 Jul 2024 21:26:35 +0200 Subject: [PATCH 2/2] add to migration guide --- docs/guides/migration-guides.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/guides/migration-guides.md b/docs/guides/migration-guides.md index c821abf0d4..cca8bf71a7 100644 --- a/docs/guides/migration-guides.md +++ b/docs/guides/migration-guides.md @@ -14,6 +14,8 @@ These cover all the major Uppy versions and how to migrate to them. - The URL endpoint (used by the `Url`/`Link` plugin) is now turned off by default and must be explicitly enabled with `COMPANION_ENABLE_URL_ENDPOINT=true` or `enableUrlEndpoint: true`. +- The option `streamingUpload` / `COMPANION_STREAMING_UPLOAD` now defaults to + `true`. - The option `getKey(req, filename, metadata)` has changed signature to `getKey({ filename, metadata, req })`. - The option `bucket(req, metadata)` has changed signature to