Commit graph

68 commits

Author SHA1 Message Date
Merlijn Vos
fe0437aa7d
@uppy/transloadit: remove updateNumberOfFilesInAssembly (#5202) 2024-05-29 14:44:20 +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
Antoine du Hamel
588bfb515e
meta: prettier 3.0.3 -> 3.2.4 (#4889)
Notable change: https://prettier.io/blog/2023/11/13/curious-ternaries
2024-01-24 11:37: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
Artur Paikin
440b8a9f9a
Revert "@uppy/react: add useUppyState (#4711)" (#4789)
This reverts commit 12e08ada02.
2023-11-12 02:03:55 +01:00
Merlijn Vos
12e08ada02
@uppy/react: add useUppyState (#4711) 2023-10-24 08:58:58 +02: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
933d9dfe74
e2e: upgrade Cypress (#4731) 2023-10-11 12:08:57 +02:00
Antoine du Hamel
f4ea454919
e2e: update Parcel (#4726) 2023-10-05 19:01:25 +02:00
Antoine du Hamel
4b1bc4bcc3
meta: check for formatting in CI (#4714) 2023-09-29 11:33:59 +02:00
Antoine du Hamel
34c78e9093
meta: run Prettier on existing files (#4713) 2023-09-29 11:11:28 +02:00
Antoine du Hamel
2f691acd3f
meta: add Prettier (#4707)
JS files are ignored for now because we want to migrate them to TS
anyway.
MD files are also ignored to minimize the diff.

ESLint is run twice twice on TS files in case it conflicts with Prettier.
2023-09-28 16:47:52 +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
4129174d53
e2e: increase requestTimeout to 16s (#4587)
The default value was 5s, causing a lot of flakiness.
2023-07-19 11:54:22 +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
Mikael Finstad
90f7fb9197
@uppy/core: improve performance of validating & uploading files (#4402)
* show how many files are added when loading

remake of https://github.com/transloadit/uppy/pull/4388

* add french (cherry pick)

* implement concurrent file listing

* refactor / fix lint

* refactor/reduce duplication

* pull out totals validation

don't do it for every file added, as it's very slow
instead do the check at the end when all files are added.
this allows us to easily work with 10k+ files
fixes #4389

* Update packages/@uppy/core/src/Uppy.js

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

* make restricter.validate validate everything

instead make more specific methods for sub-validation
also rename validateTotals to validateAggregateRestrictions

* improve errors and user feedback

- handle errors centrally so that we can limit the amount of toasts (informers) sent to the users (prevent flooding hundreds/thousands of them)
- introduce FileRestrictionError which is a restriction error for a specific file
- introduce isUserFacing field for RestrictionError

* fix performance issue reintroduced

* improvements

- show "%{count} additional restrictions were not fulfilled" for any restriction errors more than 4
- refactor/rename methods
- improve ghost logic/comments

* improve performance when uploading

- introduce new event "upload-start"  that can contain multiple files
- make a new patchFilesState method to allow updating more files
- unify "upload-start" logic in all plugins (send it before files start uploading)
- defer slicing buffer until we need the data
- refactor to reuse code

* fix e2e build issue

* try to upgrade cypress

maybe it fixes the error

* Revert "fix e2e build issue"

This reverts commit ff3e580c0f.

* upgrade parcel

* move mutation logic to end

* remove FileRestrictionError

merge it with RestrictionError

* fix silly bug

looks like the e2e tests are doing its job 👏

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-15 23:50:19 +08:00
Antoine du Hamel
0a7eceac21
meta: fix all ESLint warnings and turn them into errors (#4398) 2023-04-04 15:54:13 +02:00
Mikael Finstad
e966fa7540
meta: use load balancer for companion in e2e tests (#4228) 2023-02-02 11:25:50 +01:00
Youssef Victor
83ac000c31
Fix indentation in generate-test.mjs (#4181) 2023-01-02 11:00:46 +01: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
f7d0d5b3cd
meta: upgrade to TypeScript 4.8 (#4048) 2022-08-30 11:46:45 +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
Antoine du Hamel
5044230bf1
meta: upgrade all dev dependencies (#3903) 2022-08-16 22:39:28 +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
b345763710
Setup Cypress Dashboard (#3691) 2022-05-23 18:05:39 +02:00
Antoine du Hamel
456c2b7422
@uppy/core: refactor to ESM (#3744) 2022-05-20 11:04:09 +02:00