Menu ▾ ▴

#76 Log macOS notification authorization outcome

closed
nobody
None
2026-07-07
2026-07-07
Anonymous
No

Originally created by: kristofferR

The requestAuthorizationWithOptions completion handler discarded both granted and the NSError, so an authorization failure left no trace in Carrier.log and presented in the field as "badges work but no banners appear".

This bit for real today: two still-mounted release DMGs had the bundle id registered at three LaunchServices paths, which made UNUserNotificationCenter authorization fail silently — Carrier never registered under System Settings → Notifications at all. Nothing in the app log pointed at notifications.

Now the handler logs the outcome:

  • error → warn with the localized description
  • denied → warn ("banners will not show")
  • granted → info

Gate: cargo fmt / clippy -D warnings / cargo test --lib (60 pass) and bun run check all green.

https://claude.ai/code/session_01Y9cdpfYQpJmvFDcFu5VUux

Summary by CodeRabbit

  • Bug Fixes
  • Improved handling of notification permission requests on macOS.
  • Added clearer logging for granted, denied, and error states so notification setup issues are easier to identify.

Related

Tickets: #77
Tickets: #79
Tickets: #80

Discussion

  • Anonymous

    Anonymous - 2026-07-07

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-07-07

    Originally posted by: coderabbitai[bot]

    ✅ Action performed Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-07-07

    Ticket changed by: kristofferR

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2026-07-07

    Originally posted by: coderabbitai[bot]

    Review Change Stack

    [!CAUTION]

    Review failed

    The pull request is closed.

    ℹ️ Recent review info
    ⚙️ Run configuration **Configuration used**: Path: .coderabbit.yaml **Review profile**: ASSERTIVE **Plan**: Pro **Run ID**: `efc7adbc-3eec-4c0e-936e-1a0223d7cb6e`
    📥 Commits Reviewing files that changed from the base of the PR and between [252410] and 94b1754730994f90ea9667846602407b1329df35.
    📒 Files selected for processing (1) * `src-tauri/src/macos/notifications.rs`

    📝 Walkthrough ## Walkthrough The authorization request completion handler in `setup_macos_notifications` was changed from a no-op closure to one that logs the outcome, inspecting the `granted` flag and an optional `NSError*` to log failure, success, or denial messages. ### Changes **Notification authorization logging** |Layer / File(s)|Summary| |---|---| |**Authorization completion handler logging**
    `src-tauri/src/macos/notifications.rs`|The completion closure now unsafely reads the optional NSError, logs a failure with its localized description on error, logs success when granted with no error, and logs denial otherwise; comments explain safety assumptions about the error pointer and grant persistence.| **Estimated code review effort:** 1 (Trivial) | ~5 minutes **Possibly related PRs** - [[kristofferR/Carrier#11](https://github.com/kristofferR/Carrier/issues/11)](https://github.com/kristofferR/Carrier/pull/11): Related macOS badge authorization request flow and outcome handling. - [[kristofferR/Carrier#34](https://github.com/kristofferR/Carrier/issues/34)](https://github.com/kristofferR/Carrier/pull/34): Refactors macOS notifications and the authorization flow in the same `setup_macos_notifications` function.
    ✨ Finishing Touches
    📝 Generate docstrings - [ ] Create stacked PR - [ ] Commit on current branch
    🧪 Generate unit tests (beta) - [ ] Create PR with unit tests - [ ] Commit unit tests in branch `log-notification-authorization`

    Comment @coderabbitai help to get the list of available commands.

     

Log in to post a comment.