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

[Bug] [iOS] CollectionView blank when bound ObservableCollection has contents rapidly change #13361

Closed
Silic0nS0ldier opened this issue Jan 11, 2021 · 6 comments
Labels
s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@Silic0nS0ldier
Copy link

Silic0nS0ldier commented Jan 11, 2021

This bug report is a work in progress. Missing details will be added at soonest opportunity.

Description

When a CollectionView with a bound ObservableCollection (that has been enhanced to allow bulk changes without overwhelming the UI) has the contents of the ObservableCollection change rapidly (e.g. in response to a filter changing as the user types), the CollectionView appears to enter a corrupted state where nothing is shown when there are items in the ObservableCollection.

The set EmptyView continues to function correctly when in the state.

Steps to Reproduce

TODO Pending creation of reproduction repo.

Expected Behavior

CollectionView shows a populated ItemTemplate in the UI for each item in the bound ObservableCollection.

Actual Behavior

CollectionView shows nothing.

Basic Information

  • Version with issue: 4.8.0.1687
  • Last known good version: NA
  • Platform Target Frameworks:
    • iOS: 14.3
  • NuGet Packages: NA
  • Affected Devices: iPhone Simulator, iPhone SE (2nd generation) iOS 14.3 (not tested on physical device which may respond differently given this appears to involve race conditions)

Environment

Show/Hide Visual Studio info
Microsoft Visual Studio Community 2019
Version 16.8.3
VisualStudio.16.Release/16.8.3+30804.86
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA682
Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019   16.8.554.20160
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services   16.1.0.2052803+84e121f1403378489b842e1797df2f3f5a49ac3c
Provides languages services for ASP.NET Core Razor.

Azure App Service Tools v3.0.0   16.8.554.20160
Azure App Service Tools v3.0.0

C# Tools   3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.113+g422d40002e.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.8.43 (00471f8)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.8.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62010.06180
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   16.0.21016.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.8.0-5.20604.10+9ed4b774d20940880de8df1ca8b07508aa01c8cd
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   16.8.0-beta.20507.4+da6be68280c89131cdba2045525b80890401defd
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.8.000.260 (d16-8@fd405a2)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.8.0.507 (remotes/origin/d16-8@e87b24884)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.8.112 (86385a3)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   11.1.0.17 (d16-8/c0e2b8e)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: be2226b
    Java.Interop: xamarin/java.interop/d16-8@79d9533
    ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
    SQLite: xamarin/sqlite/3.32.1@1a3276b
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc


Xamarin.iOS and Xamarin.Mac SDK   14.6.0.15 (87a1b18d8)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Screenshots

TODO Pending creation of reproduction repo.

Reproduction Link

TODO To be created.

Workaround

Reduce rate of changes to ObservableCollection (via a queue with items delayed by a timeframe proportional to the change impact, or a throttle/debounce at a higher level if applicable for use case) so that UI has a chance to apply all changes before the next change. This reduces the chance of the race condition that causes this issue from manifesting by a considerable margin (but does not necessarily eliminate the possibility).

No quick workarounds here unfortunately, aside from going the slow route (add items one-by-one, slowing the UI considerably when many changes are made).

@Silic0nS0ldier Silic0nS0ldier added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 11, 2021
@samhouts samhouts added this to New in Triage Jan 11, 2021
@Tommigun1980
Copy link

Tommigun1980 commented Jan 12, 2021

This is the same issue as #13126 (comment) and #13203.

@Silic0nS0ldier
Copy link
Author

I don't think this is the same issue. The view defined on the EmptyView property is showing when it should here. When there is something to show (and the issue is manifesting), nothing is shown. This appears to be different to the issue described on those other tickets.

Once I've got a reproduction together (hoped to have this together by now, should have accounted for the "end of project rush") , the differences (or lack there-of) should be clearer.

@stepkillah
Copy link

Experiencing the same issue when collection changes rapidly, basically - data in ItemSource do not correspond actual CollectionView views

@Tommigun1980
Copy link

I don't think this is the same issue. The view defined on the EmptyView property is showing when it should here. When there is something to show (and the issue is manifesting), nothing is shown. This appears to be different to the issue described on those other tickets.

Once I've got a reproduction together (hoped to have this together by now, should have accounted for the "end of project rush") , the differences (or lack there-of) should be clearer.

Ah, sorry. I think it’s probably closely related though. There’s another issue reported (severe performance regression) in 5.0.0 unless a batch add is used, #13429, that may also be closely related.

@PureWeen
Copy link
Contributor

Moving this to needsinfo for now until a reproduction is attached

@PureWeen PureWeen moved this from New to Needs Info in Triage Jan 22, 2021
@PureWeen PureWeen added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Jan 22, 2021
@Silic0nS0ldier
Copy link
Author

This issue is proving difficult to recreate (my guess is that it requires bottlenecks in the "right" places to manifest) and I do not have time to dig deeper into the issue. Without the repo, its difficult to articulate specifics of the issue which makes it close to impossible for anyone figure this out (unless they stumble onto this by chance). As such, I'll be closing this issue.

For anyone who might stumble across this later, here is an overview of the issue that is being reported (the manifestation that is).

A search term would be typed in quickly, each input fires an event which alters collection view contents (for filtering results), after some time of input changing results are no longer visible. When in this state the collection view being empty still correctly shows the empty view, however when results should be shown there is just a blank space.

Triage automation moved this from Needs Info to Closed Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. s/unverified New report that has yet to be verified t/bug 🐛
Projects
Triage
  
Closed
Development

No branches or pull requests

4 participants