mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-04-27 15:07:41 +00:00
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:
parent
e6b8931d91
commit
f3c3cbb073
2 changed files with 16 additions and 0 deletions
|
|
@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [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
|
## [1.0.0-beta.19] - 2025-06-08
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ class PermissionsChecker {
|
||||||
// We check by attempting to get shareable content
|
// We check by attempting to get shareable content
|
||||||
let semaphore = DispatchSemaphore(value: 0)
|
let semaphore = DispatchSemaphore(value: 0)
|
||||||
var hasPermission = false
|
var hasPermission = false
|
||||||
|
var capturedError: Error?
|
||||||
|
|
||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
|
|
@ -17,12 +18,18 @@ class PermissionsChecker {
|
||||||
hasPermission = true
|
hasPermission = true
|
||||||
} catch {
|
} catch {
|
||||||
// If we get an error, we don't have permission
|
// If we get an error, we don't have permission
|
||||||
|
capturedError = error
|
||||||
hasPermission = false
|
hasPermission = false
|
||||||
}
|
}
|
||||||
semaphore.signal()
|
semaphore.signal()
|
||||||
}
|
}
|
||||||
|
|
||||||
semaphore.wait()
|
semaphore.wait()
|
||||||
|
|
||||||
|
if let error = capturedError {
|
||||||
|
Logger.shared.debug("Screen recording permission check failed: \(error)")
|
||||||
|
}
|
||||||
|
|
||||||
return hasPermission
|
return hasPermission
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue