You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Concurrent upload can start a batch's files before vault encryption and folder creation finish #4263
HandleUpload.handleUpload adds a batch's files to Uppy's state before preparing them, then awaits resolveVaultEngine, applyVaultEncryption and createDirectoryTree. Only after that does it call uppy.upload(). If another upload calls uppy.upload() during that time, Uppy uploads every file in its state, including the files of the batch that is still being prepared. This can happen with or without a conflict dialog.
The upload then starts too early:
Vault: the file is uploaded before it is encrypted, so the cleartext content and name can end up in the vault folder.
Folder uploads: files are uploaded before their parent folders exist, so the upload fails.
#4140 fixes this for the time the conflict dialog is open: the batch's files are held back from Uppy until the dialog is answered. This issue covers the window after that.
Reproduction Steps
Vault
Open a folder inside a vault.
Upload a large file, which makes encryption take a few seconds.
While it is still being encrypted (before its progress shows up), drop a second small file.
Folder upload
Upload a folder with a deep or wide tree, which makes folder creation take a while.
While its folders are still being created, drop a single file into the current folder.
Expected Outcome
A batch's files are uploaded only after their own preparation is done (encrypted for vaults, parent folders created).
Actual Outcome
The second upload's uppy.upload() also uploads the first batch's unprepared files: cleartext into the vault, or into folders that don't exist yet, which fails.
Activity