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

Add $code parameter to disconnect, reset SEQ on new session, don't re-fetch websocket_url when resuming, make 1000 & 1001 resumable #42

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

incognico
Copy link
Contributor

  • Add $code parameter to $discord->disconnect() to allow for normal closures from a client, e.g. to gracefully close with 1000 after SIGINT
  • Reset SEQ on new sessions so the heartbeating does not use the old SEQ ID until the correct one is received again
  • Don't re-fetch the websocket_url when resuming. Since a while the Mojo UA sometimes gives me a Premature connection close in sub gateway, not sure why - so this is a workaround. But I'm pretty sure that if this url ever changes it would require a new session anyways so why not use the cached one on resume.
  • Make 1000 & 1001 resumable (makes "CloudFlare WebSocket proxy restarting" resumable) Should be fine, the docs only mention a session invalidation on those codes if we close the connection with one of those.

@incognico
Copy link
Contributor Author

ccfbf90 slipped in here. Revert that one (or not), as you wish.

@vsTerminus vsTerminus self-assigned this Apr 26, 2021
@vsTerminus
Copy link
Owner

I've made some of these changes in my local copy. I'll likely end up just closing the pull request once I've pushed my own changes, but thank you, this was helpful.

@vsTerminus
Copy link
Owner

$code parameter added in fa2ed04

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

Successfully merging this pull request may close these issues.

2 participants