-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Reconnection enhancements #12442
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
Comments
This will also solve the problem for iOS webclip "PWA's", which cannot be refreshed by nature. |
@SteveSandersonMS / @rynowak this seems like the wrong solution to me. If something bad happens on the client or server and we then start auto-refreshing the page the user will lose all logs/console output from the page due to the refresh. A good example of this being a poor experience for developers is if a user is doing a specific workflow that breaks the server or client and you enter into this failed reconnection state -> page auto refreshes -> you're now back into a "valid" state;, all the logs for how you got into the original invalid state are now gone unless you manually captured them during the brief time that reconnection was occuring. A better solution would be to:
I lean towards 1 primarily because a user having their own reconnect display will be a must for any proper Blazor server side site. I'm less enthused by 2 because having a rando flag that you turn on-off depending on if you're in production or not (in JS) would add to the complexity. Thoughts? |
Another route would be to pass additional information to |
- Updated text of reconnect dialog to be more clear. - Added user feedback to the `Retry` event button click. The current flow is `Attempting to reconnect` -> `Failed to reconnect ... [Retry]` -> Click Retry -> `Attempting to reconnect`. - Found that in cases where the server went away entirely the reconnect event would through unexpectedly preventing the reconnect display from handling a failed reconnect. Added a separate error flow to understand when the server went away/could not start a SignalR connection to. - Could not find a great way to add tests for this scenario. Addresses #12442
- Updated text of reconnect dialog to be more clear. - Added user feedback to the `Retry` event button click. The current flow is `Attempting to reconnect` -> `Failed to reconnect ... [Retry]` -> Click Retry -> `Attempting to reconnect`. - Found that in cases where the server went away entirely the reconnect event would through unexpectedly preventing the reconnect display from handling a failed reconnect. Added a separate error flow to understand when the server went away/could not start a SignalR connection to. - Could not find a great way to add tests for this scenario. Addresses #12442
- Updated text of reconnect dialog to be more clear. - Added user feedback to the `Retry` event button click. The current flow is `Attempting to reconnect` -> `Failed to reconnect ... [Retry]` -> Click Retry -> `Attempting to reconnect`. - Found that in cases where the server went away entirely the reconnect event would through unexpectedly preventing the reconnect display from handling a failed reconnect. Added a separate error flow to understand when the server went away/could not start a SignalR connection to. - Could not find a great way to add tests for this scenario. Addresses #12442
Given the lack of responses here I'm going to just pick something that feels the most "right" to me. I plan to expand export interface ReconnectDisplay {
show(): void;
hide(): void;
failed(): void;
rejected(): void;
} And our default implementation of If you don't like this suggestion please let me know. |
- Updated text of reconnect dialog to be more clear. - Added user feedback to the `Retry` event button click. The current flow is `Attempting to reconnect` -> `Failed to reconnect ... [Retry]` -> Click Retry -> `Attempting to reconnect`. - Found that in cases where the server went away entirely the reconnect event would through unexpectedly preventing the reconnect display from handling a failed reconnect. Added a separate error flow to understand when the server went away/could not start a SignalR connection to. - Could not find a great way to add tests for this scenario. Addresses #12442
- Updated text of reconnect dialog to be more clear. - Added user feedback to the `Retry` event button click. The current flow is `Attempting to reconnect` -> `Failed to reconnect ... [Retry]` -> Click Retry -> `Attempting to reconnect`. - Found that in cases where the server went away entirely the reconnect event would through unexpectedly preventing the reconnect display from handling a failed reconnect. Added a separate error flow to understand when the server went away/could not start a SignalR connection to. - Could not find a great way to add tests for this scenario. Addresses #12442
- Expanded `ReconnectDisplay` to have a `refused` 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
- 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
- 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
Following on from work done for #11999, here are some improvements to reconnection that we'd like to make:
sessionStorage
to say we did an auto-reload, clear that flag the next time a connection is successful, and don't do an auto-reload any time the flag is still there.The latter one would give the biggest benefit, as it's useful not only in production but also in development. This is the flow that happens each time you change your code and rebuild the application.
The text was updated successfully, but these errors were encountered: