Closed kirillt closed 2 years ago
Checked on Andorid 10, same behavior. Build no: 181
Dinar has discovered that the issue originates from Glide's cache.
Active resources - Is this image displayed in another View right now? Memory cache - Was this image recently loaded and still in memory? Resource - Has this image been decoded, transformed, and written to the disk cache before? Data - Was the data this image was obtained from written to the disk cache before?
In fact, the cache keys for steps 1-3 (Active resources, memory cache, resource disk cache) also include a number of other pieces of data including: The width and height The optional Transformation Any added Options The requested data type (Bitmap, GIF, etc)
Possible solution is to add custom image signature for glide cache validation. https://bumptech.github.io/glide/doc/caching.html#custom-cache-invalidation
@mdrlzy this looks good, I think ResourceId
should be enough as signature.
It's interesting though, why the caches are not invalidated when image size is changed.
Closed by #201
https://user-images.githubusercontent.com/581023/145065132-2e5e8a69-5ddd-4d6f-b1b0-be432da95278.mp4
How to reproduce (example with images):
Expected behaviour:
Actual behaviour:
Apparently, re-indexing doesn't trigger although it should be triggered because path of the image has updated last modified. So, the id isn't re-calculated and both preview and thumbnail aren't re-generated.