Repository navigation
Desktop updater: no quit-and-vanish on macOS, no stuck AppImage install, no stale tray checkbox - #1927
Merged
Conversation
An app run from its disk image, a translocated copy, or one in a folder the account cannot write to staged every release, then quit at the next quiet spell into a swap that failed before it reopened the app. Such an app now stages nothing and says why. A swap that fails still reopens the running version after a restart and throws the download away, and the release it could not put in place is not staged again.
electron-updater hands a started download back from checkForUpdates, and that promise rejects when the download fails, after the error listener has already recorded it. Nothing held it, so a dropped connection mid-download ended in Electron's modal main-process error box on Windows and Linux.
electron-updater latches install() on its first call and only its own quitAndInstall releases it, so after one failed AppImage install every later one was ignored while the next check said ready again, and the quiet install retried every minute for nothing. The updater now releases the latch and reports the failure, and an AppImage in a folder this account cannot write to is not offered as ready.
Electron ticks a checkbox in the native menu before the row's handler runs. When Start at login or Notifications while closed then failed, the next template matched the one shown, the menu was not replaced, and the box kept claiming a state that was not true. A checkbox click now makes the next redraw replace the menu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
install()latches on its first call, and only its ownquitAndInstallresets it. After one failed install, every later one was silently ignored while the next check said "ready" again, so the quiet install retried about every minute and "Restart to update" did nothing. The updater now resets the latch and reports the failure. An AppImage in a folder the account cannot write to is not offered as ready at all.Verification
npm run typecheck: clean.--maxWorkers=3): 844 files, 11376 tests, all passed.desktop-update-unreplaceable-app.test.ts. Before the fix, an app in a read-only folder was staged ("ready"), and a release whose swap had failed was staged again.desktop-updater.test.ts, swap-script cases extended. Before the fix, a failedmvopened nothing and the script did not record the failed release. A faileddittoexited 0 and recorded nothing, and a successful swap left a stale note in place.desktop-update-download-failure.test.ts. Before the fix, one unhandled rejection (net::ERR_NETWORK_CHANGED) reached the process on both linux and win32.desktop-update-appimage-failed-install.test.ts. Before the fix, the second install was ignored (1 attempt instead of 2) and the state stayed "ready". An unwritable AppImage location was also reported as "ready".desktop-tray-checkbox-revert.test.ts. Before the fix, the checkbox stayed ticked after a failed toggle.skip-gates.mjs. The Windows skip total inpublish.ymland inskip-gate-inventory.test.tsgoes from 53 to 54.