mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
fix(WebSocketShard): report correct resumed event count (#3019)
This PR attempts to fix the reported resumed event count in the debug output (where it is always displayed only as 1 event replayed) and in the emitted `resumed` event, where it passed the current sequence instead of passing the actual replayed event count (which was an utopic high number for smaller bots on resume).
This commit is contained in:
@@ -49,7 +49,7 @@ class WebSocketShard extends EventEmitter {
|
||||
* @type {number}
|
||||
* @private
|
||||
*/
|
||||
this.closeSequence = 0;
|
||||
this.closeSequence = oldShard ? oldShard.closeSequence : 0;
|
||||
|
||||
/**
|
||||
* The current session id of the WebSocket
|
||||
@@ -223,7 +223,7 @@ class WebSocketShard extends EventEmitter {
|
||||
case WSEvents.RESUMED: {
|
||||
this.trace = packet.d._trace;
|
||||
this.status = Status.READY;
|
||||
const replayed = packet.s - this.sequence;
|
||||
const replayed = packet.s - this.closeSequence;
|
||||
this.debug(`RESUMED ${this.trace.join(' -> ')} | replayed ${replayed} events.`);
|
||||
this.heartbeat();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user