That's what I gathered:
- the browser tab goes to sleep and Blazor is unable to recover when a user comes back to a page. Switching off power-saving mode of the web browser might help.
- the issue of Blazor reconnecting method needs improvement e.g. link link 2. There is a discussion going on GitHub and consensus is that the reconnecting mechanism needs improvement.
Right now we are waiting for a fix, which I saw vaguely scheduled for .NET 8...
The time after the message appears is the timeout for a browser to put tab to sleep. This power saving mode is switched on even on desktops. You can check the setting (and turn it off) in settings of the browser.
As for a command to keep the tab alive, I have not come across such solution. There are a lot of answers online how to reload the page once it goes into sleep, but there are no answers how to prevent it in the first place.
I have even seen a hack involving playing audio to fool heuristics of web browsers which put a Blazor tab to sleep...