Repository navigation
simcamctl feed: bound the camera prompt wait, check device first, use exit 1 for runtime errors - #15
Merged
Merged
Conversation
… exit 1 for runtime errors Follow-up to PR 14 from a Gemini 4 review. Time out the TCC prompt wait after 60s instead of blocking forever in unattended runs. Look for camera hardware before requesting access so a Mac without a camera reports that. Exit 1 (generic error) for runtime failures; exit 3 stays reserved for invalid arguments. Give .restricted its own message since System Settings cannot change it. Guard the frame counter with a lock now that the capture queue and the timer queue both touch it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.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.
What
Follow-up to PR 14, from a Gemini 4 review of that change (each finding checked against the code before fixing). All changes are in
simcamctl/FeedCommand.swift.--secondstimer only starts after capture setup.feedexit 1 (generic error). Exit 3 stays reserved for invalid arguments, as documented in the help text..restrictedmessage. A camera restricted by Screen Time or a profile gets its own message, since the System Settings instruction can't be followed there.writtenis guarded by anOSAllocatedUnfairLock: the capture queue increments it while the timer queue andfinish()read it. This was a latent data race that only matters now that--cameraactually delivers frames.nonisolated(unsafe)variable: success is read from the authorization status after the prompt.Tested
simcamctl feed --camera --seconds 4wrote 86 frames.feed --image /nonexistent.pngexits 1;feedwith no source exits 3.Not tested
🤖 Generated with Claude Code