From a7f16d8cf83fa3434ffee5908431c51d9722267e Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Mon, 11 May 2026 06:21:35 +0200 Subject: [PATCH] observability: auto-updater lifecycle events go through appendDebugLog, not console.log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four autoUpdater event handlers (checking-for-update, update-available, update-not-available, update-downloaded) were logging via raw console.log while the sibling 'error' handler already used appendDebugLog. Two consequences: 1. In a packaged build the user has no visible record of the update lifecycle — console.log streams to stderr which is invisible without DevTools. appendDebugLog writes to the timestamped debug log file that the user can inspect via the Live Debug-Log card in Settings. 2. Inconsistent — the existing 'auto-updater-error' tag in line 6479 was the only update-related event reaching the debug log. New tags ('auto-updater-checking', 'auto-updater-update-available', 'auto-updater-update-not-available', 'auto-updater-update-downloaded') give the full lifecycle a coherent grep-friendly prefix in the log. The version info that was being printed inline ("Update available: 4.7.0") now lives in the structured details payload instead of a free-form message — easier to parse mechanically and matches the rest of the codebase's debug-log conventions. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 35d3a4d..925840c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6392,7 +6392,7 @@ function setupAutoUpdater() { autoUpdater.autoRunAppAfterInstall = true; autoUpdater.on('checking-for-update', () => { - console.log('Checking for updates...'); + appendDebugLog('auto-updater-checking'); mainWindow?.webContents.send('update-checking'); }); @@ -6416,7 +6416,7 @@ function setupAutoUpdater() { compareUpdateVersions(downloadedUpdateVersion, incomingVersion) === 0 ); - console.log('Update available:', displayVersion); + appendDebugLog('auto-updater-update-available', { version: displayVersion }); if (!hasAlreadyDownloadedThisVersion) { autoUpdateReadyToInstall = false; } @@ -6440,7 +6440,7 @@ function setupAutoUpdater() { }); autoUpdater.on('update-not-available', () => { - console.log('No updates available'); + appendDebugLog('auto-updater-update-not-available'); mainWindow?.webContents.send('update-not-available'); }); @@ -6460,7 +6460,7 @@ function setupAutoUpdater() { autoUpdater.on('update-downloaded', (info) => { const downloadedVersion = normalizeUpdateVersion(info.version) || info.version; - console.log('Update downloaded:', downloadedVersion); + appendDebugLog('auto-updater-update-downloaded', { version: downloadedVersion }); autoUpdateReadyToInstall = true; autoUpdateDownloadInProgress = false; downloadedUpdateVersion = downloadedVersion;