jceddy / DailyArenaDeckAdvisor

A Deck Advisor companion App for Magic Arena.
GNU General Public License v3.0
18 stars 7 forks source link

Unhandled Exception in filterTask (ApplyFilters - Main Application) #212

Closed jceddy closed 4 years ago

jceddy commented 4 years ago

An unhandled exception was detected.

Exception:

System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List1.Enumerator.MoveNextRare() at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.<GetEnumerator>d__1.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.d251.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at DailyArena.DeckAdvisor.MetaReport..ctor(ReadOnlyDictionary2 cardsByName, Dictionary2 cardStats, ReadOnlyDictionary2 cardsById, Dictionary2 playerInventoryCounts, List1 archetypes, Boolean rotationProof, Dictionary2 setNameTranslations) at DailyArena.DeckAdvisor.MainWindow.FilterArchetypes(DeckFilters filters, Boolean sort) at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- ---> (Inner Exception #0) System.InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List1.Enumerator.MoveNextRare() at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.OrderedEnumerable1.d1.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.<TakeIterator>d__251.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at DailyArena.DeckAdvisor.MetaReport..ctor(ReadOnlyDictionary2 cardsByName, Dictionary2 cardStats, ReadOnlyDictionary2 cardsById, Dictionary2 playerInventoryCounts, List1 archetypes, Boolean rotationProof, Dictionary2 setNameTranslations) at DailyArena.DeckAdvisor.MainWindow.FilterArchetypes(DeckFilters filters, Boolean sort) at System.Threading.Tasks.Task.Execute()<---

log2020062918.txt

Player.log

jceddy commented 4 years ago

This appears to be a timing issue while changing the filtered card name quickly (re-applying while it's still doing the filtering operation for the previous value). I will add some synchronization code to keep this from happening, which will be deployed in a future release. It seems edge case enough that it doesn't require its own release, though. If I see it come up again, I might bump up its priority.

Closing this issue, but will keep an eye out for similar ones.