mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 17:52:55 +00:00
src(WebSocket): fix race condition (#3636)
A race condition caused Client#user to be null in the ready event if the client handled 0 guilds.
This commit is contained in:
parent
b4f00bfb6b
commit
710101c580
2 changed files with 2 additions and 1 deletions
|
|
@ -373,7 +373,6 @@ class WebSocketShard extends EventEmitter {
|
||||||
this.debug(`[READY] Session ${this.sessionID}.`);
|
this.debug(`[READY] Session ${this.sessionID}.`);
|
||||||
this.lastHeartbeatAcked = true;
|
this.lastHeartbeatAcked = true;
|
||||||
this.sendHeartbeat('ReadyHeartbeat');
|
this.sendHeartbeat('ReadyHeartbeat');
|
||||||
this.checkReady();
|
|
||||||
break;
|
break;
|
||||||
case WSEvents.RESUMED: {
|
case WSEvents.RESUMED: {
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,6 @@ module.exports = (client, { d: data }, shard) => {
|
||||||
guild.shardID = shard.id;
|
guild.shardID = shard.id;
|
||||||
client.guilds.add(guild);
|
client.guilds.add(guild);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shard.checkReady();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue