react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

The upload seems to automatically restart for big files after reaching 100% once

Open paulwilson123 opened this issue 6 years ago • 6 comments

When i'm uploading files with a size around 300 MB or grater. The upload reaches 100% and file is successfully posted to API, But instead of showing upload is complete the plugin starts the upload again from 0%. And after 3 attempts it shows upload failed error. And the file is save 3 times also.

paulwilson123 avatar Dec 05 '18 07:12 paulwilson123

This is due to setMaxRetries(2) - so initial try + 2 retries.

@StevePotter @TSMMark is a fix for #124 in the pipeline?

sraka1 avatar Feb 12 '19 10:02 sraka1

@sraka1 Nothing yet, feel free to take a stab

TSMMark avatar Feb 12 '19 14:02 TSMMark

@sraka1 I guess I don't understand why setMaxRetries(2) is the problem. Seems like the real problem is that the file is failing for whatever reason to complete an upload. setMaxRetries(0) would result in only one file, but the uploader still wouldn't complete properly. @paulwilson123 it would be great to know the response code returned from the server. Is there a way you can supply that?

StevePotter avatar Feb 12 '19 15:02 StevePotter

could this be related to a low upload socket timeout?

reime005 avatar Apr 23 '19 09:04 reime005

hello i found solution might help you in node node modules react-native-background-upload/android/src/main/java/.../RnUploader/UploaderMoudule increase connectTimeout var to whatever you want i did that and now timeout error is gone

misag777 avatar Jul 10 '21 12:07 misag777

hello, i am having this problem as well, when upload reached 100% it then start uploading file again

edit: effectively as @misag777 says, there is a timeout, in my case, my endpoint that recieve the upload file internally does another call to a mail provider, this comunication is not fast and then a timeout occurs

arcollector avatar Oct 01 '21 20:10 arcollector