-
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
Error out if source provides less data than expected #606
Conversation
Thanks for bringing this up!
I don't think this is the correct approach here. First of all, there are legitimate reasons for sending an empty PATCH request when Upload-Defer-Length is used, for example. So one has to be careful to not disturb this mechanism. Secondly, this would tackle the symptoms, but not the underlying root cause. As mentioned in #556 (comment), the likely cause is that Companion reports a wrong upload size ( In tus-js-client, we can do nothing to solve this situation, I think. As you proposed, we can error out if we detect that |
@Acconut thanks for the response! Just to add some color, this is what we're seeing on our tusd server that prompted this: We tracked the increase of requests to our instance of companion (we're running
Is the only legitimate reason for sending an empty PATCH request when |
I think so, yes. In tus-js-client we can add an error condition if the we notice that the file input ends before |
I think that would be very nice, because then Companion could receive an error and abort the upload instead of hanging forever and flooding the tus server with patch requests. As for how to fix the actual problem, should we always set |
@mifi it kinda sounds like setting |
@mifi @sdhull I just pushed some commits that cause tus-js-client to error out if
The only problem I could see is that not every tus server might support |
@Acconut this looks awesome, thanks! Looks like exactly what we're looking for 😎 |
I just published v3.1.1, which includes this patch. Please try it out and let me know if you find the source of the wrong |
with tus as recommended in tus/tus-js-client#606 because sometimes HEAD reports an incorrect size
use uploadLengthDeferred for streams with tus as recommended in tus/tus-js-client#606 because sometimes HEAD reports an incorrect size
Hopefully I can get some help with this one. We're experiencing Companion sending insane amounts of zero-byte patch requests.
We are guessing that this is due to some files
Content-Length
being over-reported when doingHEAD
request in Companion to get the file size, essentially doing what this test does (setting theoptions.uploadSize
too large).I tried applying the diff from #556 but that does not appear to fix the issue. Would appreciate any help or ideas here. It feels like it should not be "too hard" to simply fail an upload where the next patch would be length=0 but maybe I'm missing something here.