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
{{ message }}
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.
cache.task=RNFetchBlob.config({ path }).fetch("GET",uri,{});cache.task.catch(error=>{console.log(error);//This below should always return false but doesn't// in a scenario where we do a lot of fetch() and cancel()// for example when scrolling quickly through a feed of image// see: https://hackernoon.com/image-pipeline-with-react-native-listview-b92d4768b17cRNFetchBlob.fs.exists(path).then(result=>console.log(result));});
The text was updated successfully, but these errors were encountered:
@wkh237 Not at the moment but maybe in the near future. I think you can reproduce it by start many requests and canceling them. It looks the writing of the image to disk can be interrupted by cancel(), is that something you can potentially identify on the objectivec code?
By design, if there's either path or fileCache property in config, the response data chunks will be written to the location directly. When canceling the task, the incomplete file will not be removed since some people may use it later (like resume the download by Range Request).
@wkh237 First things first, thank you for this amazing library!
I found a race condition between
config()
andcancel()
which seems fairly easy to reproduce.This race condition leads to broken images such as this one: https://www.dropbox.com/s/euwx03cglbuuu1h/Screenshot%202017-04-15%2010.16.26.png?dl=0 or facebook/react-native#9893.
The text was updated successfully, but these errors were encountered: