Skip to content
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

fix(voice): mark stream as ended #10455

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nyapat
Copy link
Contributor

@nyapat nyapat commented Aug 22, 2024

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

closes #8778

example:

  • subscribe to user.
  • user starts speaking (pipeline is: check if subscription exists, if stream exists, voice packets are decrypted, and pushed to stream)
  • user stops speaking (specifically when endbehavior aftersilence or afterinactivity determines its 'stopped', push null to mark end)
  • user starts speaking (subscription exists: yep, stream exists: yep, push to stream!)
  • error: pushing after stream EOF

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

refactor: prefer destroying the stream
@nyapat nyapat requested a review from a team as a code owner August 22, 2024 12:16
Copy link

vercel bot commented Aug 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Aug 25, 2024 9:53am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Aug 25, 2024 9:53am

Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, can we get a test script for this too? 🙏

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.77%. Comparing base (8fb4008) to head (d6a380e).
Report is 52 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10455   +/-   ##
=======================================
  Coverage   50.77%   50.77%           
=======================================
  Files         228      228           
  Lines       20711    20713    +2     
  Branches     1258     1259    +1     
=======================================
+ Hits        10515    10517    +2     
  Misses      10152    10152           
  Partials       44       44           
Flag Coverage Δ
voice 63.71% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nyapat nyapat marked this pull request as draft August 23, 2024 10:25
@nyapat
Copy link
Contributor Author

nyapat commented Aug 23, 2024

drafted because putting tests was a good idea and i found undesirable behaviour (particularly annoying because the tests & actual context of the function don't align properly)

test: wait duration ms to check end

chore: eslint

test: end before timeout
@nyapat nyapat marked this pull request as ready for review August 25, 2024 09:53
@nyapat nyapat requested a review from vladfrangu August 31, 2024 03:26
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering voice is an "if may work" basis, and assuming you've tested this with actual discord behavior, LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Voice receiver stream error
2 participants