-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add page reload when resuming Blazor circuit fails #64290
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
Open
oroztocil
wants to merge
3
commits into
main
Choose a base branch
from
oroztocil/reload-page-on-resume-failed
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+49
−32
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this cleans the state, should it be silent? Should we log to inform that the automatic reload has started?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know? We do
location.reload()in other places without logging it. (Most people would not see the message anyway if they do not enable preserving logs on navigation in the browser.)Maybe the comment is misleading. The state is "cleaned" implicitly simply because a hard refresh is performed. This is done mainly for the benefit of developers so that they can continue using the page they are working on as soon as the server restarts.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial behavior was to rely on the user to reload, now it's automatic. Can it happen that we get into
failedbecause of a server error and get into reload loop? E.g. 500 -> reload -> 500 -> reload? I mean: if something unexpected like this happens, we should leave some tools for investigation.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not very obvious because the flag that controls this is not-very-descriptively named
reconnectbut theelsebranch (that does the reloading) is executed exactly only in the scenario where we try to resume state and it fails (because the new server instance does not have any state persisted for the circuit). It does not happen on a failed circuit start or a circuit reconnection. It does not happen when the server is not available.Hard reloading the page means starting from scratch (just with the current URL). After the reload we are no longer in either a reconnection nor a resuming scenario. We can get a 404, we can get a new Blazor session, we can probably get some weird states in between - but we do not get a loop, at least not because of this line of code.
Before .NET 10, there was no state resuming so we cannot compare the behavior directly. However, we have been doing
location.reload()when a reconnection attempt is rejected - which happened in the same scenarios as the failed state resuming now.