Skip to content
This repository has been archived by the owner on Dec 15, 2024. It is now read-only.

Caching images causes URLImage to reload images without view update in keyboard extension #161

Open
4 of 5 tasks
amirshane opened this issue Sep 16, 2021 · 3 comments
Open
4 of 5 tasks
Labels
bug Something isn't working

Comments

@amirshane
Copy link

amirshane commented Sep 16, 2021

Summary and/or background
The app uses URLImage to load images into a keyboard extension based on user search queries. The images are cached. If the user types or taps on text fields the images loaded will reload and reanimate. Additionally, the images will still reload on a new search query even if their new search query does not result in updated images returned. Removing the caching removes the bug but there is no longer caching which is very desired.

OS and what device you are using

  • OS: iOS 14.0+
  • Device or simulator: Issue occurs on multiple (probably all) devices and simulators
  • Keyboard extension

Version of URLImage library
Version 3.1.0

  • The bug is reproducible in the latest version.

What you expected would happen
I expected for the images to not be reloaded when the search results are not updated and that tapping in text fields would not cause the images to reload.

What actually happens
The images reload even if the search results are not updated and tapping in text fields or typing in them causes the images to reload.

Sample code
I am adding the following URLImageService to the view environment for caching. If I remove this then the bug will disappear (but so will the caching).

let urlImageService = URLImageService(fileStore: URLImageFileStore(),
                                                  inMemoryStore: URLImageInMemoryStore())
myView
    .environment(\.urlImageService, urlImageService)

Test data
The issue occurs with any image URLs.

Additional information

Misc

  • I read the documentation and it didn't help;
  • I searched for similar issues.
@amirshane amirshane added the bug Something isn't working label Sep 16, 2021
@dmytro-anokhin
Copy link
Owner

Hello, thank you for detailed report. I'm currently busy with regular work, but I will investigate it when I get some free time.

@lokizero00
Copy link

Hello, i got the same issue when update views.

@dmytro-anokhin
Copy link
Owner

Hi, unfortunately I'm no longer actively working on the package. But if it happens and you find a fix - I will gladly review PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants