@uppy/core: make upload() idempotent #5677
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #5669
Closes #5676
Before
uppy.upload()
but make it fail (set throttling to offline in your browser)uppy.upload()
again but no throttlingYou must call
retryAll()
instead but it's better DX if you can simply callupload()
again and let us figure it out.After
upload()
behaves likeretryAll()
when errors occurred in a backwards compatible way.What if an upload fails and you also add a new file?
Backwards compatible behaviour similar to how it currently works when using the dashboard, first call to
upload()
only retries the failed files. You have to callupload()
again to upload the new files. Makingupload()
do both at once is hard and makes the events a bit unclear, are emitting'upload'
or'retry-all'
?Question
In this case:
upload()
to successfully upload the failed file'completed'
event here contain both files or only the last one? Currently it's the former. Maybe a breaking change if we change it?