Skip to content

Commit 5162cfc

Browse files
committed
fixed dirty tracking in ASet.flattenA/mapA/filterA/chooseA/ofSetTree/ofListTree when application also uses AdaptiveObject.Tag of inputs
1 parent 166cdb2 commit 5162cfc

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.2.23
2+
- fixed dirty tracking in ASet.flattenA/mapA/filterA/chooseA/ofSetTree/ofListTree when application also uses AdaptiveObject.Tag of inputs
3+
14
### 1.2.22
25
- fixed exception in ASet.ofSetTree/ofListTree
36

src/FSharp.Data.Adaptive/AdaptiveHashSet/AdaptiveHashSet.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ module AdaptiveHashSetImplementation =
928928
/// Reader for flattenA
929929
[<Sealed>]
930930
type FlattenAReader<'T>(input : aset<aval<'T>>) =
931-
inherit AbstractDirtyReader<aval<'T>, HashSetDelta<'T>>(HashSetDelta.monoid, isNull)
931+
inherit AbstractDirtyReader<aval<'T>, HashSetDelta<'T>>(HashSetDelta.monoid, (<>) "Input")
932932

933933
let r = input.GetReader()
934934
do r.Tag <- "Input"
@@ -976,7 +976,7 @@ module AdaptiveHashSetImplementation =
976976
/// Reader for mapA
977977
[<Sealed>]
978978
type MapAReader<'A, 'B>(input : aset<'A>, mapping : 'A -> aval<'B>) =
979-
inherit AbstractDirtyReader<aval<'B>, HashSetDelta<'B>>(HashSetDelta.monoid, isNull)
979+
inherit AbstractDirtyReader<aval<'B>, HashSetDelta<'B>>(HashSetDelta.monoid, (<>) "Reader")
980980

981981
let reader = input.GetReader()
982982
do reader.Tag <- "Reader"
@@ -1038,7 +1038,7 @@ module AdaptiveHashSetImplementation =
10381038
/// Reader for chooseA
10391039
[<Sealed>]
10401040
type ChooseAReader<'A, 'B>(input : aset<'A>, f : 'A -> aval<option<'B>>) =
1041-
inherit AbstractDirtyReader<aval<option<'B>>, HashSetDelta<'B>>(HashSetDelta.monoid, isNull)
1041+
inherit AbstractDirtyReader<aval<option<'B>>, HashSetDelta<'B>>(HashSetDelta.monoid, (<>) "Reader")
10421042

10431043
let r = input.GetReader()
10441044
do r.Tag <- "Reader"
@@ -1129,7 +1129,7 @@ module AdaptiveHashSetImplementation =
11291129
/// Reader for filterA
11301130
[<Sealed>]
11311131
type FilterAReader<'A>(input : aset<'A>, predicate : 'A -> aval<bool>) =
1132-
inherit AbstractDirtyReader<aval<bool>, HashSetDelta<'A>>(HashSetDelta.monoid, isNull)
1132+
inherit AbstractDirtyReader<aval<bool>, HashSetDelta<'A>>(HashSetDelta.monoid, (<>) "Reader")
11331133

11341134
let r = input.GetReader()
11351135
do r.Tag <- "Reader"
@@ -1229,7 +1229,7 @@ module AdaptiveHashSetImplementation =
12291229
()
12301230
| _ -> unexpected()
12311231

1232-
| _ -> () // aval<bool> expected to have been removed in this udpate
1232+
| _ -> () // aval<bool> expected to have been removed in this update
12331233

12341234
deltas
12351235

src/FSharp.Data.Adaptive/CollectionExtensions.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ module CollectionExtensions =
286286
/// Reader for ASet.ofListTree
287287
[<Sealed>]
288288
type ListTreeReader<'T>(list: alist<'T>, getChildren : 'T -> alist<'T>) =
289-
inherit AbstractDirtyReader<IIndexListReader<'T>, HashSetDelta<'T>>(HashSetDelta.monoid, isNull)
289+
inherit AbstractDirtyReader<IIndexListReader<'T>, HashSetDelta<'T>>(HashSetDelta.monoid, fun _ -> true)
290290

291291
let mutable initial = true
292292
let reader = list.GetReader() // NOTE: need to be held, otherwise it will be collected and no updates can be consumed
@@ -361,7 +361,7 @@ module CollectionExtensions =
361361
/// Reader for ASet.ofSetTree (delta combine)
362362
[<Sealed>]
363363
type SetTreeReader<'T>(set: aset<'T>, getChildren : 'T -> aset<'T>) =
364-
inherit AbstractDirtyReader<IHashSetReader<'T>, HashSetDelta<'T>>(HashSetDelta.monoid, isNull)
364+
inherit AbstractDirtyReader<IHashSetReader<'T>, HashSetDelta<'T>>(HashSetDelta.monoid, fun _ -> true)
365365

366366
let mutable initial = true
367367
let reader = set.GetReader() // NOTE: need to be held, otherwise it will be collected and no updates can be consumed

0 commit comments

Comments
 (0)