BlossomiShymae / Needlework.Net

🪡 A .NET helper development tool for the LCU!
MIT License
12 stars 1 forks source link

[BUG] Event Viewer crashes when toggling Tail option #4

Closed BlossomiShymae closed 2 months ago

BlossomiShymae commented 2 months ago

Seems to happen sometimes. Needs more debugging.

  1. Open Event Viewer
  2. Fill up the events until it reaches the maximum capacity.
  3. Try toggling Tail while events are populated.
System.InvalidOperationException
  HResult=0x80131509
  Message=Invalid Arrange rectangle.
  Source=Avalonia.Base
  StackTrace:
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.VirtualizingStackPanel.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ScrollContentPresenter.ArrangeWithAnchoring(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.LayoutManager.Arrange(Layoutable control)
   at Avalonia.Layout.LayoutManager.ExecuteArrangePass()
   at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
   at Avalonia.Controls.VirtualizingStackPanel.ScrollIntoView(Int32 index)
   at Avalonia.Controls.ItemsControl.ScrollIntoView(Int32 index)
   at Needlework.Net.Desktop.Views.WebsocketView.<>c__DisplayClass3_0.<OnApplyTemplate>b__0(Object s, NotifyCollectionChangedEventArgs e) in G:\Git\Needlework.Net\Needlework.Net.Desktop\Views\WebsocketView.axaml.cs:line 34
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Needlework.Net.Desktop.ViewModels.WebsocketViewModel.<>c__DisplayClass22_0.<OnMessage>b__0() in G:\Git\Needlework.Net\Needlework.Net.Desktop\ViewModels\WebsocketViewModel.cs:line 111
   at Avalonia.Threading.DispatcherOperation.InvokeCore()

It seems to happen when the Size of the control has a NaN for its width or height. https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Base/Layout/Layoutable.cs#L405

Wrapping the line in a try-catch causes the list to be corrupted near the bottom... image