From cd5d262c7ef1104c358c1cfc00b2cb8f3dcbb691 Mon Sep 17 00:00:00 2001 From: Dolu Date: Fri, 31 Jul 2026 00:34:55 +0200 Subject: [PATCH] fix(server/accounts): return cached account instance in OxAccount.get The cache lookup discarded its result instead of returning it, so every call fell through to SelectAccount and constructed a new OxAccount. The registry kept the first instance while callers received throwaway ones, and each lookup paid for a redundant query. --- server/accounts/class.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/accounts/class.ts b/server/accounts/class.ts index 4ca4b263..7d506f7e 100644 --- a/server/accounts/class.ts +++ b/server/accounts/class.ts @@ -38,7 +38,9 @@ export class OxAccount extends ClassInterface { protected static members: Dict = {}; static async get(accountId: number) { - if (accountId in this.members) this.members[accountId]; + const account = this.members[accountId]; + + if (account) return account; const validAccount = await SelectAccount(accountId);