Skip to content

Commit

Permalink
fix(WebSocketShard): clear listeners on reconnect (#8927)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qjuh committed Dec 14, 2022
1 parent b14604a commit aa8c57d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/discord.js/src/client/websocket/WebSocketShard.js
Expand Up @@ -602,6 +602,9 @@ class WebSocketShard extends EventEmitter {
`[WebSocket] did not close properly, assuming a zombie connection.\nEmitting close and reconnecting again.`,
);

// Cleanup connection listeners
this._cleanupConnection();

this.emitClose();
// Setting the variable false to check for zombie connections.
this.closeEmitted = false;
Expand Down

0 comments on commit aa8c57d

Please sign in to comment.