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

don't use resume_gateway_url on resume failure #5323

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion docs/topics/Gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Your client should store the `session_id` and `resume_gateway_url` from the [Rea
}
```

If successful, the gateway will respond by replaying all missed events in order, finishing with a [Resumed](#DOCS_TOPICS_GATEWAY/resumed) event to signal replay has finished, and all subsequent events are new. It's also possible that your client cannot reconnect in time to resume, in which case the client will receive a [Opcode 9 Invalid Session](#DOCS_TOPICS_GATEWAY/invalid-session) and is expected to wait a random amount of time—between 1 and 5 seconds—then send a fresh [Opcode 2 Identify](#DOCS_TOPICS_GATEWAY/identify).
If successful, the gateway will respond by replaying all missed events in order, finishing with a [Resumed](#DOCS_TOPICS_GATEWAY/resumed) event to signal replay has finished, and all subsequent events are new. It's also possible that your client cannot reconnect in time to resume, in which case the client will receive a [Opcode 9 Invalid Session](#DOCS_TOPICS_GATEWAY/invalid-session) and is expected to wait a random amount of time—between 1 and 5 seconds—then send a fresh [Opcode 2 Identify](#DOCS_TOPICS_GATEWAY/identify). The fresh identify should not use the `resume_gateway_url`; instead it should use the normal websocket endpoint from the [Get Gateway](#DOCS_TOPICS_GATEWAY/get-gateway) or the [Get Gateway Bot](#DOCS_TOPICS_GATEWAY/get-gateway-bot) endpoints.
Copy link
Member

@DV8FromTheWorld DV8FromTheWorld Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note,

It's also possible that your client cannot reconnect in time to resume, in which case the client will receive a Opcode 9 Invalid Session and is expected to wait a random amount of time—between 1 and 5 seconds—then send a fresh Opcode 2 Identify.

This content is odd. It feels like this is saying "you can waiting 1-5 seconds after receiving an Op 9 and then send an IDENTIFY on the same WS connection that you received the Op 9 on" instead of tearing down the WS connection and starting a new one.

Your followup message does clarify that users should not reused the Op 9'd WS connection, but I think it's something important to call out here that is odd and has historically been odd as I think some users actually do just send IDENTIFY on the same WS without teardown and reconnect after Op 9 response from RESUME. 😕


Failure to respect the `resume_gateway_url` may result in your client being forced to reconnect again after a short period of time.

Expand Down