* 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
* 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
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`.
* 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>
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.
* @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
* 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>
* 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>
* 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
`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.
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>
* 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>
- Add `onShouldRetry` as option to @uppy/tus
- Docs
- Types
- E2E test
- Remove bad flaky test
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* 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>