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 silently failing to connect to channel #1242

Merged
merged 15 commits into from
Aug 15, 2022

Conversation

Lunarmagpie
Copy link
Contributor

@Lunarmagpie Lunarmagpie commented Aug 8, 2022

Summary

hikari.impl.VoiceImpl.connect_to would silently fail (awaits function forever) to connect to a voice channel if the guild_id or channel_id was wrong. This PR adds timeout when connecting.hikari.errors.VoiceError is raised when this timeout is reached. A timeout kwarg is added if users want to change the timeout. The default timeout is 5s.

I could not find how they handle errors in this section of the API docs but it looks like they just dont respond with anything so I decided a timeout would be the best implementation.

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Copy link
Member

@davfsa davfsa left a comment

Choose a reason for hiding this comment

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

Thank you for the bug investigation and the fix!

hikari/api/voice.py Outdated Show resolved Hide resolved
hikari/api/voice.py Outdated Show resolved Hide resolved
changes/1242.bugfix.md Outdated Show resolved Hide resolved
@davfsa davfsa added the bug Something isn't working label Aug 9, 2022
Lunarmagpie and others added 2 commits August 9, 2022 16:10
@Lunarmagpie Lunarmagpie requested a review from davfsa August 9, 2022 20:14
hikari/api/voice.py Outdated Show resolved Hide resolved
@Lunarmagpie Lunarmagpie requested a review from davfsa August 9, 2022 20:34
@davfsa davfsa merged commit 882f947 into hikari-py:master Aug 15, 2022
@Lunarmagpie Lunarmagpie deleted the bug/voice-fail-connect branch August 15, 2022 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants