Skip to content

show download progress for in-app updates - #19596

Merged
kevinushey merged 4 commits into
mainfrom
feature/update-download-progress
Nov 12, 2026
Merged

kevinushey merged 4 commits into
mainfrom
feature/update-download-progress

Conversation

@kevinushey

@kevinushey kevinushey commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Addresses #17173.

After "Install and Restart", the "Downloading RStudio ..." label showed only a spinner for the whole download (~770 MB on macOS). It now also shows how far along the download is, as a percentage beside the text. Room for the percentage is set aside from the start, so the label keeps its size as the value changes.

Approach

  • Desktop: the updater tells GWT each new whole percentage through a new desktopHooks.onUpdateDownloadProgress(version, percent) hook; a download arrives in thousands of chunks, so only changes are sent. A repeat request, or one for another build refused while a download runs, gets the running build's current percentage again, so GWT can show its indicator. The dock / taskbar progress bar now follows the real fraction on macOS too.
  • Windows: the installer download already reported a fraction; it is just routed to the hook as well.
  • macOS: Electron's autoUpdater has no progress event. The loopback listener that already served Squirrel its one-entry feed (now squirrel-relay.ts) also relays the zip from the builds site and counts the bytes. Squirrel still checks the feed's SHA-256 and size and the bundle's signature. Paths on the listener are random, so only Squirrel can start a download through it. downloadWithSquirrel() owns each download's relay and autoUpdater listeners: whichever of the relay and Squirrel reports first settles it (a failed relayed download is reported with the relay's reason), and both are gone once it settles. The download loop is shared with the Windows staging code (downloadArtifact()), so both get the same idle-stall timeout.
  • GWT: SlideLabel has an optional percentage column: a hidden sizer holding "100%" in the locale's format, with the value drawn right-aligned over it. GlobalDisplay.showPercentProgress() exposes it. The label's progressbar role now carries aria-valuenow.

Tradeoffs:

  • Squirrel keeps resume data keyed by the download URL, and the relay's URL has a random port, so an interrupted macOS download restarts from the beginning rather than resuming. Keeping resume would need a stable loopback port plus Range passthrough.
  • On macOS the label sits at 100% while Squirrel verifies and unpacks the zip (about 11 seconds here, after a 7 second download).

Automated Tests

  • squirrel-relay.test.ts (new): the feed and the relayed download over real loopback requests, progress, 404 for anything but the two paths, refusal and mid-body stall reported with their reasons, and an abandoned download left for Squirrel to report. downloadWithSquirrel() is driven by a fake Squirrel that downloads over loopback and checks the checksum: success, a relay failure (its reason wins, Squirrel's later report goes nowhere), Squirrel refusing the bundle or hanging up, setFeedURL() throwing, and a retry after a failure; each case also checks that no listeners are left and the relay is closed.
  • updater.test.ts: percentages reported once per change on macOS and Windows, clamped to 0-100, repeated for a repeat request, and ignored once a download has ended.
  • SlideLabelTests.java (new): the column is absent unless reserved, sized for 100% when reserved, and setPercent() updates the text and aria-valuenow without touching the sizer. HtmlUnit does no layout, so a computed-style test checks what keeps the width fixed: the sizer is hidden but still takes space, and the value is absolutely positioned over it.

Checked by hand with a dev desktop build on macOS (a scratch Playwright spec, not committed) accepting the newest daily: the label went 1% to 100% at a constant 366 px width, and the relayed zip passed Squirrel's checksum (the unsigned dev build then refuses the bundle, as expected). Not run on Windows.

QA Notes

On macOS or Windows, accept an available update with "Install and Restart" and watch the label at the top of the window: the percentage should rise to 100% without the label changing width, and the dock / taskbar icon should show the same progress.

Documentation

None needed.

Checklist

@kevinushey kevinushey added this to the 2026.12 (Parrot Balsam) milestone Nov 12, 2026
@kevinushey
kevinushey requested a review from gtritchie November 12, 2026 19:09

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding, inline. It predates this PR and isn't blocking; requesting changes is procedural until it's resolved or set aside.

@kevinushey
kevinushey requested a review from gtritchie November 12, 2026 20:32
@kevinushey
kevinushey merged commit f08f8ab into main Nov 12, 2026
43 checks passed
@kevinushey
kevinushey deleted the feature/update-download-progress branch November 12, 2026 21:54
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
5578 0 245 8
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 4 0 16 0
✅ desktop-linux 1397 0 46 1
✅ desktop-macos 1403 0 40 2
✅ desktop-windows 1389 0 57 4
✅ server-linux 1337 0 54 1
✅ setup 48 0 32 0

View report online


All platforms - commit 9ff24acee717d39c23f9460493c1a616a0220c4b - Run #2231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants