As simple as it sounds: if the websocket closes, try to re-establish the connection periodically. For example, maybe the network connection dropped and then came back up. Most people expect webmail applications to automatically handle this and not just stop - this way, people can continue to receive notifications without even knowing that anything happened.
As part of this, a hidden menu could be added somewhere to show how long the current connection has been active, for users that want to see these stats on demand.
You must be