* 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
* 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
* respond with 500 if unhandled upload error
400 seems inappropriate
* add todo
* fix companion download error
respond with correct response code when calling /get
and request to the upstream server fail
also add a unit test for this
* forward 429 from provider
allows us to retry it
* rename fn
* add a way to test refresh tokens
* fix race condtiion with refreshing token
* implement retry and fix socket
- Make sure we don't instantiate a new Provider for every file uploaded (reuse the original provider instead) - this caused the refresh token synchronization not to work
- Retry most errors when uploading (`/get`) using companion, but for HTTP, only retry certain HTTP status codes
- Reimplement the websocket code to be more stable and retry as well
* remove unused socket wrapper
* remove useFastRemoteRetry
because it isn't supported in Companion as far as I can tell
* fix error handling
* remove unneeded logic
* apply review suggestion
* retry awaiting for companion socket too
* retry whole operation instead of individually
or else we risk getting stuck retrying just half of the operation, which might never recover
* improvements
- rewrite so we can use p-retry for exponential backoff for socket reconnect too
- improve logging
- simplify/reuse code
* Update packages/@uppy/utils/src/fetchWithNetworkError.js
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Explain requestClient Symbol with comment
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Update packages/@uppy/provider-views/src/View.js
* fixes
preventing socket.send when the socket is not in the connected state
catch errors in handlers
* log if trying to refresh with no token
* log whether we got a refresh token
* dont log retrying when in reality not
* always prompt: consent
for google drive
* add signal to post
* refactor away eventmanager
and event handler error catching
* don't fail with upload-error
if a file is canceled
* fix expect
* add capabilities support
* make requestClient non-enumerable
---------
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* @uppy/transloadit: implement Server-sent event API
* pass events from event stream to JS
* @uppy/transloadit: remove Socket.io
Now that SSE is available, WebSockets do not bring much to the table.
---------
Co-authored-by: Artur Paikin <artur@arturpaikin.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>
* Fix error message being lost when emitted via socket
* Emit global error, set StatusBar to error state when there's an error, show error at the Dashboard top
* Update packages/@uppy/transloadit/src/index.js
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* Refactor onError
* Prevent error ? button from shrinking like a weirdo
---------
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
- `@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