-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add way to reset file progress so that the multipart plugin generates a new Upload Id on next upload attempt #4313
Comments
Would calling uppy.setFileState(file.id, {
progress: {
bytesTotal: 0,
bytesUploaded: 0,
percentage: 0,
postprocess: null,
uploadComplete: false,
uploadStarted: null
}
}) But I wonder how we can fix this properly in Uppy. What post-processor are you using? |
I'm running into an issue and I think it might be related to this. Web Application (Uppy) -> Public API -> tusdotnet Server The first time I upload a file it transfers without any issues. When it finishes successfully, on the server side, the file is moved to a new folder and the rest of the files are deleted. If I try to reupload the same file I'm getting the error: After a bit of digging I found out that on the browser development tools under Application->Local Storage there's a Key/Value pair:
If I delete it I can reupload again. |
Yes, you can set @Acconut I’m thinking the upload probably shouldn’t it fail when a file from the fingerprint is not found? |
The |
I'm using a custom post-processor that extends BasePlugin. I tried out the setFileState suggestion but it didn't help. Also, calling any method that affects more than one specific file, like cancelAll isn't something I can do because I can have more than one file uploading at a time. Having said that, I did try it to see what it would do, and it didn't work - it caused the file to be removed from the dashboard. I'm actually seeing two issues, and they might be related. 1.1) Upload file. |
Yes, you are correct. But in this case, it seems as if the server returns a weird response. Take a look at this error message:
The server responds with a 200, even though the file has been deleted, according to @sophisma. Apparently this response does not include the Upload-Offset value and therefore tus-js-client errors out. Either this is a bug in your API, @sophisma, or in tusdotnet. Make sure that there are not 200 returned for deleted files and then the entries in local storage will be cleaned up by tus-js-client automatically. |
I think this simple change could fix the problem: In s3 multipart uploader, if completeMultipartUpload successfully runs, clear out the cached S3 upload id. There's no reason to keep it anymore. |
@Acconut you were absolutely right, my API had a bug and was returning 200 all the times, instead of returning the tusdotnet status code. After fixing it it's working fine, even without using |
@sophisma Glad to hear that it helped :) |
Seems like the issues were resolved. Closing this :) |
The issue was not resolved. The fingerprint was a separate issue. The problem that this ticket covers is that the S3 upload ID is not cleared from uploader cache after the complete step is successfully executed. See my last comment from 2 weeks ago |
Yes, this was a misunderstanding. @aduh95 will have a look into this, when we’ll be working on the aws-multipart refactor. |
Initial checklist
Problem
Scenario:
Start multipart upload.
All parts successful.
Upload completion successful.
Post-processor plugin is called.
Unexpected network/resource error occurs in post-processor plugin.
Current state of file: completed true, percentage 100%
If the user were to click on the retry button at this time, failure would be certain because the file has an upload Id corresponding to a completed upload. Put another way, the upload id is no longer valid because all parts were uploaded and the completion step was successful.
In a previous version of Uppy, my workaround was this:
In the 'upload-retry' event, I removed the file and re-added the file. This caused the state of the file to reset.
uppy.removeFile(file.id);
uppy.addFile(file);
The multipart uploader would detect that this file had no upload id and it would start the upload process from the very beginning by generating a new Upload via the "/multipart" companion endpoint.
Solution
I need some way to reset the file state, so that the next upload attempt for that specified file, starts from the beginning (new upload id generated).
Alternatives
My previous workaround (might have been version 2.x) of calling the following, in order to completely reset the state of a file's progress, no longer works:
uppy.removeFile(file.id);
uppy.addFile(file);
Fast forward to today, and after updating to version 3.4.0, this workaround no longer works. In the multipart plugin's cache, the completed upload id is still there, so a new one will not be generated. I haven't been successful on figuring out way to clear it so the retry option has a chance of succeeding.
The text was updated successfully, but these errors were encountered: