kfiroo / react-native-cached-image

CachedImage component for react-native
MIT License
938 stars 470 forks source link

URI for cached images is broken #98

Closed mazing closed 6 years ago

mazing commented 6 years ago

When I first installed and used the packaged yesterday, I didn't experience any problems.

However, today the images are not rendered. They are cached and if I use

<CachedImage
  source={{ uri: item.image }}
  renderImage={props => (
    <Text>{props.source.uri}</Text>
  )}
/>

it does print the uri for the image (i.e., file:///Users/.../Library/Developer/CoreSimulator/Devices/.../data/Containers/Data/Application/.../Library/Caches/imageCacheDir/...), but the image cannot be found.

So I am afraid the cached images are moved, but I don't understand what have caused them to move. I guess it doesn't fail because the cache manager thinks the images are still there although being moved(?)

mazing commented 6 years ago

Everything works again if I clear the cache with

ImageCacheManager().clearCache().then(() => {
  alert('cleared')
})

but the problem arised again next time I reopen the app.

What is causing the images to disappear from the cache?

chrusart commented 6 years ago

Yep, PR #97

chrusart commented 6 years ago

You can close it, resolved in 1.4.2.