uppy/packages/@uppy
Morgan Zolob 24b584ff74
@uppy/aws-s3-multipart: Fix race condition in #uploadParts (#3955)
The `#uploadParts` function calls itself after any part is uploaded. It also
determines which new chunks to upload based on their `state.busy` value. This
introduced a race condition, as `state.busy` was being set to false in the XHR
event handlers. So if one part were to complete while another part had finished
the XHR request, but not yet completed, then an upload for that second part
would be started again, despite the fact that the previous upload was still in
progress. Multiple uploads for the same part at the same time cause numerous
issues, and should never happen.

This is especially noticeable when an XHR request fails. `#uploadPart` is
wrapped in `#retryable`, so the part will be retried, however, for the entire
`retryDelay`, the chunk's `state.busy` value would be false, meaning that if
any other part completed, this part would be uploaded again, despite the fact
that the upload is already ongoing.

To fix this, this commit moves setting `state.busy` to the `before` and `after`
functions of the `#retryable` call, so a part will remain `busy` for the entire
time it is being uploaded/retried.
2022-08-08 12:15:02 +02:00
..
angular Release: uppy@2.11.0 (#3796) 2022-05-30 17:17:28 +01:00
audio fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
aws-s3 Export AwsS3UploadParameters & AwsS3Options interfaces (#3956) 2022-08-08 10:54:35 +02:00
aws-s3-multipart @uppy/aws-s3-multipart: Fix race condition in #uploadParts (#3955) 2022-08-08 12:15:02 +02:00
box fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
companion fix crash if redis disconnects (#3954) 2022-08-05 02:10:19 +07:00
companion-client fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
compressor fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
core core validateRestrictions: return error directly vs the result/reason obj (#3951) 2022-08-08 10:58:43 +01:00
dashboard fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
drag-drop fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
drop-target fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
dropbox fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
facebook fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
file-input fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
form fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
golden-retriever fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
google-drive fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
image-editor fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
informer fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
instagram fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
locales fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
onedrive fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
progress-bar fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
provider-views core validateRestrictions: return error directly vs the result/reason obj (#3951) 2022-08-08 10:58:43 +01:00
react fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
react-native Release: uppy@2.11.0 (#3796) 2022-05-30 17:17:28 +01:00
redux-dev-tools fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
remote-sources fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
robodog fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
screen-capture fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
status-bar fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
store-default fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
store-redux fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
svelte fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
thumbnail-generator fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
transloadit fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
tus fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
unsplash fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
url fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
utils fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
vue fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
webcam fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
xhr-upload fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00
zoom fixup! Merge branch 3.x 2022-08-04 18:03:05 +02:00