SavePoint crash when switching views quickly #246

Closed
opened 2026-10-27 14:39:30 -05:00 by ethan-hann · 1 comment
Owner

What happened

Switching between different views causes SavePoint to crash with this stacktrace:

SavePoint 0.9.18+90ee667a7e53
System: Microsoft Windows 10.0.26200 (X64), .NET 10.0.14
Crashed on: the UI thread
Log folder: C:\Users\Ethan\AppData\Local\SavePoint Data\Logs

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.ObjectModel.Collection`1.System.Collections.IList.get_Item(Int32 index)
   at Avalonia.Controls.Selection.SelectedItems`1.GetEnumerator()+MoveNext()
   at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|324_0[TSource](IEnumerable`1 source)
   at Avalonia.Controls.Selection.InternalSelectionModel.OnSelectionChanged(Object sender, SelectionModelSelectionChangedEventArgs e)
   at Avalonia.Controls.Selection.SelectionModel`1.CommitOperation(Operation operation, Boolean raisePropertyChanged)
   at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelection(Int32 index, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus)
   at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelection(Int32 index, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus)
   at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelectionFromEvent(Control container, RoutedEventArgs eventArgs)
   at Avalonia.Controls.ListBoxItem.OnPointerPressed(PointerPressedEventArgs e)
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Input.MouseDevice.MouseDown(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers, IInputElement hitTest, Object platformInputEventCookie)
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e)
   at Avalonia.Threading.Dispatcher.Send(SendOrPostCallback action, Object arg, Nullable`1 priority)

Steps to make it happen again
Unable to reproduce but should be investigated regardless. Seems to be a race condition on the UI thread that only triggers every once in a while.

Audit UI code and ensure the UI thread is properly invoked from the API.

**What happened** Switching between different views causes SavePoint to crash with this stacktrace: ``` SavePoint 0.9.18+90ee667a7e53 System: Microsoft Windows 10.0.26200 (X64), .NET 10.0.14 Crashed on: the UI thread Log folder: C:\Users\Ethan\AppData\Local\SavePoint Data\Logs System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index') at System.Collections.ObjectModel.Collection`1.System.Collections.IList.get_Item(Int32 index) at Avalonia.Controls.Selection.SelectedItems`1.GetEnumerator()+MoveNext() at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|324_0[TSource](IEnumerable`1 source) at Avalonia.Controls.Selection.InternalSelectionModel.OnSelectionChanged(Object sender, SelectionModelSelectionChangedEventArgs e) at Avalonia.Controls.Selection.SelectionModel`1.CommitOperation(Operation operation, Boolean raisePropertyChanged) at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelection(Int32 index, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus) at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelection(Int32 index, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus) at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelectionFromEvent(Control container, RoutedEventArgs eventArgs) at Avalonia.Controls.ListBoxItem.OnPointerPressed(PointerPressedEventArgs e) at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e) at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) at Avalonia.Input.MouseDevice.MouseDown(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers, IInputElement hitTest, Object platformInputEventCookie) at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e) at Avalonia.Threading.Dispatcher.Send(SendOrPostCallback action, Object arg, Nullable`1 priority) ``` **Steps to make it happen again** Unable to reproduce but should be investigated regardless. Seems to be a race condition on the UI thread that only triggers every once in a while. Audit UI code and ensure the UI thread is properly invoked from the API.
ethan-hann added this to the 1.0 milestone 2026-10-27 14:39:30 -05:00
Author
Owner
Fixed in 0.9.19 (PR 252): https://git.tortal.tech/ethan-hann/SavePoint/releases/tag/v0.9.19
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint#246
No description provided.