Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] CollectionView visible cells not updating correctly when using XCT ObservableRangeCollection after recent semaphore fix #13530

Open
GalaxiaGuy opened this issue Jan 25, 2021 · 2 comments

Comments

@GalaxiaGuy
Copy link
Contributor

GalaxiaGuy commented Jan 25, 2021

Description

I have a CollectionView.ItemsSource bound to an ObservableRangeCollection from Xamarin Community Toolkit.
Some time after being initially shown, some items are removed and some items are added using AddRange and RemoveRange.

The visible cells do not change.

I don't know if the bug is in Forms, or XCT, but this worked fine in Forms versions without this fix: #11853

Steps to Reproduce

  1. Bind CollectionView.ItemsSource to ObservableRangeCollection.
  2. Use AddRange and/or RemoveRange on the items.

Expected Behavior

Visible items change.

Actual Behavior

Visible items do not change.

Scrolling the items off screen and back on fixes the cells.

Basic Information

  • Version with issue: 4.8.0.1821, 5.0.0.1905
  • Last known good version: 4.8.0.1687
  • NuGet Packages: Xamarin Community Toolkit 1.0.2
  • Affected Devices: iOS

Reproduction Link

https://github.com/GalaxiaGuy/xf-bugs/tree/bug/observablerangecollection
https://github.com/GalaxiaGuy/xf-bugs/archive/bug/observablerangecollection.zip

Click the button to push a new page. 100ms after the page is created all the cells should be green and not say "Loading".

Workaround

Just using ObservableCollection seems to work.

@GalaxiaGuy GalaxiaGuy added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 25, 2021
@samhouts samhouts added this to New in Triage Jan 25, 2021
@GalaxiaGuy
Copy link
Contributor Author

GalaxiaGuy commented Jan 26, 2021

Just using ObservableCollection seems to work.

Although this is true in the small test case, it does not seem to be true in the app I'm currently working on. When using ObservableCollection the visible cells update, but all change to have the same content as the last visible cell (again scrolling a cell off screen back on again fixes it).

I realise not having a a reproduction makes it hard to do anything, I include just as further evidence that something strange is going on.

@Tommigun1980
Copy link

Just using ObservableCollection seems to work.
I realise not having a a reproduction makes it hard to do anything, I include just as further evidence that something strange is going on.

I think this may be the same issue as #13126 (comment), as that issue is using an OptimizedObservableCollection with AddRange (that sends RESET events)?

@rmarinho rmarinho added a/collectionview p/iOS 🍎 and removed s/unverified New report that has yet to be verified labels Jan 27, 2021
@rmarinho rmarinho moved this from New to Needs Estimate in Triage Jan 27, 2021
@hartez hartez removed their assignment Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Triage
  
Needs Estimate
Development

No branches or pull requests

4 participants