[release/10.0] Improve Blazor reconnection experience after the server is restarted#64727
Merged
lewing merged 8 commits intorelease/10.0from Dec 11, 2025
Merged
Conversation
6f87101 to
e20bc6d
Compare
e20bc6d to
7054dee
Compare
…flect change in ResumeCircuit
7054dee to
b5c796b
Compare
javiercn
approved these changes
Dec 11, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Blazor Server reconnection experience after a server restart in .NET 10 by restoring the automatic page reload behavior from .NET 9. When circuit persistence is not available, the client now automatically reloads the page instead of displaying a confusing "reconnection failed" UI that requires manual intervention.
Key Changes:
- Modified client-side reconnection logic to automatically reload the page when the server rejects both reconnection and resume attempts
- Updated error messages to be more user-friendly by offering retry options before requiring a page reload
- Removed server-side error message that was sent when circuit state couldn't be retrieved, allowing the client reconnection logic to handle the scenario gracefully
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectDisplay.ts | Updated button visibility logic and error messages during reconnection/resume failures to show retry option |
| src/Components/Web.JS/src/Platform/Circuits/DefaultReconnectionHandler.ts | Removed unnecessary pause UI display before resume attempt, streamlined to call rejected() directly on failure |
| src/Components/Web.JS/src/Platform/Circuits/UserSpecifiedDisplay.ts | Made reconnect/remote fields public and added remote parameter to resume-failed event for consistency |
| src/Components/Server/src/ComponentHub.cs | Removed error notification to client when circuit state unavailable, allowing client to handle gracefully |
| src/Components/Server/test/Circuits/ComponentHubTest.cs | Removed test assertion for error message that is no longer sent |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor | Improved error message and moved Resume button to be visible in both paused and resume-failed states |
| src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Layout/ReconnectModal.razor.js | Changed catch handler to show resume-failed UI instead of immediately reloading |
| src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs | Added configuration option to disable circuit persistence for testing reconnection without server state |
| src/Components/test/E2ETest/ServerExecutionTests/ServerReconnectionWithoutStateTest.cs | Added comprehensive E2E tests for reconnection scenarios with both default and custom UI |
src/Components/test/E2ETest/ServerExecutionTests/ServerReconnectionWithoutStateTest.cs
Outdated
Show resolved
Hide resolved
src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsStartup.cs
Outdated
Show resolved
Hide resolved
lewing
approved these changes
Dec 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #64732 to release/10.0
Fixes #64228
Description
In .NET 10, resuming a Blazor circuit fails when the server has been restarted (and an out-of-process persistent storage is not used). Currently, this is handled on the client side by displaying a "reconnection failed" UI which requires the user to manually reload the page and can show confusing messages to the user. Previously, in .NET 9 the page would reload automatically once the server has restarted.
This PR re-adds the default reloading behavior and fixes other UX issues with the reconnection worklow.
Customer Impact
The issue makes the reconnection UX worse for any Blazor Server app updated or created with .NET 10. It also impairs the developer experience as developers often rebuild and restart the server application.
Regression?
The observable behavior regressed from .NET 9.
Risk
Fix mostly restores behavior to previous state.
Apart from removing one error message sent by the server, all changes are in the client-side JS code that can be overridden by the users if necessary.
Verification
Packaging changes reviewed?