From 7837a030bcf069b9f243a067a02be0a6171de4ec Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 22 Jun 2026 00:42:11 +0200 Subject: [PATCH] Close: use session as predicate rather than session_id due to early init --- src/gateway/events/Close.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gateway/events/Close.ts b/src/gateway/events/Close.ts index 7a8d79edf..0cdd57416 100644 --- a/src/gateway/events/Close.ts +++ b/src/gateway/events/Close.ts @@ -30,7 +30,7 @@ export async function Close(this: WebSocket, code: number, reason: Buffer) { this.inflate?.close(); this.removeAllListeners(); - if (this.session_id) { + if (this.session) { const authSessionId = this.session?.session_id; const closedAt = Date.now(); @@ -66,6 +66,7 @@ export async function Close(this: WebSocket, code: number, reason: Buffer) { } }, 10_000); + if (!this.user_id) console.error("No user id in websocket???", this); const voiceState = await VoiceState.findOne({ where: { user_id: this.user_id }, });