From cc5232030fe2a58d1c22b7e786f1b721fd0d6d2c Mon Sep 17 00:00:00 2001 From: Terncode Date: Tue, 17 Nov 2026 18:09:23 +0100 Subject: [PATCH] Fix saving last user agent and browser id --- src/ts/server/routes/api1.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ts/server/routes/api1.ts b/src/ts/server/routes/api1.ts index 03c0c5e..827eea8 100644 --- a/src/ts/server/routes/api1.ts +++ b/src/ts/server/routes/api1.ts @@ -4,6 +4,7 @@ import { offline, hash, handleJSON } from '../requestUtils'; import { createGetAccountData } from '../api/account'; import { Settings, ServerConfig } from '../../common/adminInterfaces'; import { includes } from '../../common/utils'; +import { logger } from '../logger'; const blockApps: string[] = []; const MAX_CONCURRENT_REQUESTS = 100; @@ -26,7 +27,8 @@ export default function (server: ServerConfig, settings: Settings) { (lastBrowserId && account.lastBrowserId !== lastBrowserId)) { account.lastUserAgent = lastUserAgent; account.lastBrowserId = lastBrowserId; - Account.updateOne({ _id: account._id }, { lastUserAgent, lastBrowserId }); + Account.updateOne({ _id: account._id }, { lastUserAgent, lastBrowserId }).exec() + .catch(e => logger.error(e)); } return await getAccountData(account);