Cysharp / ObservableCollections

High performance observable collections and synchronized views, for WPF, Blazor, Unity.
MIT License
606 stars 46 forks source link

ArgumentOutOfRangeException exception version 3.1.0 #80

Closed karthikr-vti closed 1 month ago

karthikr-vti commented 1 month ago

I noticed a similar issue in case #70 , which has since been resolved. However, I'm still encountering ArgumentOutOfRangeException with version 3.1.0 sporadically when collections are cleared and re-added. I'll try to work on isolating the problem

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at ObservableCollections.FiltableSynchronizedViewList`2.get_Item(Int32 index)
   at ObservableCollections.NotifyCollectionChangedSynchronizedViewList`2.System.Collections.IList.get_Item(Int32 index)
   at DevExpress.Xpf.Editors.Helpers.PlainDataView.ProcessAddItem(Int32 index)
   at DevExpress.Xpf.Editors.Helpers.DataView.ProcessChangeSource(ListChangedEventArgs e)
   at DevExpress.Xpf.Editors.Helpers.DataController.ItemsSourceListChanged(Object sender, ListChangedEventArgs e)
   at DevExpress.Data.Utils.WeakEventHandler`3.OnEvent(Object source, TEventArgs eventArgs)
   at DevExpress.Data.Helpers.BindingListAdapterBase.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at DevExpress.Data.Utils.WeakEventHandler`3.OnEvent(Object source, TEventArgs eventArgs)
   at ObservableCollections.NotifyCollectionChangedSynchronizedViewList`2.RaiseChangedEvent(NotifyCollectionChangedEventArgs e)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
neuecc commented 1 month ago

Thank you, I'll check it out. It seems to be going through binding, but could you give me a simple Add/Remove process?

karthikr-vti commented 1 month ago

Thank you for your response. I was unable to reproduce this issue with the latest version 3.2.0. I’ll go ahead and close this issue for now