Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should clear upload from state when cancelled #61

Open
coleshaw opened this issue Jun 30, 2020 · 0 comments
Open

Should clear upload from state when cancelled #61

coleshaw opened this issue Jun 30, 2020 · 0 comments

Comments

@coleshaw
Copy link
Collaborator

As reported by @corps:

So, I noticed that if a user starts a download but doesn't complete it, then tries to upload a different file to the same path, the uploading fails because it re-uses the existing Upload model, which may have a next_blob_hash that doesn't match the new file that is replacing it.

Should we change this behavior to more of a create_or_reset_upload? If the upload does exist, update its file_by_position and next_blob* params to defaults.

My hypothesis is that because the directory.uploads state value uses the fileKey to determine uniqueness -- just projectName:fileName, combined with the fact that in upload_actions, cancelUpload only removes uploads that have completed (not cancelled or just paused), the client-side uploader tries to continue an existing upload when the user switches files instead of clearing out the upload and starting over. So it sends the wrong next_blob_hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant