Skip to content

Conversation

silasary
Copy link
Member

@silasary silasary commented Jun 16, 2023

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

During Voice reconnect, we briefly set the websocket to None: https://github.com/interactions-py/interactions.py/blob/stable/interactions/api/voice/voice_gateway.py#L222-L236

If the keepalive triggers during that await, self.ws is None, and we get a lovely error.

Changes

Do a null check before checking self.ws.connected

Related Issues

https://canary.discord.com/channels/789032594456576001/1095994644929708083/1118804300357967872
https://github.com/interactions-py/interactions.py/actions/runs/5285126118/jobs/9563299904

Test Scenarios

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.05 ⚠️

Comparison is base (9fc1aed) 60.19% compared to head (b28b927) 60.14%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1449      +/-   ##
============================================
- Coverage     60.19%   60.14%   -0.05%     
============================================
  Files           139      139              
  Lines         14714    14714              
============================================
- Hits           8857     8850       -7     
- Misses         5857     5864       +7     
Impacted Files Coverage Δ
interactions/api/voice/voice_gateway.py 78.62% <100.00%> (+0.38%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@LordOfPolls LordOfPolls merged commit e7b06a8 into unstable Jun 17, 2023
@LordOfPolls LordOfPolls deleted the voice-reconnect-race branch June 17, 2023 06:12
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.

3 participants