-
Notifications
You must be signed in to change notification settings - Fork 787
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
Download large file with a weak network connection: resolves with status 200 when the file is not fully loaded #336
Comments
I found in old repo someone has the same problem (wkh237#673). File was not completely downloaded. but promise resolves with status 200. So main question: how we can check if file was completely downloaded? |
Here is another same problem in the old repo (wkh237#264) . Seems that this not fixed yet in the new repo. =( |
For now I solved this issue by checking the size of the downloaded file and comparing it to the |
@NelGarbuzova We are about to implement the same approach too. I also think that's the only way. Thanks for posting your solution. 👍 |
I would suggest you keep the issue open, as it is not properly solved. |
Note: if I understand @NelGarbuzova's approach correctly it won't always work. The Java code does not always call the |
Note also that In conclusion; I don't recommend comparing downloaded to total bytes for either platform without fixing the native code. |
Any updates on this issue?
|
I have the similar issue on 0.10.15. On iOS (both simulator and real device) a download promise rejects when device goes to offline. However, there is a different situation on Android: a promise resolves right after a phone goes to offline. I solved the issue as described by @NeliHarbuzava, but with small improvements. I save the amount of bytes on the first
So if the Nevertheless, this issue has taken too much time to identify and it should be reopened definitely. |
Thank you @skoob13, that's exact approach that I was going to implement in order to overcome this issue Perfect @schumannd, thank you, I hope this will solve those issues |
Btw, you can check my solution, that I described in #464 where I retrieve Note:Also I noticed that |
Versions
Problem
I download the file to the device. When the Internet connection is weak or the connection is broken, the file download stops. But instead of an error, RNFetchBlob's promise successfully resolves with 200 status code and has the path to the broken file.
Actual Behavior: RNFetchBlob's promise successfully resolves with 200 status code when file was not fully downloaded
Expected Behavior: If the connection is broken, RNFetchBlob's promise resolves with an error and I can catch the error in the
.catch
block.Code
The text was updated successfully, but these errors were encountered: