Blazor WASM app crashes (runtime terminated) when /bff/user polling times out #649
Unanswered
nickmuller
asked this question in
BFF
Replies: 1 comment
|
Hey @nickmuller, Thanks for the detailed report and stack trace, this helped us to easily confirm the issue. A failed or timed-out poll should be logged and retried instead of crashing the WASM app, and a timeout on its own shouldn't be treated as the user being signed out. Until there's a fix, the workaround you posted (setting the timeout on the named We'll post an update in this discussion when there's news. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Package:
Duende.BFF.Blazor.Client4.3.0 (also present in 4.3.2), .NET 10, Blazor WebAssemblyDescription
BffClientAuthenticationStateProviderpolls/bff/userfromTimerCallbackAsync, which isasync voidand has nocatch.FetchUserService.FetchUserAsynconly catchesHttpRequestExceptionandJsonException.When the poll exceeds
HttpClient.Timeout(100 s by default),HttpClientthrows aTaskCanceledException. Nothing catches it, so it reaches the thread pool and terminates the WebAssembly runtime ([MONO] Process terminated). The page stays visible but no longer responds to input.In practice this happens after the user has been idle for a while, for example when the browser throttles a background tab, the machine wakes from sleep, or the network is temporarily gone.
Steps to reproduce
AddBffBlazorClient()./bff/userfor longer than 100 seconds, after login.Expected: a failed or timed-out poll must never crash the application.
Suggested fix
TimerCallbackAsync, or at leastOperationCanceledException, and log them.Current workaround
This depends on the internal
HttpClientName, so it is fragile.All reactions