-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpClient abort issues in WASM when streaming #112172
Comments
It looks to me that function handle_abort_error (promise:Promise<any>) {
promise.catch((err) => {
if (err && err !== "AbortError" && err.name !== "AbortError" ) {
Module.err("Unexpected error: " + err);
}
// otherwise, it's expected
});
} Should be changed to function handle_abort_error (promise:Promise<any>) {
promise.catch((err) => {
if (!err)
return;
if (err === "AbortError" || err.name === "AbortError")
return; // normal abort
if (err === "TypeError: network error" || (err.name === "TypeError" && err.message === "network error"))
return; // stream connection failure, should be handled by application
Module.err("Unexpected error: " + err);
});
} Seems like a simple change. |
|
cc @pavelsavara |
Tagging subscribers to 'arch-wasm': @lewing |
Can this bugfix also be added to dotnet8 as not all of us can use dotnet9 |
@radderz thanks for the investigation. Matching on the message text is not ideal. |
@pavelsavara - Not sure I was just guessing how it could be fixed as I don't know how to debug the repo. |
Can this also be fixed in .NET 9? I'm seeing it with 9.0.200, also with gRPC-web streaming, exactly as described here: dotnet/aspnetcore#55982 |
Yea its both 8 and 9, we are moving to 9 soon, i mainly said 8 too please as it'll affect many others that can't move |
chrome streaming req+res
chrome full req + streaming +res
FF streaming req+res
FF full req + streaming +res
|
After thinking bit more, I realized that the Fix #113014 |
Will this fix be done in both dotnet8 and dotnet9? |
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: