-
Notifications
You must be signed in to change notification settings - Fork 82
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
Use gateway url provided in Ready
event for resuming
#666
Conversation
@Suppress("UNUSED_VARIABLE") | ||
val exhaustive = when (state.value) { //exhaustive state checking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-exhaustive when statements over sealed types are an error now, so this is no longer needed
private val resumeOrIdentify | ||
get() = when (val sessionId = resumeContext.value?.sessionId) { | ||
null -> configuration.identify | ||
else -> Resume(configuration.token, sessionId, sequence.value ?: 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resumeOrIdentify
combines the previous properties sessionStart
, resume
and identify
so that the session id is only queried once
I reviewed the PR a second time and it looks fine; but it's a draft so I'll be waiting til it's complete |
I made it a draft because of this concern:
But if you say this isn't needed, then this PR is ready. |
The resume will not need to modify anything because the reset or not is handled by the loop conditions |
Problem is that I can't really test rn because they only send the default url until September 12 (which means we connect to the same as normal until then). |
In that case guess there is no need to rush and merge as this may be subject to change |
Converted this back to a draft for now |
a1bb076
to
1e6718a
Compare
# Conflicts: # core/src/main/kotlin/event/gateway/Events.kt
I checked rn, I'm still not receiving a session-specific URL. Will try again later today/tomorrow. |
Still no luck... 😞 |
Still nothing, what should we do? |
I was finally able to receive a different url and test it - seems to work as intended |
relevant doc commits: