Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2407,7 +2407,7 @@ workflows:

- name: Register release in Firestore
script: |
CHANGELOG_JSON=$(echo "$CHANGELOG_JSON_B64" | base64 --decode)
export CHANGELOG_JSON=$(echo "$CHANGELOG_JSON_B64" | base64 --decode)

RELEASE_JSON=$(python3 - <<PYEOF
import json, os
Expand Down
17 changes: 13 additions & 4 deletions desktop/Desktop/Sources/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,10 @@ class AppState: ObservableObject {
}
} else {
let hasPermission = status == noErr
log("AUTOMATION_CHECK: status=\(status), hasPermission=\(hasPermission)")
let previousValue = await MainActor.run { self.hasAutomationPermission }
if hasPermission != previousValue {
log("AUTOMATION_CHECK: status=\(status), hasPermission=\(hasPermission)")
}

await MainActor.run {
self.hasAutomationPermission = hasPermission
Expand Down Expand Up @@ -897,15 +900,21 @@ class AppState: ObservableObject {
// AXIsProcessTrusted() says not granted — but on macOS 26 this may be stale.
// Probe via event tap which checks the live TCC database.
if probeAccessibilityViaEventTap() {
log("ACCESSIBILITY_CHECK: AXIsProcessTrusted() returned false but event tap succeeded — stale cache detected")
if !previouslyGranted {
log("ACCESSIBILITY_CHECK: AXIsProcessTrusted() returned false but event tap succeeded — stale cache detected")
}
let axWorks = testAccessibilityPermission()
hasAccessibilityPermission = true
if !axWorks {
if !isAccessibilityBroken {
log("ACCESSIBILITY_CHECK: Event tap OK but AX calls fail — marking as broken")
}
isAccessibilityBroken = true
log("ACCESSIBILITY_CHECK: Event tap OK but AX calls fail — marking as broken")
} else {
if isAccessibilityBroken {
log("ACCESSIBILITY_CHECK: Permission confirmed via event tap probe, AX calls working")
}
isAccessibilityBroken = false
log("ACCESSIBILITY_CHECK: Permission confirmed via event tap probe, AX calls working")
}
} else {
// Event tap also failed — permission genuinely not granted
Expand Down