Repository navigation
Description
Parent
What to build
During an Update download (from Yes in Found Updates until Install Updates appears), the main process tracks the download state and the Dock (macOS) or taskbar (Windows, Linux) icon shows its progress. No page dialog yet; that is the next ticket.
Main holds one UpdateDownload state, a type that lives in common beside the other rendererBridge types so the page can import it later:
type UpdateDownload =
| { status: 'idle' } // not started / reset after failure
| { status: 'connecting' } // Yes clicked, no progress event yet
| { status: 'downloading'; percent: number }
| { status: 'restarted'; percent: number } // differential fell back to full
| { status: 'done' }; // update-downloaded firedTransitions: Yes → connecting; each download-progress → downloading with its percent, or restarted (sticky for the rest of the download) when the percent drops; update-downloaded → done; error while not idle → idle.
listenForUpdates takes a third argument, a getter for the current main window or null. Each state change applies the bar to that window: connecting indeterminate (2, skipped on Linux), downloading/restarted percent / 100, done/idle cleared (-1). The download-progress listener is registered at setup, before any download can start. The module exposes a getter for the held state. The main entry passes its window getter and applies the held state's bar to each window it creates, so a reopened macOS window gets the bar back.
On Yes: set connecting, log one start line, call downloadUpdate() and swallow its rejection (the error listener already reports it). On error mid-download, in order: set idle, clear the bar, show the existing native error box unchanged. Log one line when the download finishes or fails; no per-progress logs.
Unchanged: the Found Updates and Install Updates dialogs, autoDownload/autoInstallOnAppQuit, quitAndInstall, window close behaviour, pageWindowPreferences, no new dependency.
Acceptance criteria
-
UpdateDownloadtype exported from common beside therendererBridgetypes - After Yes, the window's bar gets
2on a non-Linux platform; on Linux2is never sent - Each
download-progresssets the bar topercent / 100; a lower percent moves the state torestarted, which stays sticky -
update-downloadedsets the state todoneand the bar to-1 -
errormid-download sets the state toidle, the bar to-1, then shows the error box, in that order - A rejected
downloadUpdate()produces no unhandled rejection - With a window getter returning
null, nothing throws and the held state still advances - A newly created main window gets the held state's bar value
- One log line at download start, one at finish or failure; no progress-event logs
- Vitest covers the above with the existing fake updater and a fake window recording
setProgressBar - The test "Yes downloads the update with no window, bar, or percent" is rewritten to this behaviour; the source-scan test "the shell opens no update progress window" drops its
download-progressban and keeps itselectron-progressbarabsence checks
Activity
Track the Update download in main and show it on the Dock/taskbar icon (
jtklein-agents commentedon Nov 27, 2026
Merged into spec/393-update-download-progress via #397.
Show update download progress in a dialog and on the Dock/taskbar icon (