mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix(WebSocketShard): dispatch race condition (#8731)
This commit is contained in:
@@ -383,10 +383,6 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
|||||||
|
|
||||||
switch (payload.op) {
|
switch (payload.op) {
|
||||||
case GatewayOpcodes.Dispatch: {
|
case GatewayOpcodes.Dispatch: {
|
||||||
if (this.status === WebSocketShardStatus.Ready || this.status === WebSocketShardStatus.Resuming) {
|
|
||||||
this.emit(WebSocketShardEvents.Dispatch, { data: payload });
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.status === WebSocketShardStatus.Resuming) {
|
if (this.status === WebSocketShardStatus.Resuming) {
|
||||||
this.replayedEvents++;
|
this.replayedEvents++;
|
||||||
}
|
}
|
||||||
@@ -425,6 +421,8 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
|
|||||||
await this.strategy.updateSessionInfo(this.id, this.session);
|
await this.strategy.updateSessionInfo(this.id, this.session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.emit(WebSocketShardEvents.Dispatch, { data: payload });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user