Update to latest version (2018.2.516.250) broke pull to refresh in iOS

5 posts, 0 answers
  1. VPS
    VPS avatar
    30 posts
    Member since:
    Jan 2015

    Posted 25 May 2018 Link to this post

    Hello,

    I recently updated my Telerik libraries to the latest version (2018.2.516.250) and pull to refresh stopped working on all the list in my app. I reverted back to version 2018.1.405.2 and all is working again.

    The exception details from App Center are:

    Application.Main (System.String[] args)
    D:\Projectos\KisenseMobile v2.beta\Source\KisenseMobile\KisenseMobile.iOS\Main.cs - line 21
    System.NullReferenceException: Object reference not set to an instance of an object
     
    ListViewDataSource.OnDataChanged (System.Object sender, System.EventArgs eventArgs)
    ListViewDataAdapter.RaiseDataChanged (Telerik.XamarinForms.Common.Data.CollectionChange change, Telerik.XamarinForms.DataControls.ListView.ListViewDataGroup group)
    ListViewDataAdapter.RaiseDataChanged (Telerik.XamarinForms.Common.Data.CollectionChange change)
    ListViewDataAdapter.OnStatusChanged (System.Object sender, Telerik.XamarinForms.Common.Data.DataProviderStatusChangedEventArgs eventArgs)
    DataProviderBase.OnStatusChanged (Telerik.XamarinForms.Common.Data.DataProviderStatusChangedEventArgs args)
    LocalDataSourceProvider.OnCompleted (System.Object sender, Telerik.XamarinForms.Common.Data.DataEngineCompletedEventArgs e)
    ParallelDataEngine.RaiseCompleted (Telerik.XamarinForms.Common.Data.DataEngineCompletedEventArgs args)
    ParallelDataEngine.RebuildCube (Telerik.XamarinForms.Common.Data.ParallelState state)
    LocalDataSourceProvider.GenerateAndExecuteDataEngineRequest ()
    LocalDataSourceProvider.RefreshOverride (Telerik.XamarinForms.Common.DataChangeFlags dataChangeFlags)
    DataProviderBase.Refresh (Telerik.XamarinForms.Common.DataChangeFlags dataChangeFlags)
    DataProviderBase.OnEditCompleted ()
    DataProviderBase.Invalidate ()
    LocalDataSourceProvider.OnItemsSourceChanged (System.Object newValue)
    LocalDataSourceProvider.set_ItemsSource (System.Object value)
    ListViewDataAdapter.UpdateItemsSource ()
    ListViewDataAdapter.OnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs eventArgs)
    (wrapper delegate-invoke) .invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
    BindableObject.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:153
    Element.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\Element.cs:402
    RadListView.OnPropertyChanged (System.String propertyName)
    BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:634
    BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:426
    BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173
    BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:78
    Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\Binding.cs:131
    BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:457
    BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:135
    Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:536
    Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:354
    View.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\View.cs:150
    Grid.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Grid.cs:147
    BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:136
    Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:536
    Element.set_Parent (Xamarin.Forms.Element value) D:\a\1\s\Xamarin.Forms.Core\Element.cs:212
    Element.OnChildAdded (Xamarin.Forms.Element child) D:\a\1\s\Xamarin.Forms.Core\Element.cs:368
    VisualElement.OnChildAdded (Xamarin.Forms.Element child) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:621
    Layout`1[T].OnChildAdded (Xamarin.Forms.Element child) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:32
    Layout.OnInternalAdded (Xamarin.Forms.View view) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:450
    Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:440
    (wrapper delegate-invoke) .invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
    ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:288
    ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:351
    ObservableCollection`1[T].InsertItem (System.Int32 index, T item) /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/mcs/class/referencesource/System/compmod/system/collections/objectmodel/observablecollection.cs:219
    Collection`1[T].Add (T item) /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/collections/objectmodel/collection.cs:67
    ObservableWrapper`2[TTrack,TRestrict].Add (TRestrict item) D:\a\1\s\Xamarin.Forms.Core\ObservableWrapper.cs:35
    RadBusyIndicator.set_VisibleContent (Xamarin.Forms.View value)
    RadBusyIndicator.DisplayActualContent ()
    RadBusyIndicator.OnIsBusyPropertyChanged (Telerik.XamarinForms.Primitives.RadBusyIndicator indicator, System.Boolean oldValue, System.Boolean newValue)
    BindablePropertyExtensions+<>c__DisplayClass6_0`2[TDeclarer,TPropertyType].<Create>b__0 (Xamarin.Forms.BindableObject b, System.Object o, System.Object n)
    BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:636
    BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:426
    BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173
    BindingExpression.Apply (System.Boolean fromTarget) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:57
    BindingExpression+BindingExpressionPart.<PropertyChanged>b__49_0 () D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:612
    NSAsyncActionDispatcher.Apply () /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/Foundation/NSAction.cs:125
    (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
    UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/UIKit/UIApplication.cs:79
    UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.177/src/Xamarin.iOS/UIKit/UIApplication.cs:63
    Application.Main (System.String[] args) D:\Projectos\KisenseMobile v2.beta\Source\KisenseMobile\KisenseMobile.iOS\Main.cs:21

  2. Ivan
    Admin
    Ivan avatar
    115 posts

    Posted 28 May 2018 Link to this post

    Hello,

    Thank you for reporting this issue to us. The stack trace of the exception seems very similar to a bug we are already aware of: RadListView: [iOS] Exception when rebining ItemsSource after navigation. The scenario you are describing is slightly different, however. To eliminate the possibility of missing something else, could you please elaborate how the exception occurs? Does it happen immediately when performing pull-to-refresh, or after another user interaction, e.g. page navigation, switching between tabs etc.? It would be best if you can send us a small sample project that reproduces the exception.

    Please, excuse us for the temporary inconvenience. Any additional information you can provide would be greatly appreciated.

    Regards,
    Ivan
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. VPS
    VPS avatar
    30 posts
    Member since:
    Jan 2015

    Posted 06 Jun 2018 in reply to Ivan Link to this post

    I have submitted a ticket (ID: 1170901) with a sample application demonstrating this error.
  4. VPS
    VPS avatar
    30 posts
    Member since:
    Jan 2015

    Posted 06 Jun 2018 Link to this post

    As I stated in the ticket I created, this seem to only occur when the list in inside a RadBusyIndicator. I have altered my page so that the list is no longer inside the busy indicator, and the refresh seems to work but the refresh animation (the one that show on top of the list) never goes away: the list contents is updated but the animation remains, and I cannot initiate a second refresh.

    The code on the RefreshRequested event on the list is:

    private void OnRefreshRequested(object sender, PullToRefreshRequestedEventArgs e)
    {
        if (BindingContext is AlarmsViewModel model)
        {
            model.RefreshAlarmsCommand.Execute(null);
            OccurrencesList.EndRefresh(true);
        }
    }

     

    The refresh command method is an async method (it needs to access some API methods).

     

  5. Ivan
    Admin
    Ivan avatar
    115 posts

    Posted 07 Jun 2018 Link to this post

    Hello,

    Thank you for the detailed information. I have confirmed the NullReferenceException from the stack trace is another manifestation of the same bug: RadListView: [iOS] Exception when rebining ItemsSource after navigation. The issue can be observed when the RadListView is removed and then added to the visual tree and its ItemsSource is modified. The workaround is to move the RadListView outside the RadBusyIndicator, as you have already discovered.

    Regarding the problem with pull-to-refresh never ending, I have logged another bug report: ListView: [iOS] Pull to refresh never stops after calling EndRefresh. The problem is that EndRefresh is not properly dispatched on the UI thread under iOS. As a temporary workaround, you can do that manually:

    Device.BeginInvokeOnMainThread(() => ItemsList.EndRefresh(true));

    Please, excuse us for the temporary inconvenience. I have updated your Telerik points as a token of our gratitude.

    Regards,
    Ivan
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top