Closed itslukej closed 4 years ago
Can reproduce.
Can reproduce.
Perhaps Discord is keeping the websocket open. I haven't read any documentation by Discord for what is the intended behavior is.
A workaround is to rely upon, your shard's lifecycle within the client, rather than the disconnect event. In my client, the disconnect event is used to renew expired sessions.
Which sessions need to be renewed? Lavalink or discord's? And what is a shard life cycle and how'd a wrapper utilize it to avoid those issues?
@Yucked
Discord is sending a close 4014: DISCONNECT when the session is closed. This should not be reconnected but magma does attempt to resume the session which has been fixed in a newer version. See version 0.9.2
4014 | Disconnected | Oh no! You've been disconnected! Try resuming.
https://discordapp.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
:thinking:
Guess that resume is aimed at the main WS connection then.
@napstr the documentation is wrong.
The 4014 close code is an indication that the voice connection was closed because it can no longer exist.
Example:
@napstr I have updated the official docs for this as well: https://github.com/discordapp/discord-api-docs/commit/8ecc02e17b4dc409bd9c8b0bb21c670bd53fd305
In case you want to change your handling too.
Thanks for the headsup @MinnDevelopment. As I mentioned in the JDA server the other day I was a total idiot about the Java 8 Magma thing. We should discuss getting all the stuff into a single repo, please contact me on Discord if you have interest and time.
As per Minn's comments above, this should be fixed since a few versions ago in Magma. Please reopen if still an issue.
Issue: Lavalink Server does not acknowledge when the voice websocket is closed due to a shard being disconnected. It also does not send a
WebSocketClosedEvent
, which is how I discovered this issue.Steps to reproduce: 1) Join the bot into a voice channel 2) Kill the bot's discord connection, whilst keeping the Lavalink socket open 3) Notice the bot has been removed from the voice channel 5) Notice nothing in the Lavalink Server logs and no events sent to the Lavalink Client