Skip to content

Commit

Permalink
Add more logging in update scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Jan 23, 2023
1 parent 7c1f186 commit 4fc7c69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ts/updater/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export abstract class Updater {

const mainWindow = this.getMainWindow();
if (mainWindow) {
logger.info('downloadAndInstall: showing update dialog...');
mainWindow.webContents.send('show-update-dialog', DialogType.Update, {
version: this.version,
});
Expand Down
4 changes: 2 additions & 2 deletions ts/updater/macos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class MacOSUpdater extends Updater {
protected async installUpdate(updateFilePath: string): Promise<void> {
const { logger } = this;

logger.info('downloadAndInstall: handing download to electron...');
try {
await this.handToAutoUpdate(updateFilePath);
} catch (error) {
Expand All @@ -41,10 +42,9 @@ export class MacOSUpdater extends Updater {

// At this point, closing the app will cause the update to be installed automatically
// because Squirrel has cached the update file and will do the right thing.
logger.info('downloadAndInstall: showing update dialog...');

this.setUpdateListener(async () => {
logger.info('performUpdate: calling quitAndInstall...');
logger.info('downloadAndInstall: restarting...');
markShouldQuit();
autoUpdater.quitAndInstall();
});
Expand Down
3 changes: 2 additions & 1 deletion ts/updater/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class WindowsUpdater extends Updater {
protected async installUpdate(updateFilePath: string): Promise<void> {
const { logger } = this;

logger.info('downloadAndInstall: showing dialog...');
this.setUpdateListener(async () => {
logger.info('downloadAndInstall: installing...');
try {
await this.install(updateFilePath);
this.installing = true;
Expand All @@ -58,6 +58,7 @@ export class WindowsUpdater extends Updater {
throw error;
}

logger.info('downloadAndInstall: restarting...');
markShouldQuit();
app.quit();
});
Expand Down

0 comments on commit 4fc7c69

Please sign in to comment.