observability: auto-updater lifecycle events go through appendDebugLog, not console.log
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) <noreply@anthropic.com>
This commit is contained in:
parent
d19e7ebc34
commit
a7f16d8cf8
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user