From c6547e3f7cf851d5759bedb856ba3c74dcf78800 Mon Sep 17 00:00:00 2001 From: Vinyl-Davyl Date: Tue, 17 Mar 2026 11:35:32 +0100 Subject: [PATCH 1/2] fix: correct debug log filename --- src/utils/debugdb.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/debugdb.ts b/src/utils/debugdb.ts index aa36d8b0..c3825f56 100644 --- a/src/utils/debugdb.ts +++ b/src/utils/debugdb.ts @@ -57,6 +57,6 @@ export function setLogItem(str: string): void { export async function getLogs(): Promise { if (db) { const all = await db.getAll('logs' as never); - downloadString(all.join('\n'), 'text/plain', `logs-${new Date().toISOString()}}.txt`); + downloadString(all.join('\n'), 'text/plain', `logs-${new Date().toISOString()}.txt`); } } From cae4a8b84aed94d3d4720b0defee7ec867f412fc Mon Sep 17 00:00:00 2001 From: Vinyl-Davyl Date: Tue, 17 Mar 2026 11:36:23 +0100 Subject: [PATCH 2/2] fix: route HTTP warnings to debug log --- src/utils/errorlogger.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/utils/errorlogger.ts b/src/utils/errorlogger.ts index 2f374d83..dd180704 100644 --- a/src/utils/errorlogger.ts +++ b/src/utils/errorlogger.ts @@ -1,6 +1,13 @@ -// import { getVersionInfo } from './VERSION'; +import { getVersionInfo } from './VERSION'; +import { setLogItem } from './debugdb'; +/** + * Log a warning to both the browser console and the IndexedDB debug log. + * The debug log can be downloaded via the debug panel, making these warnings + * available in crash reports even when the DevTools console is not open. + */ export function logWarning(str: string, ...arg: unknown[]): void { - console.warn(str, ...arg); - // console.log('Version information: ', getVersionInfo()); + const detail = arg.length > 0 ? ` — ${JSON.stringify(arg)}` : ''; + setLogItem(`WARN ${str}${detail}`); + console.warn(`[${getVersionInfo().env}] ${str}`, ...arg); }