-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(desktop): honor tauri relaunch() on macOS #2085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
atlasautomates
wants to merge
2
commits into
CapSoftware:main
Choose a base branch
from
atlasautomates:fix/macos-relaunch-honors-restart-exit-code
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+204
−1
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When relaunch is requested during an active export,
note_exit_requested_coderecords restart intent and marks the crash sentinel clean beforehandle_exit_requestedprevents the exit. The running process therefore retains the restart flag, causing a later ordinary quit to relaunch Cap, while an intervening crash is no longer reported as an unexpected termination.Knowledge Base Used: Desktop Tauri App (Rust Backend)
Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scenario can't occur on the vendored runtime: in tauri 2.8.5,
ExitRequestApi::prevent_exit()is a no-op when the request carriesRESTART_EXIT_CODE(tauri-2.8.5/src/app.rs—pub fn prevent_exit(&self) { if self.code != Some(RESTART_EXIT_CODE) { … } }). So an exit requested with the restart code cannot be prevented — not during an active export, not by any caller. Oncenote_exit_requested_codeobserves the restart code, the process is unconditionally on its way toforce_exit, which consumes the flag viaswap; the intent and the sentinel state armed here are always consumed by the exit they precede, never left behind in a live process.Arming only after the prevent decision would introduce the opposite bug: a relaunch requested mid-export still exits (tauri ignores the prevention), but would then neither respawn nor mark the sentinel — a lost restart plus a phantom crash report.
I've extended the comment at the arming site to state this invariant explicitly, with the tauri source reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct — I missed that
prevent_exitis a no-op forRESTART_EXIT_CODEin the vendored runtime. Your reasoning holds: oncenote_exit_requested_codeobserves the restart code, the process is unconditionally exiting,force_exitconsumes the flag viaswap, and there's no live-process state left behind. The alternative ordering you describe would create exactly the inverse defect.The added comment at the arming site spelling out this invariant with the tauri source reference is the right call. Issue 1 is not valid given the vendored runtime behavior.
Tip: You can customize Greptile's behavior for this repo with
.greptile/rules.mdand.greptile/config.json.