FFImageLoading icon indicating copy to clipboard operation
FFImageLoading copied to clipboard

Sometimes returning the wrong image when using cells in MvvmCross

Open PelleRavn opened this issue 9 years ago • 9 comments

I have been working on some projects in Xamarin.iOS (with MvvmCross) where FFImageLoading is used. I'm not using the MvvmCross implementation that comes with the FFImageLoading package, it's a straight up classic loading, just in a cell:

ImageService.Instance.LoadUrl ( value ).WithCache ( CacheType.Disk ).FadeAnimation ( true, true, 200 ).Retry ( 3, 3000 ).Finish ( ImageFinishedLoading ).Into ( CoverImageView );

This gives some sort of race condition where some of the images loaded turns up in the wrong cell, often the same image shows up several times. In my case, it's almost always within the first 4-5 cells (don't know if that makes a difference). The thing is, in MvvmCross the content of the cells (the ViewModels) is loaded/added in tasks, so the content of the cells may come slightly later, which could be a part of the reason, but not completely sure. But it's only a problem with the image, the rest of the content in the cell is correct, so it's not the wrong ViewModel loaded into the cell. I also tried to use .IntoAsync() but that didn't make a difference, neither to remove any of the other parameters used.

I had the problem in both 2.2.8 and the new 2.2.9.

Let me know if you need any further information.

PelleRavn avatar Mar 06 '17 08:03 PelleRavn

Repros for me since 2.2.8. Does not seem to repro in 2.2.6 or before.

patook avatar Mar 07 '17 18:03 patook

Same problem on 2.2.9

marcpaes avatar Mar 12 '17 05:03 marcpaes

Probably connected to #527

cedricdg avatar Apr 06 '17 09:04 cedricdg

Does it happen on the latest prerelease nuget too? There were some fixes that could potentially fix the issue. Thanks.

daniel-luberda avatar May 09 '17 17:05 daniel-luberda

Could you test the newest prerelease as there were some fixes with memory cache? (https://github.com/luberda-molinet/FFImageLoading/commit/9b88540b43083a19b2fa0f46011c02d68ca8fee2)

daniel-luberda avatar Jun 07 '17 13:06 daniel-luberda

I'll test it out and let you know soon :)

PelleRavn avatar Jun 08 '17 07:06 PelleRavn

Sorry it took so long for me to return. I've only done some basic testing with the app I used when I found the issue, and with the newest pre-release (408) it doesn't seem to happen. I will continue testing it, and return if the issue appears again.

PelleRavn avatar Jun 15 '17 16:06 PelleRavn

I'll close this one as it should be fixed in the newest stable. Thanks

daniel-luberda avatar Sep 02 '17 14:09 daniel-luberda

Agreed, haven't had any issues with this for a long time. Great work!

PelleRavn avatar Sep 03 '17 13:09 PelleRavn