You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setRetainInstance is true on a fragment, coil refuses to load any images after configuration change. Logs indicate that all the requests are cancelled, as the Coroutine scope is blindly cancelled from onConfigurationChanged.
I suspect this will be marked as WillNotFix as setRetainInstance is deprecated and strongly advised against - we have it in some legacy code that I have now started to refactor as a result of this bug.
Raising here for awareness and to save anyone else potentially spending hours investigating this.
Using Coil 2.5.0
The text was updated successfully, but these errors were encountered:
Are all new requests cancelled if they're launched after the view is reattached to the activity? If you use an ImageView attached to a fragment, that fragment must be attached to an activity or the request will be cancelled. If we allowed requests to proceed on detached fragments that's likely to leak the view reference.
All requests from the retained fragment are immediately cancelled from the moment the device is rotated. It never recovers - e.g. I scroll the recyclerview up and down, and the image requests are all immediately cancelled.
As far as I could see, the Scope defined in RealImageLoader is cancelled from the shutdown method, which is called from onConfigurationChanged. The scope is never recreated, so all calls to it are immediately cancelled.
@darrentaft The scope in RealImageLoader is only cancelled by onConfigurationChanged if the ImageLoader is freed by the GC, which won't occur for the singleton image loader. Are you sure the scope is cancelled? Requests are also cancelled if the fragment's root View is detached, which seems more likely.
It's definitely attached - I'm scrolling the RecyclerView up and down the screen, and all image requests (for elements within it) immediately report that they're cancelled. The text elements around the image update correctly.
When setRetainInstance is true on a fragment, coil refuses to load any images after configuration change. Logs indicate that all the requests are cancelled, as the Coroutine scope is blindly cancelled from onConfigurationChanged.
I suspect this will be marked as WillNotFix as setRetainInstance is deprecated and strongly advised against - we have it in some legacy code that I have now started to refactor as a result of this bug.
Raising here for awareness and to save anyone else potentially spending hours investigating this.
Using Coil 2.5.0
The text was updated successfully, but these errors were encountered: