-
Notifications
You must be signed in to change notification settings - Fork 316
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
tus-js-client ignores failed PATCH or POST if HEAD is successful #557
Comments
This is a bit of a tricky topic. From the tus perspective, the upload completed fine because all bytes were transferred and saved, as you correctly noted. As such, tus-js-client considers the upload successful. It does not have knowledge of the potential post-processing happening on the server-side.
I am not sure what you mean exactly here, but I agree that a proper solution must involve the server. Right now, tusd and tus-node-server do not preserve the result from any hooks. Maybe it is time to think about a more proper solution to post-processing than the post-finish and pre-finish hooks. Something which is retried by the tus server and stores a post-processing result (or error) which is then communicated back to the client. What do you think? |
Sharing one approach: In our custom server, automatic finalization is done with the last But like a hook, our finalization can fail after the saving of the bytes, thus leaving This can be solved by detecting this situation in It would definitely good to explicitly point out this hooks failure mode out in |
Problem
When using the
pre-finish
hook from tusd or theonUploadFinish
hook from tus-node-server, which both allow an error to be returned and send to the client, will still result in a successful upload even when failed.Reproduction
tusd
hooks/pre-finish
Result with
@uppy/core
and@uppy/tus
(but the same happens with justtus-js-client
):tus-node-server
Same result.
Solutions
POST
if thecreation-with-upload
extension is used and onPATCH
if HTTP 500 is returned. The subpar thing with this is that it's indistinguishable from other HTTP 500 problems, which do warrant a retry, while a retry on a post-processing issue will likely keep resulting in the same result?The text was updated successfully, but these errors were encountered: