Close: use session as predicate rather than session_id due to early init

This commit is contained in:
Rory&
2026-06-22 00:42:11 +02:00
parent 1013bfd5b2
commit 7837a030bc
+2 -1
View File
@@ -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 },
});