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

Only reset sessionID when close code is 1000 or 4006 #3213

Merged
merged 2 commits into from
Apr 17, 2019
Merged

Only reset sessionID when close code is 1000 or 4006 #3213

merged 2 commits into from
Apr 17, 2019

Conversation

Deivu
Copy link
Contributor

@Deivu Deivu commented Apr 17, 2019

Please describe the changes this PR makes and why it should be merged:
This resolves #3191 where in resumed never fires.

I don't think 1001 should be included on resetting the sessionID based on Line 372 & 373 of https://github.com/discordjs/discord.js/blob/master/src/client/websocket/WebSocketShard.js

Using latest master with this modification fixed my issue entirely, refer to screenshot below.
https://media.discordapp.net/attachments/222197033908436994/568036331452891146/unknown.png?width=297&height=211

Status

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@amishshah
Copy link
Member

Thanks very much for your PR!

According to this flowchart, the session only remains valid if the close code is not 1000 or 4006 -- looks like we're using some old code from when this may have not been the case.

image

Could you update the PR to invalidate the session ID if the code is one of these two?

Thanks!

@Deivu Deivu changed the title Event code 1001 should not get its sessionID reset Only reset sessionID when close code is 1000 or 4006 Apr 17, 2019
@Deivu
Copy link
Contributor Author

Deivu commented Apr 17, 2019

Done updating the pr

@amishshah amishshah merged commit b532029 into discordjs:master Apr 17, 2019
samsamson33 pushed a commit to samsamson33/discord.js that referenced this pull request Feb 27, 2020
* Event code 1001 should not get its sessionID reset

* Reset sessionID when close code is 1000 or 4006
samsamson33 added a commit to samsamson33/discord.js that referenced this pull request Feb 27, 2020
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.

shardResumed & resume event doesn't seem to emit.
2 participants