discordjs / voice

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

feat: add ping stats #77

Closed amishshah closed 3 years ago

amishshah commented 3 years ago

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

Resolves #70.

Fixes a bug in VoiceWebSocket where if no heartbeat acknowledge was ever received, then the WebSocket would continually keep heartbeating instead of disconnecting.

Adds tests to VoiceWebSocket and the new feature.

Status and versioning classification:

codecov[bot] commented 3 years ago

Codecov Report

Merging #77 (34e37b4) into main (f140bd4) will increase coverage by 5.00%. The diff coverage is 80.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
+ Coverage   44.01%   49.02%   +5.00%     
==========================================
  Files          15       15              
  Lines         602      616      +14     
  Branches      133      135       +2     
==========================================
+ Hits          265      302      +37     
+ Misses        335      312      -23     
  Partials        2        2              
Impacted Files Coverage Δ
src/VoiceConnection.ts 79.27% <0.00%> (-2.21%) :arrow_down:
src/networking/Networking.ts 3.93% <ø> (ø)
src/networking/VoiceWebSocket.ts 88.09% <94.44%> (+88.09%) :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 f140bd4...34e37b4. Read the comment docs.

amishshah commented 3 years ago

Converting this PR back to a draft until tests can be implemented for it.