Commit graph

56 commits

Author SHA1 Message Date
Mikael Finstad
24fd4158a9
Companion stream upload unknown size files (#5489)
* stream upload unknown size files

behind a new option streamingUploadSizeless
COMPANION_STREAMING_UPLOAD_SIZELESS
for tus

* allow for all upload protocols

seems to be working
closes #5305

* refactor

and fix bug where progress was not always emitted

* fix type

* fix progress throttling

only do it on total progress

* Improve progress in UI

- only show progress percent and total bytes for files that we know the size of. (but all files will still be included in number of files)
- use `null` as an unknown value for progress and ETA, allowing us to remove ETA from UI when unknown
- `percentage` make use of `undefined` when progress is not yet known - don't show percentage in UI when unknown
- add a new state field `progress` that's the same as `totalProgress` but can also be `null`

* fix build error

* format

* fix progress when upload complete

* use execa for companion load balancer

if not, then it leaves zombie companion instances running in the background when e2e stops
have to be manually killed before running e2e again

* update docs and tests for new state.progress

* revert progress/totalProgress

* improve doc

* remove option streamingUploadSizeless

we agreed that this can be considered not a breaking change

* change progress the to "of unknown"

* revert

* remove companion doc

* add e2e test
2024-12-07 10:30:00 +08:00
Mikael Finstad
8f04c32a60
try to fix flaky test (#5512)
fixes #5511
2024-11-12 23:51:24 +08:00
Mikael Finstad
013f4eab2b
@uppy/transloadit: fix issue with allowMultipleUploadBatches (#5400)
* fix issue with allowMultipleUploadBatches

fixes #5397
also refactor from promise.then to async/await
and fix what seems like broken logic with recursive this.#afterUpload call

* throw better error when all files have been canceled

after an assembly has been created
also rewrite #createAssembly to async/await

* wait for updateAssembly when restoring

fixes potential race condition
2024-08-15 20:10:01 +02:00
Antoine du Hamel
473e164e03
meta: fix React linter rules (#5317) 2024-07-09 15:24:20 +02:00
Merlijn Vos
521d90344b
@uppy/transloadit: simplify plugin to always run a single assembly (#5158) 2024-06-21 13:32:57 +02:00
Antoine du Hamel
a42b150639
Merge stable branch 2024-06-18 17:22:02 +02:00
Mikael Finstad
e6674a1eee
@uppy/google-photos: add plugin (#5061) 2024-06-18 11:13:23 +02:00
Antoine du Hamel
ae2ffb88cd
Merge stable branch 2024-06-04 17:17:01 +02:00
Merlijn Vos
fe0437aa7d
@uppy/transloadit: remove updateNumberOfFilesInAssembly (#5202) 2024-05-29 14:44:20 +02:00
Merlijn Vos
12e7ca5366
@uppy/core: close->destroy, clearUploadedFiles->clear (#5154) 2024-05-08 15:33:04 +02:00
Murderlon
b95f8fa47d
Fix flaky e2e test 2024-02-27 12:19:52 +01:00
Mikael Finstad
d5e89fd918
fix e2e flake (#4961)
has been failing 3 times in an hour:
https://github.com/transloadit/uppy/actions/runs/8029895005/job/21936709051
https://github.com/transloadit/uppy/actions/runs/8029682841/job/21936256011
https://github.com/transloadit/uppy/actions/runs/8029645114/job/21936175459

      cy:command ✔  get	.uppy-StatusBar-actionBtn--upload
      cy:command ✔  click
        cy:fetch ➟  (createAssemblies) POST ***/assemblies
                    Status: 200
          cy:xhr ➟  POST https://api2-baarn.transloadit.com/resumable/files/
                    Status: 201
          cy:xhr ➟  POST https://api2-baarn.transloadit.com/resumable/files/
      cy:command ✔  window
      cy:command ✘  assert	expected **1** to equal **0**
2024-02-27 10:24:01 +01:00
Mikael Finstad
ec4bc58508
Provider user sessions (#4619)
New concept "simple auth" - authentication that happens immediately (in one http request) without redirecting to any third party.

uppyAuthToken initially used to simply contain an encrypted & json encoded OAuth2 access_token for a specific provider. Then we added refresh tokens as well inside uppyAuthToken #4448. Now we also allow storing other state or parameters needed for that specific provider, like username, password, host name, webdav URL etc... This is needed for providers like webdav, ftp etc, where the user needs to give some more input data while authenticating

Companion:
- `providerTokens` has been renamed to `providerUserSession` because it now includes not only tokens, but a user's session with a provider.

Companion `Provider` class:
- New `hasSimpleAuth` static boolean property - whether this provider uses simple auth
- uppyAuthToken expiry default 24hr again for providers that don't support refresh tokens
- make uppyAuthToken expiry configurable per provider - new `authStateExpiry` static property (defaults to 24hr)
- new static property `grantDynamicToUserSession`, allows providers to specify which state from Grant `dynamic` to include into the provider's `providerUserSession`.
2023-12-05 22:55:41 +01:00
Antoine du Hamel
773c8cb9a1
meta: add support for TypeScript plugins (#4640) 2023-10-17 15:38:15 +02:00
Artur Paikin
8b252086f5
@uppy/dashboard: auto discover and install plugins without target (#4343)
* Dashboard: auto discover plugins no matter when they were installed

* Remove target from RemoteSoruces, making it compatible with @uppy/react

* Update packages/@uppy/dashboard/src/Dashboard.jsx

Co-authored-by: Mikael Finstad <finstaden@gmail.com>

* Removed comments, added comments

* better comment

* Change type — otherwise gets listed on Dashboard sources

* Add RemoteSources to React test

* Add RemoteSources to React example

* Add tests

* Refactor for less iteration for each plugin, rename functions

* Prevent error when opts are undefined

* remove console.logs

* prettier

---------

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-10-12 23:19:40 +01:00
Antoine du Hamel
34c78e9093
meta: run Prettier on existing files (#4713) 2023-09-29 11:11:28 +02:00
Merlijn Vos
8138b45978
@uppy/aws-s3-multipart: retry signature request (#4691)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-09-28 16:09:02 +02:00
Antoine du Hamel
59e097fabe
e2e: fix race condition in transloadit test (#4616) 2023-08-08 18:01:53 +02:00
Antoine du Hamel
9d49a22a06
e2e: add test for retrying and pausing uploads (#3599) 2023-07-25 15:10:42 +02:00
Antoine du Hamel
ced52515ed
e2e: remove too short timeout (#4602) 2023-07-25 14:54:39 +02:00
Antoine du Hamel
6d969a5132
@uppy/aws-s3-multipart: fix upload retry using an outdated ID (#4544) 2023-07-05 15:53:19 +02:00
Antoine du Hamel
b6a6f83c44
@uppy/aws-s3-multipart: fix pause/resume (#4523)
When pausing the upload, we don't want to remove the cached `uploadId`,
otherwise Uppy needs to re-upload the file from the begininng, even if
it has already uploaded some chunks.
2023-06-27 19:01:53 +02:00
Antoine du Hamel
f07697e7f4
@uppy/companion: fix 500 when file name contains non-ASCII chars (#4493)
* @uppy/companion: fix 500 when file name contains non-ASCII chars

* Update packages/@uppy/companion/src/server/controllers/s3.js

* fixup! @uppy/companion: fix 500 when file name contains non-ASCII chars

* we need a lint rule for this
2023-06-13 22:29:40 +01:00
Artur Paikin
d979f5cf91
@uppy/companion: Use filename from content-disposition instead of relying on url, with fallback (#4489)
* Use filename from content-disposition instead of relying on url, with fallback

* Update packages/@uppy/companion/src/server/helpers/request.js

* Update packages/@uppy/companion/src/server/helpers/request.js

* Add random string to file name coming from basename in case ?param is a differentiator

* Add e2e test for Companion /url/meta file name + mock server with Content-Disposition

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>

* Update e2e/cypress/integration/dashboard-xhr.spec.ts

Co-authored-by: Mikael Finstad <finstaden@gmail.com>

* Update e2e/mock-server.mjs

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>

* Update package.json

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>

* Update e2e/mock-server.mjs

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>

* Update e2e/cypress/integration/dashboard-xhr.spec.ts

Co-authored-by: Mikael Finstad <finstaden@gmail.com>

* Add comment about why randomUUID is added to file name

* yarn

* res vs response

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-06-09 19:22:20 +01:00
Artur Paikin
acf2c8efeb
@uppy/transloadit: Reset tus key in the file on error, so retried files are re-uploaded (#4421)
* Reset `tus` key in the file on error, so retried files are re-uploaded

* add a test

* Use one file, try to set headers

* Pass Upload-Length and Upload-Offset, so tus knows when upload is complete

* test clean up

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-27 12:11:16 +01:00
Antoine du Hamel
0607fd2278
@uppy/aws-s3-multipart: make retries more robust (#4424) 2023-04-25 14:13:53 +02:00
Antoine du Hamel
0a7eceac21
meta: fix all ESLint warnings and turn them into errors (#4398) 2023-04-04 15:54:13 +02:00
Antoine du Hamel
60ae8c197b
@uppy/aws-s3-multipart: refactor rate limiting approach (#4187)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Murderlon <merlijn@soverin.net>
2022-11-09 17:59:11 +01:00
Merlijn Vos
2005b185fb
meta: resolve e2e flakiness (#4077)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-09-13 14:56:34 +02:00
Antoine du Hamel
c658883cbf
@uppy/utils: fix relativePath when drag&dropping a folder (#4043)
Fixes: https://github.com/transloadit/uppy/issues/4041
2022-08-24 16:28:22 +02:00
Antoine du Hamel
51da2b5a79
e2e: add tests for AWS (#3665)
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2022-08-23 18:43:46 +02:00
Mikael Finstad
31a9e0c2fd
Companion: bring back default upload protocol (#3967)
* add (failing) e2e test for remote xhr (multipart)

regression caused by #3834

* Revert "do not use a default upload protocol"

This reverts commit c7e61ddfea.

* add note on todo

* dry code a bit

* explicitly add protocol: 'multipart' in the client

* fix review comment
2022-08-11 17:09:10 +07: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
Antoine du Hamel
003b9518b3 Merge stable branch 2022-08-03 11:54:15 +02:00
Antoine du Hamel
8f722804da
e2e: mark tests as flaky (#3940) 2022-08-02 23:07:55 +02:00
Antoine du Hamel
376e3aa8f7
@uppy/transloadit: send assembly-cancelled only once (#3937) 2022-08-02 18:28:58 +02:00
Antoine du Hamel
e72b7de585
e2e: fix Transloadit test suite with Cypress 10 (#3936) 2022-08-02 13:02:06 +02:00
Antoine du Hamel
2e8f79787b
Merge stable branch 2022-07-27 19:47:25 +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
0c009dc8ff
Add retries for flaky e2e test (#3915)
Retry flaky test
2022-07-27 18:14:11 +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
Antoine du Hamel
2d2ac377e9
e2e: upgrade to Cypress 10 (#3896)
Refs: https://docs.cypress.io/guides/references/migration-guide
2022-07-25 12:01:45 +02: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
Merlijn Vos
7d7c4dd5ad
Add onShouldRetry as option to @uppy/tus (#3720)
- Add `onShouldRetry` as option to @uppy/tus
  - Docs
  - Types
  - E2E test
- Remove bad flaky test

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-17 16:38:50 +02:00
Artur Paikin
02012086d4
Increase retries to trigger longer retryDelay in tus (#3726) 2022-05-14 00:28:50 +01:00
Antoine du Hamel
6498109e53
e2e: fix failing test (#3722) 2022-05-13 11:31:33 +02:00
Merlijn Vos
f40899bc39
Remove it.only from e2e test (#3690) 2022-05-09 10:56:38 +02:00
Merlijn Vos
d42badf995
Support React 18 in @uppy/react (#3680)
* Support React 18
* Remove unit tests
* Create e2e tests

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-04 17:38:08 +02:00
Merlijn Vos
cb0380c5e2 Make Cypress more stable & add e2e test for error events when upload fails (#3662)
* Bump Cypress version
* More compressor test more deterministic
* Add tests for error events when upload fails
* Add missing type in uppy core

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-04 12:05:19 +02:00