Discord.js (v12.0.0 last updated 19 Sept 2019) seems to crash with the following trace in a very certain scenario. I have not tested previous Discord,js releases. I have also tested a clean install on Windows.
Reproduction steps (code below)
Connect to a voice channel, bot joins automatically (not move from a channel, connect)
Disconnect (not move to a different channel) from voice, bot stays
Connect back into the same channel
At this point no audio playback can happen from the bot. After 15 seconds the error will be thrown.
This is sort of a joke bot for fun, started noticing it crashing for seemingly no reason, decided to put a clear "disconnect before joining anywhere" and stumbled upon this repro code. As the code shows I tried adding event handlers to everywhere I can, it still crashes, and doesn't fire the event handler.
NodeJS v10.15.3
Logged in as Bottt!
Leaving voice channels... // First join and then leave
Joining channel...
Connection established...
debug! [WS] << {"op":13,"d":{"user_id":"whatever"}}
Leaving voice channels... // Second join
debug! [WS] shutdown requested
debug! [WS] reset requested
debug! [UDP] shutdown requested
debug! disconnect() triggered
debug! Sending voice state update: {"channel_id":null,"guild_id":"whatever","self_mute":false,"self_deaf":false}
debug! Connection clean up
debug! [WS] shutdown requested
debug! [WS] reset requested
disconnect! undefined
Joining channel...
debug! [UDP] socket closed
debug! [WS] closed
events.js:174
throw er; // Unhandled 'error' event
^
Error [VOICE_CONNECTION_TIMEOUT]: Connection not established within 15 seconds.
at VoiceConnection.authenticateFailed (/home/pi/Desktop/git_staging/discord_bot/node_modules/discord.js/src/client/voice/VoiceConnection.js:300:26)
at connectTimeout.client.setTimeout (/home/pi/Desktop/git_staging/discord_bot/node_modules/discord.js/src/client/voice/VoiceConnection.js:322:18)
at Timeout.setTimeout (/home/pi/Desktop/git_staging/discord_bot/node_modules/discord.js/src/client/BaseClient.js:83:7)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
Emitted 'error' event at:
at VoiceConnection.authenticateFailed (/home/pi/Desktop/git_staging/discord_bot/node_modules/discord.js/src/client/voice/VoiceConnection.js:300:12)
at connectTimeout.client.setTimeout (/home/pi/Desktop/git_staging/discord_bot/node_modules/discord.js/src/client/voice/VoiceConnection.js:322:18)
[... lines matching original stack trace ...]
at Timer.processTimers (timers.js:223:10)
Discord.js (v12.0.0 last updated 19 Sept 2019) seems to crash with the following trace in a very certain scenario. I have not tested previous Discord,js releases. I have also tested a clean install on Windows.
Reproduction steps (code below)
This is sort of a joke bot for fun, started noticing it crashing for seemingly no reason, decided to put a clear "disconnect before joining anywhere" and stumbled upon this repro code. As the code shows I tried adding event handlers to everywhere I can, it still crashes, and doesn't fire the event handler.
Reproduction code
Further details:
discord.js version: 12.0.0 (Updated via
npm i discordjs/discord.js
on 19th of September)Node.js version: 10.15.3, also tried 10.16.3
Operating system: Rapbian Stretch?, Windows 10
Priority this issue should have – please be realistic and elaborate if possible: Medium to low
[x] I have also tested the issue on latest master, commit hash: The latest one at the moment of posting this issue.