Commit graph

2153 commits

Author SHA1 Message Date
Morgan Zolob
24b584ff74
@uppy/aws-s3-multipart: Fix race condition in #uploadParts (#3955)
The `#uploadParts` function calls itself after any part is uploaded. It also
determines which new chunks to upload based on their `state.busy` value. This
introduced a race condition, as `state.busy` was being set to false in the XHR
event handlers. So if one part were to complete while another part had finished
the XHR request, but not yet completed, then an upload for that second part
would be started again, despite the fact that the previous upload was still in
progress. Multiple uploads for the same part at the same time cause numerous
issues, and should never happen.

This is especially noticeable when an XHR request fails. `#uploadPart` is
wrapped in `#retryable`, so the part will be retried, however, for the entire
`retryDelay`, the chunk's `state.busy` value would be false, meaning that if
any other part completed, this part would be uploaded again, despite the fact
that the upload is already ongoing.

To fix this, this commit moves setting `state.busy` to the `before` and `after`
functions of the `#retryable` call, so a part will remain `busy` for the entire
time it is being uploaded/retried.
2022-08-08 12:15:02 +02:00
Artur Paikin
346c2fcd43
core validateRestrictions: return error directly vs the result/reason obj (#3951)
* core validateRestrictions: return error directly vs the result/reason obj

* Refacrtor to actually use restrictionError instead of {reason, message}

* Return error instead of throwing
2022-08-08 10:58:43 +01:00
Antonina Vertsinskaya
a5c73c3210
Export AwsS3UploadParameters & AwsS3Options interfaces (#3956) 2022-08-08 10:54:35 +02:00
Mikael Finstad
88b08e3843
fix crash if redis disconnects (#3954)
https://github.com/redis/node-redis/issues/2032
2022-08-05 02:10:19 +07:00
Antoine du Hamel
5b491f7fe4
@uppy/companion: upgrade ws version (#3949) 2022-08-04 18:26:11 +02:00
Mikael Finstad
3c08f745b1
@uppy/companion: sort Dropbox response & refactor to async/await (#3897)
Fixes https://github.com/transloadit/uppy/issues/3580
2022-08-04 18:17:29 +02:00
Antoine du Hamel
7089cb6530
fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
Antoine du Hamel
4996f44cf9
Merge branch 3.x 2022-08-04 17:40:50 +02:00
Antoine du Hamel
65f2551645
@uppy/utils: modernize getDroppedFiles (#3534)
`webkitGetAsEntry` is a non-standard/deprecated API, replacing it with
`getAsFileSystemHandle` when available.
This also work around a Chromium bug with symlinks.

Fixes: https://github.com/transloadit/uppy/issues/3505.
2022-08-04 16:21:23 +02:00
Mikael Finstad
1a3276431f
@uppy/companion: fix default getKey for non-standalone too (#3945)
And update docs.
2022-08-04 16:09:53 +02:00
Antoine du Hamel
96252e5bc5
@uppy/aws-s3-multipart: ignore exception inside abortMultipartUpload (#3950)
The docs say "Cancellation cannot fail in Uppy, so the result of this
function is ignored". So let's ignore it indeed.
2022-08-04 16:09:13 +02:00
Antoine du Hamel
3fed45a749
@uppy/companion: remove isobject from dependencies (#3948) 2022-08-04 16:07:57 +02:00
Artur Paikin
0d482ccc0f
Fix Compressor being broken when no name is in the compressed blob (#3947)
* Fix Compressor being broken when no name is in the compressed blob

* Update packages/@uppy/compressor/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-08-04 13:23:29 +01:00
Merlijn Vos
9a213b59da
Fix all breaking todo comments for 3.0 (#3907)
- `@uppy/aws/s3-multipart`: remove `client` getter and setter.
  - reason: internal usage only
  - migrate: use exposed options only
- `@uppy/core`: remove `AggregateError` polyfill
  - reason: [should be polyfilled by the user](https://github.com/transloadit/uppy/pull/3532#discussion_r818602636)
  - migrate: install `AggregateError` polyfill or use `core-js`
- `@uppy/core`: remove `reset()` method
  - reason: it's a duplicate of `cancelAll`, but with a less intention revealing name
  - migrate: use `cancelAll`
- `@uppy/core`: remove backwards compatible exports (static properties on `Uppy`)
  - reason: transition to ESM
  - migrate: import the `Uppy` class by default and/or use named exports for everything else.
- `@uppy/react`: don't expose `validProps`
  - reason: internal only
  - migrate: do not depend on this
- `@uppy/store-redux`: remove backwards compatible exports (static properties on `ReduxStore`)
  - reason: transition to ESM
  - migrate: use named imports
- `@uppy/thumbnail-generator`: remove `rotateImage`, `protect`, and `canvasToBlob` from prototype.
  - reason: internal only
  - migrate: don't depend on this
2022-08-03 20:07:24 +02:00
Antoine du Hamel
80f622fb62
@uppy/companion: show deprecation message when using legacy s3 options (#3944) 2022-08-03 16:53:58 +02:00
github-actions[bot]
2b87253f79
Release: uppy@3.0.0-beta.4 (#3943)
| Package                |      Version | Package                |      Version |
| ---------------------- | ------------ | ---------------------- | ------------ |
| @uppy/aws-s3-multipart | 3.0.0-beta.3 | @uppy/screen-capture   | 3.0.0-beta.2 |
| @uppy/companion        | 4.0.0-beta.3 | @uppy/status-bar       | 3.0.0-beta.2 |
| @uppy/core             | 3.0.0-beta.3 | @uppy/store-default    | 3.0.0-beta.2 |
| @uppy/dashboard        | 3.0.0-beta.3 | @uppy/transloadit      | 3.0.0-beta.4 |
| @uppy/drop-target      | 2.0.0-beta.2 | @uppy/tus              | 3.0.0-beta.2 |
| @uppy/informer         | 3.0.0-beta.2 | @uppy/url              | 3.0.0-beta.2 |
| @uppy/react            | 3.0.0-beta.3 | @uppy/robodog          | 3.0.0-beta.4 |
| @uppy/remote-sources   | 1.0.0-beta.3 | uppy                   | 3.0.0-beta.4 |

- @uppy/companion,@uppy/tus: Upgrade tus-js-client to 3.0.0 (Merlijn Vos / #3942)
- meta: fix release script (Antoine du Hamel)
- @uppy/aws-s3-multipart: Correctly handle errors for `prepareUploadParts` (Merlijn Vos / #3912)
- @uppy/store-default: export the class, don't expose `.callbacks` (Antoine du Hamel / #3928)
- @uppy/remote-sources: do not rely on `.name` property (Antoine du Hamel / #3941)
- @uppy/screen-capture: fix TODOs (Antoine du Hamel / #3930)
- @uppy/status-bar: rename internal modules (Antoine du Hamel / #3929)
- @uppy/transloadit: remove static properties in favor of exports (Antoine du Hamel / #3927)
- @uppy/informer: simplify `render` method (Antoine du Hamel / #3931)
- @uppy/url: remove private methods from public API (Antoine du Hamel / #3934)
- @uppy/dashboard: change `copyToClipboard` signature (Antoine du Hamel / #3933)
- @uppy/drop-target: remove `isFileTransfer` from the public API (Antoine du Hamel / #3932)
- meta: improve beta release script (Antoine du Hamel)




| Package           | Version | Package           | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/transloadit |   2.3.6 | @uppy/robodog     |   2.9.2 |
| @uppy/tus         |   2.4.2 | uppy              |  2.13.2 |

- @uppy/transloadit: send `assembly-cancelled` only once (Antoine du Hamel / #3937)
- meta: `keepNames` in bundle (Antoine du Hamel / #3926)
- meta: e2e: fix Transloadit test suite with Cypress 10 (Antoine du Hamel / #3936)
- meta: Bump guzzlehttp/guzzle from 7.4.1 to 7.4.5 in /examples/aws-presigned-url (dependabot[bot] / #3842)
- @uppy/tus: fix dependencies (Antoine du Hamel / #3923)
- meta: doc: fix linter failure in `image-editor.md` (Antoine du Hamel / #3924)
- meta: doc: Fix typo in image-editor.md (Ikko Ashimine / #3921)
- website: Docs and header fix (Artur Paikin / #3920)
2022-08-03 10:06:32 +00:00
Antoine du Hamel
003b9518b3 Merge stable branch 2022-08-03 11:54:15 +02:00
Merlijn Vos
9d03e9f927
Upgrade tus-js-client to 3.0.0 (#3942) 2022-08-03 11:50:22 +02:00
Merlijn Vos
2785885335
Correctly handle errors for prepareUploadParts (#3912)
- Rename `#prepareUploadParts` to `#prepareUploadPartsRetryable`
- Call `this.#onError` instead of `return` to correctly handle error
- Add a test for it
2022-08-03 11:26:27 +02:00
Antoine du Hamel
6f3380b056
@uppy/store-default: export the class, don't expose .callbacks (#3928) 2022-08-03 11:19:09 +02:00
Antoine du Hamel
ed86eef0eb
@uppy/remote-sources: do not rely on .name property (#3941)
Minifiers may be tempted to overwrite the `.name` property of the
plugin classes to save some bytes.
2022-08-03 11:18:47 +02:00
Antoine du Hamel
5fca61733d
fixup! @uppy/informer: simplify render method (#3931) 2022-08-03 11:00:24 +02:00
github-actions[bot]
55581bcf77
Release: uppy@2.13.2 (#3939)
| Package           | Version | Package           | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/transloadit |   2.3.6 | @uppy/robodog     |   2.9.2 |
| @uppy/tus         |   2.4.2 | uppy              |  2.13.2 |

- @uppy/transloadit: send `assembly-cancelled` only once (Antoine du Hamel / #3937)
- meta: `keepNames` in bundle (Antoine du Hamel / #3926)
- meta: e2e: fix Transloadit test suite with Cypress 10 (Antoine du Hamel / #3936)
- meta: Bump guzzlehttp/guzzle from 7.4.1 to 7.4.5 in /examples/aws-presigned-url (dependabot[bot] / #3842)
- @uppy/tus: fix dependencies (Antoine du Hamel / #3923)
- meta: doc: fix linter failure in `image-editor.md` (Antoine du Hamel / #3924)
- meta: doc: Fix typo in image-editor.md (Ikko Ashimine / #3921)
- @uppy/robodog: Fix Robodog CDN url in readme.md (Artur Paikin / #3922)
- website: Docs and header fix (Artur Paikin / #3920)
2022-08-02 18:00:48 +01:00
Antoine du Hamel
376e3aa8f7
@uppy/transloadit: send assembly-cancelled only once (#3937) 2022-08-02 18:28:58 +02:00
Antoine du Hamel
386d72d9f4
@uppy/screen-capture: fix TODOs (#3930)
- rename `RecorderScreen` class file to match with the class name.
- rename `Stopwatch` -> `StopWatch` (PascalCase convention).
2022-08-02 14:54:37 +02:00
Antoine du Hamel
dc7ad4b916
@uppy/status-bar: rename internal modules (#3929)
* rename `StatusBar` -> `StatusBarUI`

* rename `_StatusBar.jsx` -> `StatusBar.jsx`
2022-08-02 14:53:49 +02:00
Antoine du Hamel
a38ae901ed
@uppy/transloadit: remove static properties in favor of exports (#3927) 2022-08-02 13:17:57 +02:00
Antoine du Hamel
38089a2102
@uppy/informer: simplify render method (#3931) 2022-08-02 13:02:33 +02:00
Antoine du Hamel
c477bff46d
@uppy/url: remove private methods from public API (#3934) 2022-08-02 12:59:23 +02:00
Antoine du Hamel
9190ed5f43
@uppy/dashboard: change copyToClipboard signature (#3933) 2022-08-01 17:58:42 +02:00
Antoine du Hamel
5271d27c18
@uppy/drop-target: remove isFileTransfer from the public API (#3932) 2022-08-01 17:57:44 +02:00
Antoine du Hamel
f5d5e8bb09
@uppy/tus: fix dependencies (#3923)
`@jest/globals` should be in the `devDependencies` list, not in the
`peerDependencies`.

Refs: https://community.transloadit.com/t/why-is-jest-globals-a-peer-dependency-of-every-uppy-package/16182/1
2022-07-31 14:50:19 +01:00
Artur Paikin
c1a09fe204
Fix Robodog CDN url in readme.md (#3922) 2022-07-29 14:34:34 +01:00
github-actions[bot]
0dcf869828
Release: uppy@3.0.0-beta.3 (#3918)
| Package                |      Version | Package                |      Version |
| ---------------------- | ------------ | ---------------------- | ------------ |
| @uppy/aws-s3           | 3.0.0-beta.2 | @uppy/react            | 3.0.0-beta.2 |
| @uppy/aws-s3-multipart | 3.0.0-beta.2 | @uppy/remote-sources   | 1.0.0-beta.2 |
| @uppy/companion        | 4.0.0-beta.2 | @uppy/store-redux      | 3.0.0-beta.2 |
| @uppy/compressor       | 1.0.0-beta.2 | @uppy/transloadit      | 3.0.0-beta.3 |
| @uppy/core             | 3.0.0-beta.2 | @uppy/webcam           | 3.0.0-beta.2 |
| @uppy/dashboard        | 3.0.0-beta.2 | @uppy/xhr-upload       | 3.0.0-beta.2 |
| @uppy/image-editor     | 2.0.0-beta.2 | @uppy/robodog          | 3.0.0-beta.3 |
| @uppy/locales          | 3.0.0-beta.3 | uppy                   | 3.0.0-beta.3 |

- @uppy/react: Fix exports in propTypes.js to fix website build (Murderlon)
- @uppy/dashboard,@uppy/webcam: Add support for `mobileNativeCamera` option to Webcam and Dashboard (Artur Paikin / #3844)
- @uppy/aws-s3-multipart: make `headers` part indexed too in `prepareUploadParts` (Merlijn Vos / #3895)
- @uppy/aws-s3,@uppy/core,@uppy/dashboard,@uppy/store-redux,@uppy/xhr-upload: upgrade `nanoid` to v4 (Antoine du Hamel / #3904)
- @uppy/companion: update minimal supported Node.js version in the docs (Antoine du Hamel / #3902)
- @uppy/companion: upgrade `redis` to version 4.x (Antoine du Hamel / #3589)
- @uppy/companion: remove unnecessary ts-ignores (Mikael Finstad / #3900)
- meta: use `node:` protocol when using Node.js built-in core modules (Antoine du Hamel / #3871)
- meta: upgrade to Vite v3 (Antoine du Hamel / #3882)
- @uppy/companion: remove `COMPANION_S3_GETKEY_SAFE_BEHAVIOR` env variable (Antoine du Hamel / #3869)
- meta: fix release script for major beta versions (Antoine du Hamel)
2022-07-27 19:03:19 +01:00
Antoine du Hamel
2e8f79787b
Merge stable branch 2022-07-27 19:47:25 +02:00
github-actions[bot]
61b60592b0
Release: uppy@2.13.1 (#3916)
| Package              | Version | Package              | Version |
| -------------------- | ------- | -------------------- | ------- |
| @uppy/companion      |   3.7.1 | @uppy/remote-sources |   0.1.1 |
| @uppy/compressor     |   0.3.1 | @uppy/transloadit    |   2.3.5 |
| @uppy/core           |   2.3.2 | @uppy/robodog        |   2.9.1 |
| @uppy/dashboard      |   2.4.1 | uppy                 |  2.13.1 |
| @uppy/image-editor   |   1.4.1 |                      |         |

- @uppy/compressor: fix upload causing meta name to reset (Justin / #3890)
- @uppy/transloadit: cancel assemblies when all its files have been removed (Antoine du Hamel / #3893)
- e2e: Add retries for flaky e2e test (Merlijn Vos / #3915)
- @uppy/dashboard,@uppy/image-editor,@uppy/remote-sources: Fix `uppy.close()` crashes when remote-sources or image-editor is installed (Merlijn Vos / #3914)
- @uppy/core: Add missing type for retry-all event (Luc Boissaye / #3901)
- @uppy/companion: Companion app type (Mikael Finstad / #3899)
- e2e: upgrade to Cypress 10 (Antoine du Hamel / #3896)
- meta: Fix website build (Murderlon)
- meta: Create new issue templates (Merlijn Vos / #3879)
2022-07-27 17:33:08 +01:00
Murderlon
d31cae30aa
Fix exports in propTypes.js to fix website build 2022-07-27 18:32:28 +02:00
Justin
2b435bdc51
@uppy/compressor: fix upload causing meta name to reset (#3890)
Fix @uppy/compressor resetting meta name
2022-07-27 18:19:36 +02:00
Antoine du Hamel
f808e9d741
@uppy/transloadit: cancel assemblies when all its files have been removed (#3893)
When starting an upload and removing it right away, it creates a race
condition when the assembly is created with no files and is never
closed. This commit ensures that the assembly is closed if all files
have been removed, or updated with the new expected number of
files otherwise.

Co-authored-by: Aaron Heimlich <aaron.heimlich@gmail.com>
2022-07-27 18:17:48 +02:00
Merlijn Vos
f1a7e0c909
Fix uppy.close() crashes when remote-sources or image-editor is installed (#3914) 2022-07-27 17:22:22 +02:00
Artur Paikin
a7a4bd0ef0
webcam: Add support for mobileNativeCamera option to Webcam and Dashboard (#3844)
* Add support for mobileNativeCamera option to Webcam and Dashboard

* update types

* missing comma

* Set mobileNativeCamera to isMobile() by default

* Update website/src/docs/webcam.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Update packages/@uppy/dashboard/src/components/AddFiles.jsx

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Respect modes like video-only and picture when rendering mobile camera btns

* Update packages/@uppy/webcam/src/Webcam.jsx

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Use includes

* Update locale

* Add tablet support

* Update website/src/docs/webcam.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-27 10:52:19 +01:00
Merlijn Vos
9733e5a064
aws-s3-multipart: make headers part indexed too in prepareUploadParts (#3895)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-26 13:10:31 +02:00
Antoine du Hamel
c8384530fa
upgrade nanoid to v4 (#3904)
`nanoid` recently released a new ESM-only version.
2022-07-26 11:57:30 +02:00
Luc Boissaye
7f5059b784
Add missing type for retry-all event (#3901) 2022-07-25 15:36:43 +02:00
Antoine du Hamel
aee4d3f371
@uppy/companion: upgrade redis to version 4.x (#3589)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-07-25 15:14:13 +02:00
Mikael Finstad
c28ec8d413
remove unnecessary ts-ignores (#3900) 2022-07-25 19:20:23 +07:00
Mikael Finstad
710c0253b2
Companion app type (#3899)
* fix companion app type

fixes #3862

* remove unnecessary ts-ignores

* Revert "remove unnecessary ts-ignores"

This reverts commit 76ee67dc94.
2022-07-25 18:52:48 +07:00
Antoine du Hamel
7b0db7d3a0
meta: use node: protocol when using Node.js built-in core modules (#3871)
`node:` protocol is available as of Node.js 14.18.0 LTS. Since we are
dropping support for all Node.js versions below that, we can take
advantage of this prefix to help differentiate built-in modules from npm
modules.
2022-07-18 14:09:03 +02:00
github-actions[bot]
236d92898c
Release: uppy@2.13.0 (#3889)
| Package            | Version | Package            | Version |
| ------------------ | ------- | ------------------ | ------- |
| @uppy/dashboard    |   2.4.0 | @uppy/robodog      |   2.9.0 |
| @uppy/image-editor |   1.4.0 | uppy               |  2.13.0 |
| @uppy/transloadit  |   2.3.4 |                    |         |

- @uppy/transloadit: fix outdated file ids and incorrect usage of files (Merlijn Vos / #3886)
- @uppy/image-editor: remove beta notice (Merlijn Vos / #3877)
- meta: Fix broken links in _posts/2019-08-1.3.md (YukeshShr / #3884)
- meta: Fix broken link in _posts/2017-03-0.15.md (YukeshShr / #3883)
- @uppy/image-editor: Add image editor cancel event (James R T / #3875)
2022-07-18 12:59:08 +01:00
Merlijn Vos
43fb673372
@uppy/transloadit: fix outdated file ids and incorrect usage of files (#3886)
* Fix outdated file ids and incorrect usage of files

* add e2e test

* Update packages/@uppy/transloadit/src/index.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2022-07-15 00:25:57 +01:00