Aspnetcore: Reload the browser when the circuit ID is unknown

Created on 10 Apr 2019  路  8Comments  路  Source: dotnet/aspnetcore

If I launch a components app with dotnet watch run - the reconnection feature doesn't ever seem to do its thing.

image

I can retry, and it will successfully connect (see console output) - but it never updates the UI.

My guess is that this happens because the circuit is gone - it's a new process after all. We should see if we can improve this for inner loopness, and figure out a better experience by default for the case where the circuit is gone.

affected-most area-blazor enhancement help wanted severity-major

Most helpful comment

We discussed this and we think it would help that if the circuit ID is unknown we reload the page.

All 8 comments

@javiercn in case he has cool thoughts

Yeah, my guess is the same as yours. The only option at that point is to F5 the app. We should inform the client that the circuit is gone and provide some button on the UI to refresh the page as at that point the app is gone.

I think this not only applies to developer inner loop. In the future we might want to free up resources in case the app is idle for a while, at that point there should be some integration so that developers can take that into account and provide a good experience.

For example, something like

The application has been inactive for too long so we have ended your current session. 
Click here to refresh the application.

We discussed this and we think it would help that if the circuit ID is unknown we reload the page.

I think that behavior should be configurable. In development mode a reload is fine and most likely expected.

In production, there could be a lot of issues (i.e. server node accidentally or gracefully restarted) and that might involve trying to persist some sort of session state when the server gracefully shuts down and trying to restore that state when a new circuit starts.

Also, the user might want to be informed when he should expect an application reload and possibly loss of data.

What I found:

dotnet watch reconnection

This works:

  1. Create a new blazor server app
  2. Run it with dotnet watch run
  3. Change some files
  4. The restart and reconnection of the server works fine

Restart the server manually

1.- Manually restart the server by killing the process and then dotnet watch run again
2.- Old pages will try to reconnect until they notice the server is no longer the same and will display the following:
image

So, unless I am missing something, this is already working, right?

@barahonajmc Thanks for testing it out! Can you confirm what version you validated this on?

@captainsafia oh I forget that, it was on .NET 5 RC1

Was this page helpful?
0 / 5 - 0 ratings