ReviewOS

craft-native/craft

macOS installed-app CI: notification authorization remains notDetermined on headless runner

#330
Closed glennmichael123 opened this 9 days ago ·
9 days ago

The macOS zig-core installed-app smoke failed twice on direct-main commit 7500e75 after Zig build/tests and package installation succeeded. Both attempts report requestPermission({ provisional: true }) as NATIVE_CALL_FAILED / "Notifications are not allowed for this application", then getPermissionStatus() returns notDetermined. The verifier correctly refuses to classify this as a user denial, so the full workflow remains red and dependent integration is skipped.

Evidence: attempt 1 and attempt 2, both failing in Package, install, and launch the real Craft app. The changed commit edits documentation and a TypeScript event type only; the native notification and smoke paths are unchanged. Earlier main runs, including 36898929640 attempt 2, passed this job.

Investigate why the installed ad-hoc signed smoke app cannot get a determined Notification Center authorization state on some hosted macOS runners. Preserve the current strict distinction between an actual denied state and an authorization failure; do not turn notDetermined into a passing skip. Acceptance: the installed-app smoke can reliably verify delivery when authorized or report a confirmed denial, while its multi-window checks remain independently observable if notification setup fails.

9 days ago

Follow-up on direct-main commit 14ddaae: macOS zig-core and the installed PKG smoke passed in CI run https://github.com/craft-native/craft/actions/runs/36999448394. Its log shows the new multi-window/parent-modal checkpoint, then notification delivery reached Notification Center and the installed URL scheme worked. This demonstrates the earlier two failures are intermittent, not that the authorization issue is fixed. Keeping this issue open for a root-cause and reliable runner result.

9 days ago

Likely cause and a fix in e5e33d4. Notification Center resolves an app through its LaunchServices record. A PKG install registers the bundle asynchronously, so on a fresh runner the first requestAuthorization can arrive before the record does. That fits both the NotificationsNotAllowed error with the state still notDetermined, and reruns passing.

The smoke now runs lsregister -f /Applications/craft.app after install, and retries a request that left the state undetermined (four attempts, 1-8 s backoff). Nothing is loosened: still notDetermined after the last attempt fails as before, and a real denied is still reported as a denial. All attempts' errors are kept in the failure. Multi-window acceptance was already reported before the notification step.

I'm leaving this open until several macOS runs pass, since a single green run can't prove an intermittent failure is gone.

9 days ago

Resolved in the packaged-app verifier: macOS installs now explicitly register /Applications/craft.app with LaunchServices before startup, and the notification permission probe retries transient NATIVE_CALL_FAILED/notDetermined responses without treating them as a pass. The verifier still fails if the state remains undetermined or if delivery cannot be confirmed.

Sign in to comment on this issue.