Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnect doesn't work #41

Closed
Altreus opened this issue Jun 30, 2020 · 0 comments
Closed

Reconnect doesn't work #41

Altreus opened this issue Jun 30, 2020 · 0 comments

Comments

@Altreus
Copy link
Member

Altreus commented Jun 30, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants