From 368720278801ab3004ec85d9b357d7329fa73723 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 16 Apr 2026 03:09:31 +0200 Subject: [PATCH] Gateway: get around some typeorm weirdness --- src/gateway/opcodes/Identify.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts index 23b0353f7..7a322c03a 100644 --- a/src/gateway/opcodes/Identify.ts +++ b/src/gateway/opcodes/Identify.ts @@ -167,6 +167,10 @@ export async function onIdentify(this: WebSocket, data: Payload) { // this.session.status = identify.presence?.status || "online"; this.session.last_seen = new Date(); this.session.client_info ??= {}; + // noinspection SuspiciousTypeOfGuard - typeorm being weird + if (typeof this.session.client_info === "string") this.session.client_info = JSON.parse(this.session.client_info); + // noinspection SuspiciousTypeOfGuard - typeorm being weird + if (typeof this.session.last_seen_location_info === "string") this.session.last_seen_location_info = JSON.parse(this.session.last_seen_location_info); this.session.client_info.platform = identify.properties?.$device ?? identify.properties?.$device; this.session.client_info.os = identify.properties?.os || identify.properties?.$os; this.session.client_status = {};