Skip to content

Blazor Server keep-alive & reconnection issues #48724

@garrettlondon1

Description

@garrettlondon1

Is there an existing issue for this?

  • No

Is your feature request related to a problem? Please describe the problem.

SignalR connection has a Keep-Alive (default 15 seconds) which is the criteria for the reconnection modal appearing.

This means if a button is clicked on Web, and the keep-alive just triggered 1 second ago, when the client disconnects they're waiting 14 seconds for the reconnection modal..

No DOM updates can be communicated over SignalR and user can continue clicking buttons

The worst part of this is:

  • Dom events build up and are transmitted to the server on reconnection

This is a very poor user experience for users who expect feedback from buttons/actions that cannot be communicated from the server to the client via the broken socket connection.

  • There are additional consequences for the server side

The developer has no way of intercepting any client side event within this potential 14 seconds of UI interaction

The reconnection modal is fine, you can customize the appearance pretty nicely. It's just about the developer meeting the reconnection process when it happens, not 15 seconds after it happens

Repro steps

  • Create a Blazor Server app and run it
  • Browse to the app with the browser dev tools open
  • On the networking tab in the browser dev tools set the network throttling to offline
  • Try to use the app

Expected result: The disconnected UI is displayed almost immediately prior to or in response to any UI interactions
Actual result: The disconnected UI isn't displayed and clicking on the UI elements does nothing for about 15sec

Describe the solution you'd like

Have not thought about the implications of this, but depending on client side interactions, we could reset the keep-alive and ping on every @onclick handler (or any other condition) and throttle it every 2-3 seconds to prevent continuous pinging of the server if a user spam clicks?

It seems silly to prevent the .1% or less times that the user will get disconnected and experience UI hanging, but it is such a significant issue (if reconnect modal doesn't properly appear), that I feel it's warranted.

Additional context

Yes state being lost, and ability to resume circuits is important, but I think this is a bigger fundamental problem. One experience of this will pretty much turn you off of the framework for any enterprise web app, and send you the SPA way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions