Defer update downloads until preparation - #22
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes AppUpdater’s update flow so that check() performs lightweight update discovery (metadata only) and defers downloading/mounting/validation of the DMG until prepareInstallation(). It also exposes the selected semantic version on Update.version and updates docs/tests to reflect the new v4 behavior and security boundary.
Changes:
- Refactor
check()to return a lightweightUpdateand defer artifact preparation toprepareInstallation(). - Add
Update.versionand adjust viable update selection to return both version + asset. - Update README guidance and revise unit tests to validate the deferred preparation behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AppUpdater.swift | Refactors update discovery vs preparation, adds Update.version, and adjusts viable-update selection return type. |
| Tests/AppUpdaterTests/AppUpdaterTests.swift | Updates tests to verify check() does not stage/download and that preparation happens during prepareInstallation(). |
| README.md | Documents v4 behavior changes, including the security boundary between advisory metadata and authenticated candidates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot do you consider your issue resolved? |
Yes — commit |
Summary
check()fetch release metadata onlyUpdate.versionprepareInstallation()Why
The main consumer needs to check for updates on startup and every 24 hours without repeatedly downloading or mounting the DMG. Previously,
check()staged the full artifact before the caller decided to install it.The check result remains advisory.
prepareInstallation()retains the existing bounded download, Developer ID validation, protected promotion, second validation, rollback, and relaunch behavior.Validation
swift test— 56 tests passed