fix: Quit & Reopen still silently ate the relaunch (attempt 3) - #16
Merged
Conversation
Verified directly with debug logging that PR #15's fix (releaseSingleInstanceLock() then spawn 'open' then app.exit()) still silently ate the relaunch: `open` on an already-running regular app bundle brings the existing process to the front rather than launching a second one, regardless of Electron's own lock state. Since this process was still alive (just mid-teardown) at the moment `open` ran, it just re-activated *this* dying process - which then exited via app.exit(), leaving nothing running. The old process being fully gone has to be true before `open` runs, and nothing can execute in this process after app.exit() calls it, so the wait has to live in a separate detached process. A tiny polling shell script (`while kill -0 <this-pid>; do sleep; done; open <bundle>`) does that reliably; verified directly (3/3) that this actually reopens the app every time, unlike the previous two attempts.
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.
Summary
openjust re-activates it, and once it then calls `app.exit()`, nothing is left running at all.Test plan