Skip to content

Commit aa8c57d

Browse files
authored
fix(WebSocketShard): clear listeners on reconnect (#8927)
1 parent b14604a commit aa8c57d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/discord.js/src/client/websocket/WebSocketShard.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,9 @@ class WebSocketShard extends EventEmitter {
602602
`[WebSocket] did not close properly, assuming a zombie connection.\nEmitting close and reconnecting again.`,
603603
);
604604

605+
// Cleanup connection listeners
606+
this._cleanupConnection();
607+
605608
this.emitClose();
606609
// Setting the variable false to check for zombie connections.
607610
this.closeEmitted = false;

0 commit comments

Comments
 (0)