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

@uppy/aws-s3: default to multipart depending on the size of input #5076

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Apr 11, 2024

No description provided.

@aduh95 aduh95 added the 4.0 For the 4.0 major version label Apr 11, 2024
Copy link
Contributor

github-actions bot commented Apr 11, 2024

Diff output files
diff --git a/packages/@uppy/aws-s3/lib/index.js b/packages/@uppy/aws-s3/lib/index.js
index 0ca0ff1..114df8a 100644
--- a/packages/@uppy/aws-s3/lib/index.js
+++ b/packages/@uppy/aws-s3/lib/index.js
@@ -61,7 +61,7 @@ const defaultOptions = {
   allowedMetaFields: true,
   limit: 6,
   getTemporarySecurityCredentials: false,
-  shouldUseMultipart: file => file.size !== 0,
+  shouldUseMultipart: file => file.size >> 10 >> 10 > 100,
   retryDelays: [0, 1000, 3000, 5000],
   companionHeaders: {},
 };
@@ -206,7 +206,6 @@ export default class AwsS3Multipart extends BasePlugin {
     });
     this.type = "uploader";
     this.id = this.opts.id || "AwsS3Multipart";
-    this.title = "AWS S3 Multipart";
     _classPrivateFieldLooseBase(this, _client)[_client] = new RequestClient(uppy, opts);
     const dynamicDefaultOptions = {
       createMultipartUpload: this.createMultipartUpload,

@aduh95 aduh95 merged commit 24a306f into 4.x Apr 11, 2024
16 checks passed
@aduh95 aduh95 deleted the aws-default-maybe-multipart branch April 11, 2024 16:44
github-actions bot added a commit that referenced this pull request Apr 11, 2024
| Package                   |      Version | Package                   |      Version |
| ------------------------- | ------------ | ------------------------- | ------------ |
| @uppy/angular             | 0.7.0-beta.2 | @uppy/instagram           | 4.0.0-beta.2 |
| @uppy/audio               | 2.0.0-beta.2 | @uppy/onedrive            | 4.0.0-beta.2 |
| @uppy/aws-s3              | 4.0.0-beta.2 | @uppy/progress-bar        | 4.0.0-beta.2 |
| @uppy/aws-s3-multipart    | 4.0.0-beta.2 | @uppy/provider-views      | 4.0.0-beta.2 |
| @uppy/box                 | 3.0.0-beta.2 | @uppy/react               | 4.0.0-beta.2 |
| @uppy/companion           | 5.0.0-beta.2 | @uppy/remote-sources      | 2.0.0-beta.2 |
| @uppy/companion-client    | 4.0.0-beta.2 | @uppy/screen-capture      | 4.0.0-beta.2 |
| @uppy/compressor          | 2.0.0-beta.2 | @uppy/status-bar          | 4.0.0-beta.2 |
| @uppy/core                | 4.0.0-beta.2 | @uppy/thumbnail-generator | 4.0.0-beta.2 |
| @uppy/dashboard           | 4.0.0-beta.2 | @uppy/transloadit         | 4.0.0-beta.2 |
| @uppy/drag-drop           | 4.0.0-beta.2 | @uppy/tus                 | 4.0.0-beta.2 |
| @uppy/drop-target         | 3.0.0-beta.2 | @uppy/unsplash            | 4.0.0-beta.2 |
| @uppy/dropbox             | 4.0.0-beta.2 | @uppy/url                 | 4.0.0-beta.2 |
| @uppy/facebook            | 4.0.0-beta.2 | @uppy/utils               | 6.0.0-beta.2 |
| @uppy/file-input          | 4.0.0-beta.2 | @uppy/webcam              | 4.0.0-beta.2 |
| @uppy/golden-retriever    | 4.0.0-beta.2 | @uppy/zoom                | 3.0.0-beta.2 |
| @uppy/google-drive        | 4.0.0-beta.2 | uppy                      | 4.0.0-beta.2 |

- @uppy/aws-s3: default to multipart depending on the size of input (Antoine du Hamel / #5076)
- @uppy/aws-s3: remove deprecated `prepareUploadParts` option (Antoine du Hamel / #5075)
- @uppy/core: use variadic arguments for `uppy.use` (Antoine du Hamel / #4888)
- @uppy/aws-s3: remove legacy plugin (Antoine du Hamel / #5070)
- @uppy/locales: do not build `dist/` folder (Merlijn Vos / #5055)
- @uppy/angular: fix Angular version requirement in peerDeps (Antoine du Hamel / #5067)
- @uppy/transloadit: remove deprecated options (Merlijn Vos / #5056)




| Package          | Version | Package          | Version |
| ---------------- | ------- | ---------------- | ------- |
| @uppy/companion  |  4.13.1 | uppy             |  3.24.1 |
| @uppy/file-input |   3.1.1 |                  |         |

- @uppy/companion: upgrade redis (Mikael Finstad / #5065)
- meta: fix `watch:*` scripts (Antoine du Hamel / #5046)
- meta: include more packages in `compare_diff` CI (Antoine du Hamel / #5044)
- @uppy/file-input: add missing export (Antoine du Hamel / #5045)
- meta: Bump express from 4.18.1 to 4.19.2 in /packages/@uppy/companion (dependabot[bot] / #5036)
- @uppy/companion: Bump express from 4.18.1 to 4.19.2 (dependabot[bot] / #5037)
// shouldUseMultipart: (file) => file.size >> 10 >> 10 > 100,
shouldUseMultipart: ((file: UppyFile<any, any>) =>
// eslint-disable-next-line no-bitwise
(file.size! >> 10) >> 10 > 100) as any as true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit too clever for my taste.

I think this is more clear file.size > 100 * 1024 * 1024

Murderlon added a commit that referenced this pull request Apr 17, 2024
* 4.x: (34 commits)
  Release: uppy@3.24.3 (#5091)
  docs: add back markdown files (#5064)
  meta: fix custom provider example (#5079)
  @uppy/utils: add fetcher (#5073)
  Fix prettier
  @uppy/dashboard: add missing `x-zip-compress` archive type (#5081)
  Bump docker/metadata-action from 4 to 5 (#5086)
  Bump actions/setup-node from 3 to 4 (#5087)
  Bump docker/setup-qemu-action from 2 to 3 (#5089)
  meta: bump supercharge/redis-github-action from 1.4.0 to 1.8.0 (#5090)
  meta: bump actions/cache from 3 to 4 (#5088)
  Release: uppy@4.0.0-beta.3 (#5085)
  meta: add `dependabot.yml` to keep GHA up-to-date (#5083)
  Release: uppy@3.24.2 (#5084)
  @uppy/core: fix `setOptions` not re-rendereing plugin UI (#5082)
  Release: uppy@4.0.0-beta.2 (#5077)
  @uppy/aws-s3: default to multipart depending on the size of input (#5076)
  @uppy/aws-s3: remove deprecated `prepareUploadParts` option (#5075)
  fixup! @uppy/core: use variadic arguments for `uppy.use` (#4888)
  @uppy/core: use variadic arguments for `uppy.use` (#4888)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 For the 4.0 major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants