Skip to content

Clarify session invalidation when reconnecting. #7571

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/events/gateway-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ The resumed event is dispatched when a client has sent a [resume payload](/docs/

The reconnect event is dispatched when a client should reconnect to the gateway (and resume their existing session, if they have one). This can occur at any point in the gateway connection lifecycle, even before/in place of receiving a [Hello](/docs/events/gateway-events#hello) event. A few seconds after the reconnect event is dispatched, the connection may be closed by the server.

:::warn
If you plan on resuming your session, remember that closing your websocket connection with a `1000` or `1001` close code will invalidate your current session. Instead, you should use a different close code such as 1005 (Empty) or close the underlying TCP connection directly. Please see the sections on [disconnecting](/docs/events/gateway#disconnecting) and [resuming](/docs/events/gateway-events#resume) for further information.
:::

###### Example Gateway Reconnect

```json
Expand Down