Closed zandermar18 closed 2 years ago
This is a Quick fix for the issue. Might visit later on .
Thanks for the quick fix, left a comment on the commit about one of the try blocks!
not able to produce the issue so if you can just do the pr where needed
Put up a quick PR. I'm also having issues consistently reproducing the issue, so left it with the quick fix. I'd like to do the permanent at some point using a BlockingCollection<T>
but need to be able to repro consistently first.
When multiple toasts with timers are added to the toaster and at least one (but not all) are dismissed manually before the timeout occurs, an exception is sometimes thrown.
Sometimes an Enumerable out of range exception is thrown at Toaster.cs:71
Sometimes a JSInterop exception is thrown at BSToast.cs:137
It seems to be a transient error and is semi-reproducable. My guess is that the there is a thread concurrency issue going on here. It also appears to only be an issue on Blazor Server and not WASM, further implying it's a thread concurrency issue as WASM is single threaded. However since the root cause is unknown, it can't be ruled out that the issue also occurs on WASM.