Sometimes returning the wrong image when using cells in MvvmCross
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.
Repros for me since 2.2.8. Does not seem to repro in 2.2.6 or before.
Same problem on 2.2.9
Probably connected to #527
Does it happen on the latest prerelease nuget too? There were some fixes that could potentially fix the issue. Thanks.
Could you test the newest prerelease as there were some fixes with memory cache? (https://github.com/luberda-molinet/FFImageLoading/commit/9b88540b43083a19b2fa0f46011c02d68ca8fee2)
I'll test it out and let you know soon :)
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.
I'll close this one as it should be fixed in the newest stable. Thanks
Agreed, haven't had any issues with this for a long time. Great work!