kfiroo / react-native-cached-image

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

Different app container AppId issue ? #94

Closed edi closed 6 years ago

edi commented 6 years ago

Everytime I start the packager, there is a new "Application ID" assigned, as follows:

file:///Users/edi/Library/Developer/CoreSimulator/Devices/9869345A-6659-4046-8895-D6D836387159/data/Containers/Data/Application/55A012FC-FDE3-4D23-84C9-CBE93E969303/Library/Caches/imagesCacheDir/firebasestoragegoogleapiscom/f079e0867f7ab8321e93eb35f5678238019f2255.jpg

Note that "current" Application ID is 55A012FC-FDE3-4D23-84C9-CBE93E969303. That's all good, everything works fine. But, everytime I restart the packager, this App ID changes ( of course, this is how it probably works ).

For that specific picture, I found the "original" path this image was created in, CFB84FBD-4763-4DF9-892F-EC53D6E58A2F -- This was the AppID generated yesterday probably...

What seems weird is that, if there's a different path, why doesn't this extension just cache the new file ? Wouldn't this imply the file doesn't exist at the "generatedPath" therefore, download and cache ?

Regards!

edi commented 6 years ago

https://youtu.be/AJukKGp0OuM

Here is a video explaining the situation. Basically, the image still exists in the former path, but since the App ID changes ( when react packager is restarted ), it can't find the specified image in the new path. Problem is ... should this mean that the image is not actually cached, then just treat it as a new source ? Download then cache URL ?

chrusart commented 6 years ago

Yes, check PR thread #91

kfiroo commented 6 years ago

I believe this is resolved in https://github.com/kfiroo/react-native-cached-image/pull/97 right?

edi commented 6 years ago

Yep. That fixes it. Used a workaround meanwhile, thanks for merging :)