WS Connection opens and stays open for quite a long time - which is great. If you leave the page for a long time or the computer goes to sleep/hibernation, the WS connection closes and is never re-established.
The use-case of my app is that the users should hear a "ping" noise when a new notification comes. But as the web socket gets disconnected, this does not happen. Maybe the browser closes the connection in background.
As this problem seems to be a general one, how is this handled in industry-ready web-apps?
One follow up: In case of internet connection toggle, can websockets be retried in background if the user hasn't opened the app?