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
Describe the bug
When trying to upload a file thats exactly divisible by requestPayloadSize. An additional empty PATCH request will be made that will result in 404.
The cause of it is that in uploadChunk() method you're finishing connection after bytesRemainingForRequest is reaching 0. uploadChunk() doesn't return -1 at this point.
On the server side the file is already "finished" since all bytes are there, but on the device an additional loop has to be made to receive -1 from uploadChunk(). But that additional call results in new connection being opened thats when being finished sends an empty body PATCH that results in 404 from the server, since for the server the upload already finished.
I guess a simple fix for that would be to move the openConnection() inside uploadChunk() a litte bit lower so that its called only if read didnt return -1
To Reproduce
Follow the impl guide.
Try to upload exactly 10MB file without changing any setup in uploader
Expected behavior
No additional call when theres nothing left to upload.
Setup details
Please provide following details, if applicable to your situation:
Any android version
tus-android-client v0.1.9
tus-java-client v0.4.2
The text was updated successfully, but these errors were encountered:
Describe the bug
When trying to upload a file thats exactly divisible by
requestPayloadSize
. An additional empty PATCH request will be made that will result in 404.The cause of it is that in
uploadChunk()
method you're finishing connection afterbytesRemainingForRequest
is reaching0
.uploadChunk()
doesn't return-1
at this point.On the server side the file is already "finished" since all bytes are there, but on the device an additional loop has to be made to receive
-1
fromuploadChunk()
. But that additional call results in new connection being opened thats when being finished sends an empty body PATCH that results in 404 from the server, since for the server the upload already finished.I guess a simple fix for that would be to move the
openConnection()
insideuploadChunk()
a litte bit lower so that its called only ifread
didnt return-1
To Reproduce
Expected behavior
No additional call when theres nothing left to upload.
Setup details
Please provide following details, if applicable to your situation:
The text was updated successfully, but these errors were encountered: