fix(capture): honor cancellation during screen-recording permission retry#280
fix(capture): honor cancellation during screen-recording permission retry#280SebTardif wants to merge 1 commit into
Conversation
…etry The permission probe retry slept with try?, so a canceled caller could still run a second SCShareableContent probe. Recheck cancellation after sleep and return false without another probe. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 7:17 AM ET / 11:17 UTC. Summary Reproducibility: no. there is not yet a high-confidence real-environment reproduction. Source inspection clearly exposes the swallowed-cancellation path, but the PR does not exercise a live or focused production-helper cancellation during the ScreenCaptureKit retry. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the post-sleep guard, add focused cancellation regression coverage, provide redacted terminal or runtime evidence showing that cancellation suppresses the second probe, and leave Do we have a high-confidence way to reproduce the issue? No, there is not yet a high-confidence real-environment reproduction. Source inspection clearly exposes the swallowed-cancellation path, but the PR does not exercise a live or focused production-helper cancellation during the ScreenCaptureKit retry. Is this the best way to solve the issue? Yes, the immediate post-sleep cancellation check matches established repository patterns and is the narrowest correction. Merge readiness still requires direct behavior proof and removal of the release-owned changelog edit. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e2a46347138d. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(capture): honor cancellation during screen-recording permission retry This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
What Problem This Solves
ScreenRecordingPermissionCheckerretries a failedSCShareableContentprobe aftertry? await Task.sleep. Becausetry?swallowsCancellationError, a canceled permission check can still run a second ScreenCaptureKit probe after the delay.Same cancellation class as merged #270 / #271 / #230 / #267.
Evidence
On current
main:After cancel, sleep returns without error and the second probe runs.
After this change, cancellation is rechecked after sleep and the function returns
falsewithout another probe.Real behavior proof
upstream/main+ this branch;pnpm run test:safe.ScreenCapturePermissionGate.swiftnowguard !Task.isCancelled else { return false }after the transient-denial sleep.Summary
Related: #271, #270, #267, #230