fix: Improve permission error detection and add debug logging

- Added debug logging to PermissionsChecker when screen recording check fails
- Updated CHANGELOG with details about the permission error fixes
- This complements the previous commit that fixed overly broad error detection

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Peter Steinberger 2025-06-08 06:57:34 +01:00
parent e6b8931d91
commit f3c3cbb073
2 changed files with 16 additions and 0 deletions

View file

@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- Fixed overly broad permission error detection that incorrectly reported file I/O errors as screen recording permission issues
- File permission errors (e.g., writing to `/System/`) now correctly report as `FILE_IO_ERROR`
- Directory not found errors provide clear messages about missing parent directories
- Added specific error code checking for ScreenCaptureKit and CoreGraphics APIs
- Only errors containing both "permission" and capture-related terms are now considered screen recording issues
- Enhanced file write error handling with pre-emptive directory checks
- Added debug logging to permission checker for diagnosing intermittent failures
## [1.0.0-beta.19] - 2025-06-08
### Added

View file

@ -9,6 +9,7 @@ class PermissionsChecker {
// We check by attempting to get shareable content
let semaphore = DispatchSemaphore(value: 0)
var hasPermission = false
var capturedError: Error?
Task {
do {
@ -17,12 +18,18 @@ class PermissionsChecker {
hasPermission = true
} catch {
// If we get an error, we don't have permission
capturedError = error
hasPermission = false
}
semaphore.signal()
}
semaphore.wait()
if let error = capturedError {
Logger.shared.debug("Screen recording permission check failed: \(error)")
}
return hasPermission
}