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

Problems with the implementation of DiscordWebsocketClient #7

Open
1 of 4 tasks
Ayplow opened this issue Aug 14, 2019 · 0 comments
Open
1 of 4 tasks

Problems with the implementation of DiscordWebsocketClient #7

Ayplow opened this issue Aug 14, 2019 · 0 comments
Assignees
Labels
bug Something isn't working component: gateway Issues or Pull Requests addressing the gateway component

Comments

@Ayplow
Copy link

Ayplow commented Aug 14, 2019

  • If DiscordWebsocketClient#close is called while DiscordWebsocketClient#_handle_closure is waiting to restart the connection, it will error due to the absence of _con. The connection will also still restart once the delay is up
  • If bots stays online for too long, _connect and _handle_closure will eventually cause a RecursionError
  • get_message sets up a race condition with the closure of the websocket that means the last time it is awaited before the connection is closed will never resume, preventing the client from ever finishing up.
    • A solution I tried for this was adding self._con._event_queue.put(False) to the close method. This technically works, but is clearly not ideal
  • The heartbeat and restart tasks are not closed with the connection

Side note: DiscordWebsocketClient#_running is synonymous with _con at the moment, it can probably just be removed

@vbe0201 vbe0201 added bug Something isn't working component: gateway Issues or Pull Requests addressing the gateway component labels Aug 15, 2019
@vbe0201 vbe0201 self-assigned this Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: gateway Issues or Pull Requests addressing the gateway component
Projects
None yet
Development

No branches or pull requests

2 participants