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

Conversation

daisyzhou
Copy link
Contributor

No description provided.

@@ -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. 😕

@shaydewael
Copy link
Contributor

in #5374

@shaydewael shaydewael closed this Sep 9, 2022
@shaydewael shaydewael deleted the gateway-resume-fail branch September 9, 2022 19:01
@ooliver1
Copy link

ooliver1 commented Sep 9, 2022

in #5374

#5282 (comment)
so is this true or not? Its great to have a "maybe", but solid documentation - that is 'guaranteed' to stay (hopefully) for the same API version - is better.

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.

4 participants