Closed pavelreiter closed 1 year ago
Thanks for the report, but this is working as intended. We can't change the default behaviour as it would break existing users, but it's possible to disable this behaviour using addLastModifiedToFileCacheKey
.
I need the cache updated since the affected file can be rewritten, so I will go with changing dispatcher for the interceptor. Thanks for swift answer.
Sounds good, the only downside to changing the interceptorDispatcher
is the memory cache check will be performed asynchronously as well since computing the memory cache key requires the file timestamp.
Describe the bug When default ImageLoader is preparing cache keys for File models, it will perform disk IO read on main thread. This access can be reported as policy violation by StrictMode. Known workaround is to set interceptorDispatcher.
To Reproduce Supply a file Uri as AsyncImage model. Sample project:
https://github.com/pavelreiter/bugsample-coil-main-thread-access(deleted)Logs/Screenshots
Version Library version: 2.4.0 APIs: probably all, but tested on 33 and 30