Skip to content

fix: relaunch via open instead of app.relaunch() so TCC grants are seen - #11

Merged
Alfredoalv13 merged 1 commit into
mainfrom
fix/relaunch-tcc-independence
Jul 24, 2026
Merged

fix: relaunch via open instead of app.relaunch() so TCC grants are seen#11
Alfredoalv13 merged 1 commit into
mainfrom
fix/relaunch-tcc-independence

Conversation

@Alfredoalv13

Copy link
Copy Markdown
Owner

Summary

  • PR fix: replace dead permission-refresh button with real Quit & Reopen #10 added a "Quit & Reopen" button using `app.relaunch()` to work around macOS caching permission-check results for the life of a process.
  • Verified directly this session that `app.relaunch()` doesn't actually fix the problem it was meant to fix: a relaunched process kept reporting Screen Recording/Accessibility as denied immediately after the same grant was confirmed fresh in System Settings, while the identical signed binary launched via `open` (same mechanism Finder/Dock use) correctly saw the grant every single time.
  • Root cause: `app.relaunch()` re-execs the new process from the current one instead of handing off through launchd, and TCC's authorization resolution for the new process was still keying off the old (denied) process's context on this system.
  • Fix: on macOS, shell out to `open ` (detached) then `app.exit()`, instead of `app.relaunch()`. Other platforms unchanged.

Test plan

  • `tsc --noEmit` clean
  • `npm test` - 94/94 files, 817/817 tests passing
  • Manual: grant Screen Recording in System Settings while VybeClip is open and denied, click "Quit & Reopen", confirm the banner clears on the very first relaunch (not requiring a second manual quit)

Verified directly this session: a process spawned via app.relaunch() kept
reporting Screen Recording/Accessibility as denied even immediately after
the exact same permission was freshly granted in System Settings, while a
process for the identical signed binary launched via the 'open' CLI (same
mechanism Finder/Dock use) correctly saw the fresh grant every time.

app.relaunch() re-execs the new process from the current one rather than
handing off through launchd, and on this system TCC's authorization check
for the new process was still resolving against the old process's already-
denied context. Shelling out to `open <bundle path>` gives the relaunched
process the same independent launch lineage a real Finder/Dock open has,
which is what the Quit & Reopen button actually needs to work.
@Alfredoalv13
Alfredoalv13 merged commit 61890af into main Jul 24, 2026
1 check passed
@Alfredoalv13
Alfredoalv13 deleted the fix/relaunch-tcc-independence branch July 24, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants