(potential) bug that may cause heartbeat loop be instantiated multiple times
The heartbeat loop is instantiated each time the websocket connects. This forms a potential risk if the websocket connection is first established and then during the session drops out (potentially multiple times): each time the socket reconnects a new heartbeat loop (might) be initiated.