Commit graph

91 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
afd4befee2
Google Picker (#5443)
* initial poc

* improvements

- split into two plugins
- implement photos picker
- auto login
- save access token in local storage
- document
- handle photos/files picked and send to companion
- add new hook useStore for making it easier to use localStorage data in react
- add new hook useUppyState for making it easier to use uppy state from react
- add new hook useUppyPluginState for making it easier to plugin state from react
- fix css error

* implement picker in companion

* type todo

* fix ts error

which occurs in dev when js has been built before build:ts gets called

* reuse docs

* imrpve type safety

* simplify async wrapper

* improve doc

* fix lint

* fix build error

* check if token is valid

* fix broken logging code

* pull logic out from react component

* remove docs

* improve auth ui

* fix bug

* remove unused useUppyState

* try to fix build error
2024-12-02 18:34:50 +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
Antoine du Hamel
8b3f1eac01
@uppy/companion: remove oauthOrigin (#5311) 2024-07-09 12:00:51 +02:00
Antoine du Hamel
37ad27d5d1
Merge branch main 2024-07-02 16:15:36 +02:00
Antoine du Hamel
e849827824
@uppy/companion: add oauthOrigin option (#5297)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2024-07-02 15:33:55 +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
087d8f07f0
@uppy/aws-s3: add endpoint option (#5173) 2024-06-13 14:55:12 +02:00
Antoine du Hamel
ae2ffb88cd
Merge stable branch 2024-06-04 17:17:01 +02:00
Mikael Finstad
7060b691d6
@uppy/companion: change COMPANION_ENABLE_URL_ENDPOINT default (#5198) 2024-05-30 17:22:47 +02:00
Merlijn Vos
fe0437aa7d
@uppy/transloadit: remove updateNumberOfFilesInAssembly (#5202) 2024-05-29 14:44:20 +02:00
Dominik Schmidt
4890281404
@uppy/companion: switch from node-redis to ioredis (#4623)
* Switch to ioredis

* run yarn

* semverify ioredis

* fix linting

* try to fix build

* Revert "try to fix build"

This reverts commit 2dd7ecd19c.

* remove semver

probably from borked merge

* fix bug breaking tests

and add some types

* fix probable typo

* doc

---------

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2024-05-13 15:24:19 +02:00
Merlijn Vos
12e7ca5366
@uppy/core: close->destroy, clearUploadedFiles->clear (#5154) 2024-05-08 15:33:04 +02:00
Merlijn Vos
3393b537d3
Upgrade Yarn to 4.x (#4849)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-04-29 18:49:02 +02:00
Merlijn Vos
915a563da9
@uppy/react: remove useUppy & reintroduce useUppyState (#5059) 2024-04-17 12:05:48 +02:00
Antoine du Hamel
f6734feb36
@uppy/aws-s3: remove deprecated prepareUploadParts option (#5075) 2024-04-11 18:19:37 +02:00
Antoine du Hamel
04839fdab6
@uppy/aws-s3: remove legacy plugin (#5070) 2024-04-11 12:10:28 +02:00
Merlijn Vos
c4455ebba7
@uppy/transloadit: remove deprecated options (#5056) 2024-04-03 10:09:39 +02:00
Merlijn Vos
1f8ecd72cb
@uppy/vue: migrate to Composition API with TS & drop Vue 2 support (#5043) 2024-03-28 14:47:06 +01:00
Antoine du Hamel
4f91a0d529
@uppy/angular,meta: upgrade to Angular 17.x and to TS 5.4 (#5008) 2024-03-28 10:10:20 +01: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