Repository navigation
fix(macos): show TCC notice after first prompt - #11243
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe TCC prompt notice threshold changed from three detected prompts to one. Tests now expect the notice to fire on the first dialog, use the threshold constant for prompt counts, preserve persisted counts below the former threshold, and retain existing claim delivery and acknowledgement behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryLowers
Confidence Score: 5/5Safe to merge — this is a single-constant change with thorough test coverage across all affected paths. The change is minimal: one constant drops from 3 to 1 and tests are updated to match. The guard logic in recordPrompt (pre-increment check tally.promptCount >= THRESHOLD, post-increment check tally.promptCount < THRESHOLD) is mathematically correct at threshold=1. The persisted-tally migration path in initTccPromptNotice (promptCount >= 1 triggers immediate delivery without starting a watcher) works correctly for both fresh tallies and tallies carried over from the old three-prompt regime. All 28 existing tests continue to validate one-time notice semantics, claim/release/acknowledge lifecycle, renderer routing, and deferred watcher startup. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/main/macos-tcc-prompt-notice.ts | Changes TCC_PROMPT_NOTICE_THRESHOLD from 3 to 1 and updates the JSDoc comment; all guard logic in recordPrompt and initTccPromptNotice is correct at the new value. |
| src/main/macos-tcc-prompt-notice.test.ts | Tests updated to use TCC_PROMPT_NOTICE_THRESHOLD constant instead of literal 3, adds migration-path coverage for tallies persisted below the old threshold, and renames tests to match the new behaviour. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[initTccPromptNotice called] --> B{platform === darwin?}
B -- No --> Z[return]
B -- Yes --> C{watch already active?}
C -- Yes --> D[trackMainWindow + startWatch]
C -- No --> E[loadTally from disk]
E --> F{dismissed or notified?}
F -- Yes --> Z
F -- No --> G{promptCount >= THRESHOLD now = 1}
G -- Yes --> H[sendTccPromptNotice immediately, no watcher started]
G -- No --> I[trackMainWindow, start MacosTccPromptWatch]
I --> J[onPrompt callback fires]
J --> K[recordPrompt]
K --> L{dismissed / notified / promptCount >= THRESHOLD?}
L -- Yes --> M[return null]
L -- No --> N[increment promptCount, saveTally]
N --> O{promptCount >= THRESHOLD?}
O -- No --> M
O -- Yes --> P[return payload, renderer notified, stopTccPromptNotice]
Reviews (1): Last reviewed commit: "fix(macos): show TCC notice after first ..." | Re-trigger Greptile
Summary
Why
One confirmed prompt is enough to identify an affected user. Waiting for three delays the explanation and remedy until after the user has already encountered repeated friction.
Follow-up to #9910.
Verification
pnpm vitest run src/main/macos-tcc-prompt-notice.test.ts src/main/macos-tcc-prompt-watch.test.ts— 28 passedpnpm run typecheck:node— cleanpnpm run check:code-quality:changed— zero findingsoxfmt --checkandoxlinton changed files — clean