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

[Bug] XF5.0.0-pre5 ItemsSource/CollectionView regressions #13548

Open
Tommigun1980 opened this issue Jan 26, 2021 · 9 comments
Open

[Bug] XF5.0.0-pre5 ItemsSource/CollectionView regressions #13548

Tommigun1980 opened this issue Jan 26, 2021 · 9 comments

Comments

@Tommigun1980
Copy link

Tommigun1980 commented Jan 26, 2021

Description

Opening a new ticket to get some traction on this.

XF5.0.0-pre5 introduced the following regressions that probably go hand in hand, where updating a CollectionView's ItemsSource no longer works:

  1. If updates are done in one batch, the UI won't show the changes.
  2. If updates are done one by one, the UI will show the changes but it is extremely slow.

Both cases worked in XF5.0.0-pre4 and versions prior to it.
So there is no way to properly populate collection data in XF5.0.0-pre5 or later.


More detailed breakdown:

  1. Populating a CollectionView from an OptimizedObservableCollection or similar (ie a collection where items are populated in one go and a RESET event is sent), makes the contents come out as blank. So the CollectionView completely ignores changes in its ItemsSource when the update is done as a batch.

Repro project at #13126 (comment). Presumed duplicates or very closely related to this issue: #13530, #13361. Another repro project at #13231 (bugs 1 and 2).

  1. Populating a CollectionView from an ObservableCollection, one item at a time, has regressed in speed. Just populating a few dozen elements makes the app freeze up for a long time.

Original report at #13429.

This on iOS - I don't know if it happens on Android also.

Steps to Reproduce

Repro project for 1) at #13126 (comment), repro case for 2) would be the same project but remove the BeginMassUpdate() line (to prevent batching).

Expected Behavior

XF5.0.0-pre5 and later should update the UI when batch updating ObservableCollection contents.
XF5.0.0-pre5 and later should not slow down to a crawl when updating ObservableCollection contents one by one.

Actual Behavior

Basic Information

  • Version with issue: XF5.0.0-pre5 and later, including XF5.0.0-sr2 and latest nightly
  • Last known good version: XF5.0.0-pre4
  • Platform Target Frameworks:
    • iOS: 14.2

Environment

Show/Hide Visual Studio info
=== Visual Studio Community 2019 for Mac (Preview) ===

Version 8.9 Preview (8.9 build 1451)
Installation UUID: 8872f256-c18e-42c9-a1d4-3d7d3b790000
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 612000113

=== Mono Framework MDK ===

Runtime:
	Mono 6.12.0.113 (2020-02/4fdfb5b1fd5) (64-bit)
	Package version: 612000113

=== Xamarin Designer ===

Version: 16.9.0.266
Hash: c4842c761
Branch: remotes/origin/c4842c761b9b6a95407f72278ca7fb42f8f7fdf0
Build date: 2021-01-07 06:17:08 UTC

=== Roslyn (Language Service) ===

3.9.0-3.20619.14+df59a33fd9beff9790e01a2a1ab21e4a1e6921b3

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.102/Sdks
SDK Versions:
	5.0.102
	5.0.101
	5.0.100
	3.1.405
	3.1.404
	3.1.403
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	5.0.2
	5.0.1
	5.0.0
	3.1.11
	3.1.10
	3.1.9

=== .NET Core 3.1 SDK ===

SDK: 3.1.405

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.2 (17535)
Build 12B45b

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 14.9.0.27 (Visual Studio Community)
Hash: f4c9327fa
Branch: main
Build date: 2020-11-19 10:57:31-0500

=== Xamarin.Android ===

Version: 11.2.0.0 (Visual Studio Community)
Commit: xamarin-android/d16-9/f908d16
Android SDK: /Users/tommikiviniemi/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 30.0.2

Build Information: 
Mono: 5e9cb6d
Java.Interop: xamarin/java.interop/d16-9@1d382be
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.32.2@cfe06e0
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@ad80a42

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/tommikiviniemi/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.9.0.21
Hash: 57e40ba
Branch: remotes/origin/main
Build date: 2021-01-08 01:57:14 UTC

