morenoh149 / react-native-contacts

React Native Contacts
MIT License
1.64k stars 560 forks source link

Contact thumbnail URI invalid after app update #619

Closed ArtjomC closed 2 years ago

ArtjomC commented 3 years ago

Hi, I have the following issue:

After importing the images from my contacts list and then updating the app to a new build release, I noticed that all the thumbnails of the contacts were greyed out. I then found out that the Images (On IOS) get saved in /Library/Caches/imagepath...

These were my steps:

  1. Installed version 0.5
  2. Imported some contacts with thumbnails
  3. Closed the app
  4. Installed version 0.6
  5. Thumbnails of contacts where grey

My question is: Is there any way to maybe change the location for saving pictures to a non-cache directory on IOS? Or is there a workaround for this issue?

Thanks in advance!

rejhgadellaabsl commented 3 years ago

Chiming in to provide some additional info.

The problem is that the contact thumbnails seem to be cached but iOS deletes those files whenever an app update is installed. This results in URIs pointing to a file that no longer exists (and that results in <Image />s not loading.

I think iOS could also delete these cached thumbnail files whenever it determines the phone is running out of space, but not sure about that.

In other words: thumbnail URIs retrieved through react-native-contacts will point to non-existent files after an app is updated through the App Store and/or after an adhoc install.

I think this ticket was mislabeled. It may contain a question, but this behavior seems more like a bug to me?

@ArtjomC requesting to change the title to "Contact thumbnail URI invalid after app update"

While looking into a solution/workaround for this, we also found that getContactById() and getPhotoForId() don't seem to update the cached thumbnail file unless we call getAll() first. Although this seems related, I think I should create a separate ticket for this?

github-actions[bot] commented 3 years ago

This issue is stale, please provide more information about the status

rejhgadellaa commented 3 years ago

Any news on this? We're still experiencing this issue..

morenoh149 commented 3 years ago

@rejhgadellaa nope. I gotta make time to work on this.

rejhgadellaabsl commented 3 years ago

Thanks! If I can help with reproducing, testing, etc, let me know! :)

rejhgadellaa commented 2 years ago

Please re-open as this is not yet solved. Thanks.

rejhgadellaabsl commented 2 years ago

Heh I think that bot is a bit too strict 😉 Could you re-open the ticket again? Thanks :)

morenoh149 commented 2 years ago

@rejhgadellaa thanks!

github-actions[bot] commented 2 years ago

This issue is stale, please provide more information about the status