discordjs / voice

Implementation of the Discord Voice API for discord.js and other JS/TS libraries
Apache License 2.0
328 stars 112 forks source link

fix(VoiceConnection): stuck on signalling state when rejoining the same channel on ready state #139

Closed skick1234 closed 3 years ago

skick1234 commented 3 years ago

Please describe the changes this PR makes and why it should be merged:

When using <VoiceConnection>.rejoin() with the same channel on ready state, the networking state is not changed. This makes the connection state stuck on the signalling status.

Status and versioning classification:

codecov[bot] commented 3 years ago

Codecov Report

Merging #139 (5ab967c) into main (408999d) will increase coverage by 0.07%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #139      +/-   ##
==========================================
+ Coverage   67.63%   67.70%   +0.07%     
==========================================
  Files          19       19              
  Lines         893      895       +2     
  Branches      212      214       +2     
==========================================
+ Hits          604      606       +2     
  Misses        287      287              
  Partials        2        2              
Impacted Files Coverage Δ
src/VoiceConnection.ts 85.71% <100.00%> (+0.21%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 408999d...5ab967c. Read the comment docs.

skick1234 commented 3 years ago

If there is a new voice server when Discord receives the new voice state, the voice connection automatically re-enters the connecting state even if it's already in the Ready state.

I read the signalling status description so I thought it's necessary to check it.

Anyway, I removed it :>