=== Android Device Manager ===

Version: 16.9.0.14
Hash: 0fdccda
Branch: remotes/origin/main
Build date: 2021-01-08 01:57:36 UTC

=== Build Information ===

Release ID: 809001451
Git revision: cfd15313a6388ef8dada0182e22a058131c46f9d
Build date: 2021-01-15 08:42:21-05
Build branch: release-8.9
Xamarin extensions: cfd15313a6388ef8dada0182e22a058131c46f9d

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.2.0 Darwin Kernel Version 20.2.0
    Wed Dec  2 20:39:59 PST 2020
    root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64

Workaround

To force refresh a CollectionView after batch updating its ItemsSource collection, do the following:

var items = this.myCollectionView.ItemsSource;
this.myCollectionView.ItemsSource = null;
this.myCollectionView.ItemsSource = items;
@Tommigun1980 Tommigun1980 added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 26, 2021
@Tommigun1980
Copy link
Author

Tommigun1980 commented Jan 26, 2021

I can't stress how time consuming these two regressions are, and would really appreciate if they were resolved. 5.0.0 stable and later versions are a nightmare to work with until these get resolved.

@Tommigun1980
Copy link
Author

Tommigun1980 commented Jan 27, 2021

@jsuarezruiz Any chance this could also get a blocker label? CollectionViews no longer updating at all when their data is batch updated is a real blocker, even more so with the performance regression when updating them one item at a time.

These are regressions, and pretty fatal at that, so if they could go to the top of a service release and a fix be put out ASAP would be much appreciated!

Thank you.

@Tommigun1980
Copy link
Author

Tommigun1980 commented Jan 28, 2021

There have been a ton of issues in 5.0.0 regarding ItemsSource modifications. I really think that hard-coding ItemsSource contents in an XAML file while testing is not enough as it doesn't replicate a real-world scenario. ItemsSources are often asynchronously populated (for example residing in a view model, where the vm itself downloads the data). Hard-coding ItemsSource contents in an XAML file masks any such issues and does not correlate with real-world usage, resulting in an unnecessary number of regressions.

@Tommigun1980
Copy link
Author

Hello @hartez. Pinging again regarding these regressions -- do you have an estimate on when they will be fixed? I'm hoping for a service release or a point release soon, as you can't currently fill up a CollectionView with data properly.

Thanks so much.

@Tommigun1980
Copy link
Author

@jsuarezruiz @hartez I'd really appreciate some correspondence on these four CollectionView bugs I have opened:
#13592, #13547, #13548, #13231.

I spent a ton of time isolating the issues and making repro projects for them, and I need some kind of resolution as I have a hard time finish up my work here before they are resolved. So I'd really appreciate some comments on time estimates, or any kind of correspondence regarding them.
Thank you.

@jsuarezruiz
Copy link
Contributor

@Tommigun1980 Thanks for the repro sample: #13126 (comment)
Reviewed and moved some issues to the CollectionView project https://github.com/xamarin/Xamarin.Forms/projects/41

@Tommigun1980
Copy link
Author

@Tommigun1980 Thanks for the repro sample: #13126 (comment)
Reviewed and moved some issues to the CollectionView project https://github.com/xamarin/Xamarin.Forms/projects/41

Thank you so much @jsuarezruiz! These two issues in this report are so tough as they make CollectionViews almost impossible to populate. Any chance of adding a regression and high prio flair to this? The last working version was XF5.0.0-pre4. The workaround is permeating my entire code-base at this point.
Thank you again!!

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Feb 8, 2021

This issue is a compilation of other issues. I mark this issue as verified, since the issues it points to are verified but duplicated (to close when there is a fix and the others are closed).

@Tommigun1980 Yes, added high label to #13231.

@jsuarezruiz jsuarezruiz added duplicate Duplicate issue and removed s/unverified New report that has yet to be verified labels Feb 8, 2021
@esaruoho
Copy link

esaruoho commented May 7, 2021

any eta on these getting fixed?.. these were updated february last?

@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
None yet
Development

No branches or pull requests

4 participants