Skip to content

AsyncImage requests cancelled in LazyRow are not always restarted when item becomes visible again #3379

@P-Emmy

Description

@P-Emmy

Describe the bug
I am seeing an issue with AsyncImage inside a Compose LazyRow.

I display a list of filter previews. Each item loads the same local image file, but with a different custom Transformation. While scrolling, some requests enter a Cancelled state. Cancellation itself is
expected when items leave the viewport, but in some cases the item is not recomposed / the request is not restarted when it becomes visible again.
As a result, the corresponding preview stays empty instead of rendering the image.
This happens intermittently during scroll events, especially when scrolling back and forth quickly through the filter list.
What I expect:

  • An off-screen request may be cancelled
  • When the item becomes visible again, the request should restart and the image should be rendered

What I observe:

  • Some items reach a Cancelled state
  • When they become visible again, they sometimes stay empty permanently

To Reproduce
See attached video, code is accessible here: https://github.com/P-Emmy/testCoil

CanceledImageNotReload.mp4

Version
Coil version: 3.2.0 (and 3.1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions