Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disparity between coil2 and coil3's equality delegate #2640

Closed
saket opened this issue Nov 6, 2024 · 2 comments · Fixed by #2642
Closed

Disparity between coil2 and coil3's equality delegate #2640

saket opened this issue Nov 6, 2024 · 2 comments · Fixed by #2642

Comments

@saket
Copy link

saket commented Nov 6, 2024

While migrating telephoto to coil3, I noticed that some of my tests were running into infinite loops of image requests because the new equality delegate does not account for non-ImageRequest models.

Coil 2.x Coil 3.x
image image

Was this an intention choice?

Here's how I'm using AsyncImageModelEqualityDelegate: https://github.com/saket/telephoto/blob/5d156f836441b2deb684427162ac22d5d00f29a6/zoomable-image/coil3/src/main/kotlin/me/saket/telephoto/zoomable/coil3/ZoomableAsyncImage.kt#L112

It's also interesting that AsyncImage() does not seem to run into this problem. Are you relying on something else for diffing non-ImageRequest models?

@colinrtwhite
Copy link
Member

colinrtwhite commented Nov 6, 2024

Good catch! This is definitely a bug. Added a fix here that we can ship in a 3.0.1 release.

There are a bunch of tests around when AsyncImage/rememberAsyncImagePainter recompose here. I think it might be recomposing infinitely for you because Coil has overloads here that wrap passing the AsyncImageState to the "real" stable, restartable implementation here.

@saket
Copy link
Author

saket commented Nov 6, 2024

That was fast, thank you!

@saket saket closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants