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: pass mid-connection WS events to task #269

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

FelixMcFelix
Copy link
Member

Discord will send GatewayEvent::Speaking (opcode 5) messages after the Hello+Ready exchange, but will happily interleave them with crypto mode negotiation. We were previously not expecting such messages and dropping them -- this hurts receive-based bots' ability to map SSRCs to UserIds when joining a call with existing users.

This PR feeds all unexpected messages into the WS task directly, which will handle them once all tasks are fully started.

Discord will send `GatewayEvent::Speaking` (opcode 5) messages
after the Hello+Ready exchange, but will happily interleave
them with crypto mode negotiation. We were previously not expecting
such messages and dropping them -- this hurts receive-based bots'
ability to map SSRCs to UserIds when joining a call with existing
users.

This PR feeds all unexpected messages into the WS task directly,
which will handle them once all tasks are fully started.
@FelixMcFelix FelixMcFelix merged commit 17993bc into serenity-rs:current Nov 26, 2024
11 checks passed
@FelixMcFelix FelixMcFelix deleted the catch-conn-ws branch November 26, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant