Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't check for updates if we already have one downloaded and queued #386

Merged
merged 2 commits into from
Jul 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@ function installUpdate(): void {

function pollForUpdates(): void {
try {
autoUpdater.checkForUpdates();
// If we've already got a new update downloaded, then stop
// trying to check for new ones, as according to the doc
// at https://github.com/electron/electron/blob/main/docs/api/auto-updater.md#autoupdatercheckforupdates
// we'll just keep re-downloading the same update.
// As a hunch, this might also be causing
// https://github.com/vector-im/element-web/issues/12433
// due to the update checks colliding with the pending install
// somehow
if (!latestUpdateDownloaded) {
autoUpdater.checkForUpdates();
} else {
console.log("Skipping update check as download already present");
}
} catch (e) {
console.log('Couldn\'t check for update', e);
}
Expand Down