I'm encountering a critical issue in my Blazor Web App developed with .NET 8.0.
The problem occurs when I switch to a different browser tab and then return to the tab with my Blazor app. Every time I do this, the page reloads unexpectedly. This causes significant issues, especially with forms, as any data previously entered is lost when the page reloads. This is problematic because users may need to switch tabs for research or reference, and their form data should remain intact.
Storing and restoring form data after a page reload isn't a feasible solution due to the project's scale.
After some research, which was challenging due to limited documentation, I believe the issue might be related to the SignalR connection. It appears that the SignalR connection is being dropped when the app's tab is inactive, forcing the page to reload whenever it is reopened. The same behavior occurs even when switching to another application and then returning to the browser.
What I would like to achieve is ensuring that the SignalR connection remains active at all times unless the user manually refreshes or closes the tab.
Has anyone encountered this issue, or can you suggest a solution to keep the SignalR connection alive?
Thank you in advance!
Program.cs