Terminate relaunch probe before committing update - #21
Merged
Conversation
Coverage Report for CI Build 30645286099Coverage decreased (-0.01%) to 59.604%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the relaunch lifecycle during updates by ensuring the temporary “probe” process used to validate an installed app launch is terminated (and confirmed exited) before the update is committed, preventing orphaned validation processes (notably under launchd) and avoiding duplicate app instances.
Changes:
- Update
ApplicationLauncher.launchNewInstanceto terminate the validation/probe process and wait for exit before arming the fallback and proceeding. - Expand unit tests to verify termination ordering and to fail closed when the probe cannot be stopped.
- Update user-facing documentation and refine the
.relaunchFailederror message.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
Tests/AppUpdaterTests/AppUpdaterTests.swift |
Updates/extends relaunch tests to assert probe-termination sequencing and failure behavior. |
README.md |
Documents the corrected relaunch lifecycle, including probe termination before commit. |
AppUpdater.swift |
Implements probe termination + wait in ApplicationLauncher and updates relaunch error text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Owner
Author
|
@copilot do you consider your issue resolved? |
Contributor
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.
What changed
Why
AppUpdater launched the installed executable to validate it, armed a fallback, and then terminated the old host without stopping the validation process. For apps managed by launchd, that process could survive as an orphan while launchd started the real managed instance, leaving two copies of the app running.
The validation launch is now explicitly temporary. The final application instance is launched by the existing fallback only after the old host exits.
Validation
swift test --filter AppUpdaterTests.testRelaunchswift test— 57 tests, 0 failures