Whenever we don't receive a heartbeat we should reconnect.
On the branch refactor-comms I have introduced a WebSocket class, whose job it is to marshal WS messages into the main Connection class. This is supposed to use a migrating Supply so that when a reconnection takes place, the WS class simply emits a new message supply, and the rest of the code should continue.
It appears that it:
Fails to receive a heartbeat
Destroys the current WS
Creates a new WS, with the correct sequence number
Connects to Discord and sends the resume payload
Receives nothing from it
I am unable to prove that this is not my fault - mostly because it probably is. It's hard to believe that Discord is doing it wrong. But I cannot ascertain what part of the mechanism is failing.
It would be good to have #40 going, so that we can use a fake Discord to force the disconnection.
Whenever we don't receive a heartbeat we should reconnect.
On the branch
refactor-comms
I have introduced a WebSocket class, whose job it is to marshal WS messages into the main Connection class. This is supposed to use a migrating Supply so that when a reconnection takes place, the WS class simply emits a new message supply, and the rest of the code should continue.It appears that it:
I am unable to prove that this is not my fault - mostly because it probably is. It's hard to believe that Discord is doing it wrong. But I cannot ascertain what part of the mechanism is failing.
It would be good to have #40 going, so that we can use a fake Discord to force the disconnection.