Repository navigation
fix(updates): no install without a staged update, and a tested update flow - #136
Merged
Merged
Conversation
… flow "Restart & Install" showed under "Up to Date" because .btn-p/.btn-g set a display of their own, which beats the user agent's [hidden] rule. Clicking it asked electron-updater to install nothing, which surfaced as UPD-99. The base rule now honours [hidden], and a test fails on any statically hidden element whose class overrides it. The main-process updater moves to electron/updates.cjs so it can be driven by a fake updater in tests/updates.test.js. Along the way: - install is refused unless an update is staged; a failed install is UPD-07 and stops offering the restart - autoInstallOnAppQuit is set on purpose, and "Update Ready" says a staged update installs at the next quit - a long session rechecks every six hours - release notes reach the dialog as plain text under "What's new" - a background download that fails marks the menu item "Update Failed — Retry" - the download promise's rejection is handled; its error is reported once
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.
The bug
The update dialog showed Restart & Install under Up to Date, and clicking it failed with UPD-99.
.btn-p, .btn-g { display: inline-flex }outranks the user agent's[hidden] { display: none }, soupdateInstall.hidden = truenever hid the button. Clicking it calledquitAndInstall()with nothing downloaded, and that error fell through to UPD-99.css/modals.css:.btn-p[hidden], .btn-g[hidden] { display: none }on the base rule; the one local copy inpanels.cssis gone.tests/hidden-markup.test.js: fails on any elementindex.htmlshipshiddenwhose class sets a display without a[hidden]override. Before the fix it flagged exactly#update-install.The update flow
The main-process updater moves from
electron/main.cjstoelectron/updates.cjs.main.cjskeeps only loading electron-updater and the IPC channels, sotests/updates.test.jscan drive the controller with a fake updater.autoInstallOnAppQuitis set deliberately rather than left at its default, and "Update Ready" says a staged update installs the next time the app is closed.textContent.downloadPromiseis now handled; its error is reported once, through the'error'event.js/update-view.js, an import-free module covered by the same tests.Testing
npm test: 2813 pass, 22 of them new.npm run buildsucceeds.