Skip to content
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

[Blazor] Improve Blazor Server reconnect UI #55721

Closed
MackinnonBuck opened this issue May 14, 2024 · 0 comments · Fixed by #55723
Closed

[Blazor] Improve Blazor Server reconnect UI #55721

MackinnonBuck opened this issue May 14, 2024 · 0 comments · Fixed by #55723
Assignees
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Milestone

Comments

@MackinnonBuck
Copy link
Member

There are some UX enhancements that we should consider making to the default Blazor Server reconnection dialog:

  • Display how many seconds are remaining until the next reconnection attempt
    • This could either replace the "attempts remaining" status or coexist with it
  • Quickly attempt the initial reconnection and use exponential backoff to progressively increase the reconnect interval
  • Allow the user to manually initiate a reconnect rather than wait for the reconnect interval to complete
  • Automatically refresh the page when the max number of reconnection attempts have been reached
    • We may need some kind of "stateful reconnection" mechanism before adding this to avoid preemptively clearing browser-side state
  • Improve general styling

Related: #32113

@MackinnonBuck MackinnonBuck added enhancement This issue represents an ask for new feature or an enhancement to an existing one area-blazor Includes: Blazor, Razor Components labels May 14, 2024
@MackinnonBuck MackinnonBuck added this to the 9.0-preview5 milestone May 15, 2024
@MackinnonBuck MackinnonBuck self-assigned this May 15, 2024
mkArtakMSFT pushed a commit that referenced this issue May 28, 2024
# Updated Blazor Server reconnect UI

Improves the default Blazor Server reconnect experience according to common customer feedback.

## Description

Makes the following improvements to the Blazor Server reconnect UI:
* Rather than waiting three seconds before attempting reconnection, then waiting an additional default of 20 seconds between successive attempts, the new default settings use a configurable exponential backoff strategy:
  * Retry as quickly as possible for the first 10 attempts
  * Retry every 5 seconds for the next 10 attempts
  * Retry every 30 seconds until reaching the user-configured max retry count
  * **Note**: Customers can configure their own retry interval calculation function to override the default behavior
* When the user navigates back to the disconnected app from another app or browser tab, a reconnect attempt is immediately made
* If the server can be reached, but reconnection fails because server disposed the circuit, a refresh occurs automatically
* The default reconnect UI shows the number of seconds until the next reconnect attempt instead of the number of attempts remaining
* The styling of the default reconnect UI has been modernized

Fixes #55721

## Customer Impact

Customers of apps built using Blazor Server often complain about the reconnection experience, which has motivated Blazor developers to open issues like #32113 suggesting improvements to reduce the amount of time the customer spends looking at the reconnect UI. This PR addresses many of those common concerns by performing reconnection attempts more aggressively. Unless apps have overridden the default reconnection options, they will automatically get thew new reconnect behavior by upgrading to .NET 9. In addition, the default reconnect UI styling has been updated. Styling changes will not affect apps that have overridden the default reconnect UI.

## Regression?

- [ ] Yes
- [X] No

## Risk

- [ ] High
- [ ] Medium
- [X] Low

This change only affects the reconnection experience when using Blazor Server or Server interactivity in a Blazor Web App. We have existing automated tests verifying core reconnect functionality. It's possible that some customers may have been relying on the previous defaults, but they'll still be able to override the new defaults if desired.

## Verification

- [X] Manual (required)
- [X] Automated

## Packaging changes reviewed?

- [ ] Yes
- [ ] No
- [X] N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants