Skip to content

Enhance Blazor Web .reconnect to state whether failures are due to circuit not existing so we can auto-reload page #50979

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

Closed
1 task done
Alerinos opened this issue Sep 28, 2023 · 2 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Docs This issue tracks updating documentation
Milestone

Comments

@Alerinos
Copy link

Alerinos commented Sep 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

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

The custom connection establishment solution is not working in Blazor Web. I discussed a similar problem here #44669, it has also been fixed.

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/signalr.md#automatically-refresh-the-page-when-reconnection-fails-blazor-server

By the way, you can fix the problem of forcing a refresh of the browser window. It should be possible to establish a connection in the state in which it was interrupted.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Sep 28, 2023
@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. Docs This issue tracks updating documentation labels Sep 28, 2023
@mkArtakMSFT mkArtakMSFT added this to the 8.0 milestone Sep 28, 2023
@wtgodbe wtgodbe modified the milestones: 8.0, 8.0.0 Oct 3, 2023
@MackinnonBuck
Copy link
Member

This is probably due to the fact that the shape of the object that gets passed to Blazor.start() has a different shape for blazor.web.js than it does for blazor.server.js.

The example would have to be updated to look like:

Blazor.start({
  circuit: {
    reconnectionHandler: {
      onConnectionDown: () => currentReconnectionProcess ??= startReconnectionProcess(),
      onConnectionUp: () => {
        currentReconnectionProcess?.cancel();
        currentReconnectionProcess = null;
      },
    },
  },
});

@guardrex could we update the docs to include this detail? Thanks!

@mkArtakMSFT
Copy link
Contributor

Closing as the remaing work is tracked by the issue @guardrex filed and linked above (Thanks).

@ghost ghost locked as resolved and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. Docs This issue tracks updating documentation
Projects
None yet
Development

No branches or pull requests

4 participants