DNSCrypt / DNSCrypt/SimpleDnsCrypt

Simple DNSCrypt stop working randomly when the application is running in the background

Open
#460 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.5k
Forks
249
PR merge metrics
No merged PRs in 30d

Description

The content of the error log
2019-11-23 22:27:38.4551 QueryLogViewModel System.Reflection.TargetInvocationException: An error occurred while dispatching a call to the UI Thread ---> System.InvalidOperationException: An ItemsControl is inconsistent with its items source.
See the inner exception for more information. ---> System.Exception: Information for developers (use Text Visualizer to read this):
This exception was thrown because the generator for control 'SimpleDnsCrypt.Controls.LoggingListView Items.Count:104' with name '(unnamed)' has received sequence of CollectionChanged events that do not agree with the current state of the Items collection. The following differences were detected:
Accumulated count 103 is different from actual count 104. [Accumulated count is (Count at last Reset + #Adds - #Removes since last Reset).]

One or more of the following sources may have raised the wrong events:
System.Windows.Controls.ItemContainerGenerator
System.Windows.Controls.ItemCollection
System.Windows.Data.ListCollectionView
System.Collections.ObjectModel.ObservableCollection`1[[SimpleDnsCrypt.Models.QueryLogLine, SimpleDnsCrypt, Version=0.7.0.0, Culture=neutral, PublicKeyToken=null]]
(The starred sources are considered more likely to be the cause of the problem.)

The most common causes are (a) changing the collection or its Count without raising a corresponding event, and (b) raising an event with an incorrect index or item parameter.

The exception's stack trace describes how the inconsistencies were detected, not how they occurred. To get a more timely exception, set the attached property 'PresentationTraceSources.TraceLevel' on the generator to value 'High' and rerun the scenario. One way to do this is to run a command similar to the following:
System.Diagnostics.PresentationTraceSources.SetTraceLevel(myItemsControl.ItemContainerGenerator, System.Diagnostics.PresentationTraceLevel.High)
from the Immediate window. This causes the detection logic to run after every CollectionChanged event, so it will slow down the application.

--- The end of the internal exception stack trace ---
System.Windows.Controls.ItemContainerGenerator.Verify()
System.Windows.Controls.VirtualizingStackPanel.MeasureChild(IItemContainerGenerator& generator, IContainItemStorage& itemStorageProvider, IContainItemStorage& parentItemStorageProvider, Object& parentItem, Boolean& hasUniformOrAverageContainerSizeBeenSet, Double& computedUniformOrAverageContainerSize, Double& computedUniformOrAverageContainerPixelSize, Boolean& computedAreContainersUniformlySized, Boolean& hasAnyContainerSpanChanged, IList& items, Object& item, IList& children, Int32& childIndex, Boolean& visualOrderChanged, Boolean& isHorizontal, Size& childConstraint, Rect& viewport, VirtualizationCacheLength& cacheSize, VirtualizationCacheLengthUnit& cacheUnit, Boolean& foundFirstItemInViewport, Double& firstItemInViewportOffset, Size& stackPixelSize, Size& stackPixelSizeInViewport, Size& stackPixelSizeInCacheBeforeViewport, Size& stackPixelSizeInCacheAfterViewport, Size& stackLogicalSize, Size& stackLogicalSizeInViewport, Size& stackLogicalSizeInCacheBeforeViewport, Size& stackLogicalSizeInCacheAfterViewport, Boolean& mustDisableVirtualization, Boolean isBeforeFirstItem, Boolean isAfterFirstItem, Boolean isAfterLastItem, Boolean skipActualMeasure, Boolean skipGeneration, Boolean& hasBringIntoViewContainerBeenMeasured, Boolean& hasVirtualizingChildren)
System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl(Size constraint, Nullable`1& lastPageSafeOffset, List`1& previouslyMeasuredOffsets, Nullable`1& lastPagePixelSize, Boolean remeasure)
System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint)
System.Windows.FrameworkElement.MeasureCore(Size availableSize)
System.Windows.UIElement.Measure(Size availableSize)
System.Windows.ContextLayoutManager.UpdateLayout()
System.Windows.Controls.ItemsControl.OnBringItemIntoView(ItemInfo info)
SimpleDnsCrypt.Controls.LoggingListView.AutoScroll_ItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
SimpleDnsCrypt.ViewModels.QueryLogViewModel.<>c__DisplayClass8_0.b__0()
Caliburn.Micro.XamlPlatformProvider.<>c__DisplayClass8_1.b__0()
--- The end of the internal exception stack trace ---
Caliburn.Micro.XamlPlatformProvider.OnUIThread(Action action)
SimpleDnsCrypt.ViewModels.QueryLogViewModel.AddLogLine(QueryLogLine queryLogLine)
SimpleDnsCrypt.ViewModels.QueryLogViewModel.b__24_2()
System.Threading.Tasks.Task.Execute()
--- The end of the stack trace in the previous position where the exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
SimpleDnsCrypt.ViewModels.QueryLogViewModel.d__24.MoveNext()

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.