Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove chunkSize backwards compatibility #3830

Merged
merged 1 commit into from Jun 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 2 additions & 9 deletions packages/@uppy/companion/src/server/Uploader.js
Expand Up @@ -636,14 +636,6 @@ class Uploader {
const filename = this.uploadFileName
const { client, options } = this.options.s3

function getPartSize (chunkSize) {
// backwards compatibility https://github.com/transloadit/uppy/pull/3511#issuecomment-1050797935
// requires min 5MiB and max 5GiB partSize
// todo remove this logic in the next major semver
if (chunkSize == null || chunkSize >= 5368709120 || chunkSize <= 5242880) return undefined
return chunkSize
}

const params = {
Bucket: options.bucket,
Key: options.getKey(null, filename, this.options.metadata),
Expand All @@ -656,7 +648,8 @@ class Uploader {
if (options.acl != null) params.ACL = options.acl

const upload = client.upload(params, {
partSize: getPartSize(this.options.chunkSize),
// using chunkSize as partSize too, see https://github.com/transloadit/uppy/pull/3511
partSize: this.options.chunkSize,
})

upload.on('httpUploadProgress', ({ loaded, total }) => {
Expand Down