-
Notifications
You must be signed in to change notification settings - Fork 1.6k
How to catch something when downloading is interruppted? #264
Comments
@liuxiaoy , thanks fro reporting this issue. Does it happen on both Android and IOS ? |
@wkh237 Sorry! I have only try it on android. |
@liuxiaoy , I've setup some tests on this issue but unfortunately still not be able to replicate the problem you addressed. The behavior was just as expected, |
@wkh237
} If the downloading task was canceled or interrupered,it will run to " throw new IOException("Content-Length and stream length disagree");" on step2. But the Exception ignored is ignored on step1. At last it seems like the task success in javascript. |
"react-native-fetch-blob": "^0.10.0", |
Okay, I can replicate it now, this only happens when interrupting a request which downloads data to storage, will look into this issue. |
@wkh237 It seems like we have used the same code. But it will catch error when the task is canceled or interruptered.Now I resolve it as follows. |
I am install 0.10.3-fix-264, but i can not found the code change? |
The changes are in com.RNFetchBlob.RNFetchBlobReq.java |
@wkh237 I've installed both 0.10.4 & 0.10.3-fix-264 (RN 0.42.0) and the problem is still happening. That is if the network connection drops out on Android it returns with status 200 and would behave exactly like it was successful mimicking @liuxiaoy problems. This is not an issue on iOS and it behaves as you would expect, an error being thrown when the network connection is lost. Nevertheless, thanks for the awesome project! |
@Compulsed , thanks for the information, will keep working on this issue 👍 |
@wkh237 Thanks! Keep up the good work! 👍 |
We're also seeing this issue. Workaround: comparing the content-length and file on disk manually. |
@wkh237 Has there been any update on this? We are also having the issue on Android where if you download a file and drop network connection midway through, it returns with the same status as if the download was successful. This doesn't happen on iOS, where we get a message:
Many thanks 👍 |
when the downloading task is interruppted or canceled,it will run to " callback(null, response.path());" always.
The text was updated successfully, but these errors were encountered: