-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Improves further on Blazor reconnection experience. #13152
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
Conversation
@@ -37,13 +37,8 @@ async function boot(userOptions?: Partial<BlazorOptions>): Promise<void> { | |||
} | |||
|
|||
const reconnection = existingConnection || await initializeConnection(options, logger); | |||
if (reconnection.state !== signalR.HubConnectionState.Connected) { |
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.
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.
So do we need to do something here to throw? Who's actually doing the throwing in this case?
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.
SignalR's throwing, I considered throwing a custom exception but I felt the need to back this out after the throwing from SignalR seemed to absolutely be intentional.
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.
You sound extra surprised though. Would you rather me throw a custom exception?
- Expanded `ReconnectDisplay` to have a `rejected` method on it. This is the method that indicates we will never be able to reconnect to the server. By default we provide a nice little message letting users know that reconnection is no longer possible and that a refresh must take place. - Added a logger to the `DefaultReconnectionDisplay` since part of its job is handling `Retry` clicks which indirectly call `reconnect()`. Therefore, it needed the ability to log information to the console to inform users why certain reconnects were not possible. - Updated the `UserSpecifiedDisplay` to have a `refused` understanding. Added a new CSS class to represent the `refused` state as well. - Updated existing tests to abide by the new `ReconnectDisplay` structure - Added a new test to validate that the `refused``ReconnectDisplay` method results in proper behavior. #12442
ea2a047
to
7648018
Compare
This comment was made automatically. If there is a problem contact [email protected]. I've triaged the above build. I've created/commented on the following issue(s) |
🆙 📅 'd to address the refused -> rejected rename. Let me see that ✔️! |
ReconnectDisplay
to have arefused
method on it. This is the method that indicates we will never be able to reconnect to the server. By default we provide a nice little message letting users know that reconnection is no longer possible and that a refresh must take place.DefaultReconnectionDisplay
since part of its job is handlingRetry
clicks which indirectly callreconnect()
. Therefore, it needed the ability to log information to the console to inform users why certain reconnects were not possible.UserSpecifiedDisplay
to have arefused
understanding. Added a new CSS class to represent therefused
state as well.ReconnectDisplay
structurerefused``ReconnectDisplay
method results in proper behavior.#12442