Skip to content

Commit a0a93dd

Browse files
committed
workaround for LevelChangedException
1 parent 3e37064 commit a0a93dd

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.2.17
2+
* workaround for LevelChangedException
3+
14
### 1.2.16
25
* avoid WPF contention-inline problems with transaction
36

src/FSharp.Data.Adaptive/Core/AdaptiveObject.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ type AdaptiveObject() =
1717
[<DefaultValue; ThreadStatic>]
1818
static val mutable private CurrentEvaluationDepth : int
1919

20+
static let mutable unsafePerformLevelChecking = true
21+
22+
static member UnsafePerformLevelChecking
23+
with get() = unsafePerformLevelChecking
24+
and set v = unsafePerformLevelChecking <- v
25+
26+
2027
let mutable outOfDate : bool = true
2128
let mutable level: int = 0
2229
let mutable outputs : WeakOutputSet = WeakOutputSet()
@@ -157,7 +164,7 @@ module AdadptiveObjectExtensions =
157164
if depth > 1 then Transaction.RunningLevel - 1
158165
else Transaction.RunningLevel
159166

160-
if x.Level > maxAllowedLevel then
167+
if AdaptiveObject.UnsafePerformLevelChecking && x.Level > maxAllowedLevel then
161168
//printfn "%A tried to pull from level %A but has level %A" top.Id level top.Level
162169
// all greater pulls would be from the future
163170
raise <| LevelChangedException(x.Level + depth)

0 commit comments

Comments
 (0)