Repository navigation
fix(macos): suppress Swift compiler warnings - #128
Conversation
- Replace force casts with unsafeDowncast for type safety - Fix AXUIElement sendability violations in async restoration - Improve C string conversion safety with explicit bounds check
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped macOS maintenance patch that removes compiler warnings while preserving existing focus, restoration, retry, and bundle-discovery flows. The only runtime-touching edits are localized substitutions whose effects are directly visible in the diff, with no new capability or broad integration introduced. You can add or adjust custom eligibility rules. Learn more. |
Summary
unsafeDowncastinAXFocusOperationsfor proper type-safe handling ofCFBooleanAXFrameCoordinatorby reconstructing the application element locally instead of capturing it across async boundariesMacOSPlatform+WindowSnapshotDiscoveryto clarify closure scopeString(cString:)with explicit null-terminator handling inWindowSnapshotRefreshPolicyto handle C strings safelyTesting
python3 script/verify.py localNote
Fix Swift compiler warnings in DefiMacOS accessibility code
AXFocusOperations.readFocusedby using an unchecked downcast after the existing CF type-identifier check (AXFocusOperations.swift)appBundleIdentifier(processID:)to decode the non-null portion of theproc_pidpathbuffer as UTF-8, so bundle lookup gets a clean executable path (WindowSnapshotRefreshPolicy.swift)AXFrameCoordinatorto capture the restoration token, recreate the application accessibility element from the process ID at execution time, and record failed restorations against that element (AXFrameCoordinator.swift)Macroscope summarized 50dce2d.