mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01: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:
@@ -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();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user