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

iOS: ContextAction collection changes cause slow-down and eventual freeze #2085

Open
sonic1015 opened this issue Mar 12, 2018 · 3 comments
Open
Labels
a/listview Problems with the ListView/TableView a/performance e/4 🕓 4 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/iOS 🍎 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@sonic1015
Copy link

sonic1015 commented Mar 12, 2018

Description

Each Change to the ContextActions in a ListView or TableView cause an exponentially increasing UI freeze on iOS.

Steps to Reproduce

  1. Create a ViewCell with context actions
  2. Repeatedly change the context actions in some way (usually based on ViewCell/ViewModel state)

Expected Behavior

Context Menu (swipe left on iOS, hold on Android, right-click on UWP, etc) should reflect this change immediately with no UI slow down.

Actual Behavior

On iOS, on every change, the UI gets slower and slower to respond till it eventually freezes indefinitely.

Basic Information

  • Version with issue: 2.5.0.280555
  • IDE: Visual Studio 2017
  • Platform Target Frameworks:
    • iOS: 11.8.0.20
  • Devices: Tested on iPhone 6 Plus

Video

https://github.com/sonic1015/bugRepo/files/1835039/2018-03-12.T16-17-07.zip

Reproduction Link

https://github.com/sonic1015/bugRepo/archive/1.zip

@sonic1015 sonic1015 changed the title iOS: ContextAction source changes cause slow-down and eventual freeze iOS: ContextAction collection changes cause slow-down and eventual freeze Mar 12, 2018
@mseamari
Copy link

Hi,

i am also running against this exact same issue, i was wondering when you will actually pick this up

@samhouts samhouts added the e/4 🕓 4 label Jul 26, 2018
@samhouts samhouts added the inactive Issue is older than 6 months and needs to be retested label Dec 20, 2018
@samhouts samhouts added help-wanted up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! help wanted We welcome community contributions to any issue, but these might be a good place to start! and removed help-wanted labels Jun 28, 2019
@samhouts samhouts added the a/listview Problems with the ListView/TableView label Feb 24, 2020
@samhouts
Copy link
Member

This issue doesn't seem to have had any activity in a long time. We're working on prioritizing issues and resolving them as quickly as we can. To help us get through the list, we would appreciate an update from you to let us know if this is still affecting you on the latest version of Xamarin.Forms, since it's possible that we may have resolved this as part of another related or duplicate issue. If we don't see any new activity on this issue in the next 30 days, we'll evaluate whether this issue should be closed. Thank you!

@samhouts samhouts added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jun 12, 2020
@sonic1015
Copy link
Author

sonic1015 commented Jun 15, 2020

Updated the reproduction to Xamarin.Forms v4.6.0.867

After the first menu item change, there is no animation on menu close. After about 7 menu item changes, it crashes with the following exception:

System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.ContextActionsCell.OnCellPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in D:\a\1\s\Xamarin.Forms.Platform.iOS\ContextActionCell.cs:475 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:353 
  at Xamarin.Forms.Cell.OnContextActionsChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0002d] in D:\a\1\s\Xamarin.Forms.Core\Cells\Cell.cs:227 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x00021] in <866ebc6712e548788bfc4c085907ae80>:0 
  at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x00027] in <624bcc4ce53347508a7b8fa821d78da4>:0 
  at bugRepo.CustomViewCell+<>c__DisplayClass0_0.<.ctor>b__1 (System.Object sender, System.EventArgs args) [0x00002] in C:\Users\eballantyne\Downloads\bugRepo-1\bugRepo-1\bugRepo\bugRepo\CustomViewCell.xaml.cs:40 

Tested on on iPhone 8, iOS 13.4.1. Haven't tested on Android or UWP.

@samhouts samhouts added i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often and removed inactive Issue is older than 6 months and needs to be retested s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. labels Jun 15, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/listview Problems with the ListView/TableView a/performance e/4 🕓 4 help wanted We welcome community contributions to any issue, but these might be a good place to start! i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/iOS 🍎 t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

4 participants