DynamicData icon indicating copy to clipboard operation
DynamicData copied to clipboard

[Bug]: ArgumentException in TransformAsync(.. transformOnRefresh: true)

Open oysteinkrog opened this issue 3 years ago • 0 comments

Describe the bug 🐞

Bug in recently introduced transformOnRefresh parameter in TransformAsync():

Exception: System.ArgumentException
Message: For ChangeReason.Change, must supply previous value
Source: DynamicData
TargetSite: Void .ctor(DynamicData.ListChangeReason, T, DynamicData.Kernel.Optional`1[T], Int32, Int32)
StackTrace:
   at new DynamicData.Change<T>(ListChangeReason reason, T current, Optional<T> previous, int currentIndex, int previousIndex) in /_/src/DynamicData/List/Change.cs:line 106
   at IChangeSet<TDestination> DynamicData.ChangeSetEx.Transform<TSource, TDestination>(IChangeSet<TSource> source, Func<TSource, TDestination> transformer)+(Change<TSource> change) => { } in /_/src/DynamicData/List/ChangeSetEx.cs:line 88
   at bool System.Linq.Enumerable+SelectListIterator<TSource, TResult>.MoveNext()
   at new System.Collections.Generic.List<T>(IEnumerable<T> collection)
   at new DynamicData.ChangeSet<T>(IEnumerable<Change<T>> items) in /_/src/DynamicData/List/ChangeSet.cs:line 35
   at IChangeSet<TDestination> DynamicData.ChangeSetEx.Transform<TSource, TDestination>(IChangeSet<TSource> source, Func<TSource, TDestination> transformer) in /_/src/DynamicData/List/ChangeSetEx.cs:line 96
   at IObservable<IChangeSet<TDestination>> DynamicData.List.Internal.TransformAsync<TSource, TDestination>.RunImpl()+(ChangeAwareList<TransformedItemContainer> transformed) => { } in /_/src/DynamicData/List/Internal/TransformAsync.cs:line 60

Step to reproduce

Don't yet have repro steps

Reproduction repository

No response

Expected behavior

transformOnRefresh parameter should cause ArgumentException to be thrown internally.

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

DynamicData Version

7.9.14

Additional information ℹ️

No response

oysteinkrog avatar Aug 22 '22 12:08 oysteinkrog