Reduce updater progress UI churn - #119
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea7b068cd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case .downloading(nil): | ||
| if case .downloading(.some) = lastEmitted { | ||
| return nil |
There was a problem hiding this comment.
Preserve indeterminate progress for lengthless downloads
When the archive response omits a valid Content-Length, UpdateDownload reports .downloading(nil) for the entire transfer, but prepareOffMain first emits .downloading(0). This guard therefore discards the initial nil and every subsequent one, leaving the update UI on a determinate 0% bar until verification rather than showing its existing indeterminate spinner. Coalesce duplicate nil values without suppressing the transition from the initial placeholder zero when the server cannot provide progress.
AGENTS.md reference: AGENTS.md:L48-L48
Useful? React with 👍 / 👎.
Summary
User-visible impact
Opening or interacting with the main window and menu-bar dropdown remains responsive while an application update is downloading. Download progress still advances from 0% through 100%, and update availability, verification, preparation, installation, retry, and restart behavior are unchanged.
Compatibility and risk
No download URL, archive, checksum, signature, architecture, installer helper, persisted data, permissions, or network behavior changes. Progress rendering is intentionally limited to whole percentages, which matches the existing percentage label. The change can be rolled back by reverting commit
ea7b068.Validation
make check— passedswiftc -typecheck -parse-as-library VoiceInk/Update/*.swift— passedMenuBarUpdateLabelagainst the real updater types — passedgit diff --check— passedxcodebuild test -project VoiceInk.xcodeproj -scheme VoiceInk -destination 'platform=macOS,arch=arm64' -only-testing:VoiceInkTests -parallel-testing-enabled NO CODE_SIGNING_ALLOWED=NO ENABLE_TESTABILITY=YES— not runnable on this host because only Command Line Tools are installed (xcode-selectpoints to/Library/Developer/CommandLineTools); PR CI provides Xcode 26.5 arm64 and x86_64 coveragePerformance measurement scope
This is a deterministic event-count regression rather than a wall-clock benchmark: 10,001 monotonically increasing raw download progress callbacks are reduced to 101 visible whole-percent updates. No CPU, latency, memory, or power claim is made without Instruments data.