HttpClient abort issues in WASM when streaming #112172
Labels
arch-wasm
WebAssembly architecture
area-System.Runtime.InteropServices.JavaScript
os-browser
Browser variant of arch-wasm
Milestone
Description
When doing any form of streaming calls using HttpClient in Blazor WASM, an unhandled exception is shown (red bar by default at the bottom of screen) when there is a connection issue during streaming. I originally posted it in the aspnetcore repo but its a runtime issue.
dotnet/aspnetcore#55982
This can be triggered by a long running IAsyncEnumerable API or GRPC-Web Streaming call, I left a small repo project in the aspnetcore repo bug.
Reproduction Steps
The steps are a reasonably simple but the blazor UI needs to be connected to an api with the ability to remove connectivity (i.e. pulling out the network cable or disconnect wifi or kill the server). So the api needs to be on a different machine or be isolatable from the browser running the blazor wasm UI. Possibly devtunnels would make this easy to reproduce.
Expected behavior
The error is bubbled up to the calling C# code that is calling the streaming.
Actual behavior
Raises an unhandled exception that the caller cannot gracefully handle and reconnect.
Regression?
No response
Known Workarounds
None
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: