fix: preserve onboarding progress across the Screen Recording restart#214
Closed
quiet-node wants to merge 1 commit into
Closed
fix: preserve onboarding progress across the Screen Recording restart#214quiet-node wants to merge 1 commit into
quiet-node wants to merge 1 commit into
Conversation
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
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.
Overview
Granting Screen Recording during onboarding requires a macOS restart. When the user accepted macOS's own "Quit & Reopen" prompt, the app relaunched onto the first onboarding screen (Grant Accessibility) instead of advancing, discarding the permissions they had just granted. After this change the restart continues onboarding to the model-check step as expected.
Cause
notify_frontend_readychose which onboarding screen to show on every launch by calling the live macOS permission APIs (AXIsProcessTrusted,CGPreflightScreenCaptureAccess) and falling back to step 1 on afalse. Those APIs return false negatives for a short settle window right after a process restart, so the post-restart launch wrongly concluded the permissions were missing. The macOS-initiated "Quit & Reopen" also never advanced the persisted onboarding stage (only the in-app "Quit & Reopen Thuki" button did), so there was no trusted progress to fall back on.How it works
permissions,model_check,intro) and consults the live permission grants only to detect a genuine revocation once onboarding iscomplete. The decision lives in a puredecide_startup_actionhelper.PermissionsStepresumes the Screen Recording grant after the restart: if the permission is now active it advances straight to the model-check step via the newadvance_past_permissionscommand, with no second restart and no re-granting.Testing
bun run test:all:coverage: frontend and backend suites pass at 100% coverage, including new cases for the post-restart advance, the not-yet-granted fallback, and the unmount guard.bun run validate-build: lint, format, typecheck, and the release build/bundle all clean.Note: the end-to-end TCC restart flow cannot be exercised in CI because it requires real macOS permission grants; the fix is verified by unit tests and code trace.