Skip to content

fix(ios): read notification permission without sending UNNotificationSettings - #6

Open
SamGu-NRX wants to merge 3 commits into
mainfrom
fix/notification-settings-sendable
Open

SamGu-NRX wants to merge 3 commits into
mainfrom
fix/notification-settings-sendable

Conversation

@SamGu-NRX

@SamGu-NRX SamGu-NRX commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

What changed

main doesn't build in CI. On the runner's Xcode 16.4 (iOS 18.5 SDK), Swift 6 checking rejects notification-center results that cross actors, because that SDK doesn't mark them Sendable:

AppPermissionCenter.swift:44:61: error: non-sendable result type 'UNNotificationSettings' cannot be sent from nonisolated context
AppPermissionCenter.swift:105:63: error: (same)
NotificationScheduler.swift:22:32: error: non-sendable result type '[UNNotificationRequest]' cannot be sent from nonisolated context
  • Permission status: AppPermissionCenter reads notification settings through getNotificationSettings. It maps them to AppPermissionStatus inside the callback, so only the Sendable status crosses actors. The status check and the permission request share that helper.
  • Pending reminders: UserNotificationCenterClient now returns pending identifiers ([String]) instead of UNNotificationRequests. The scheduler actor only ever read the identifiers. The test mock follows the new method.

Behaviour doesn't change.

Why

Every PR's build-and-test job fails on these errors before any test runs; the last main run, on 1f85e88, failed the same way. #4 and #5 need a building main to get simulator results.

Verification

Risk

Checklist

  • The scope is focused; related changes belong together
  • I explained what changed and why
  • N/A before/after images: no visible change
  • N/A video: no visible change

Summary by CodeRabbit

  • Improvements
    • Notification permission status is now checked through the system’s notification settings, including when requesting permission.
    • Scheduled notification reconciliation now checks pending notification identifiers directly and continues to remove stale freshness notifications.
    • These updates keep permission status handling and notification scheduling aligned with the current system notification state.

…Settings

Xcode 16's SDK doesn't mark UNNotificationSettings Sendable, so awaiting
notificationSettings() from the main actor failed the Swift 6 build in CI.
Read the settings through the callback API and return only the mapped
permission status.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codemetrics-ai

codemetrics-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Note

Review skipped

Codemetrics is installed on this repository, but it hasn't been added to your team yet.

To enable AI code reviews for this repo, go to your dashboard and add FridgeLuck to your team's repositories.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T12:36:53.237763Z 0379660 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c32ef1af-5ee6-47a1-ad70-2464cdae4ad1
📥 Commits

Reviewing files that changed from the base of the PR and between 0379660 and 8540848.

📒 Files selected for processing (3)
  • apps/ios/Platform/Notifications/NotificationScheduler.swift
  • apps/ios/Platform/Notifications/UserNotificationCenterClient.swift
  • apps/ios/Tests/NotificationSchedulerTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Notification status lookup now uses a shared callback-based helper. Pending notification retrieval now returns identifiers, which the scheduler uses to reconcile stale notifications.

Changes

Notification status retrieval

Layer / File(s) Summary
Shared notification status lookup
apps/ios/Feature/Shared/AppPermissionCenter.swift
notificationStatus() delegates to a helper that retrieves settings with getNotificationSettings and maps the status in its callback. The notification request branch switches on the helper’s result; its status handling is unchanged.

Pending notification identifiers

Layer / File(s) Summary
Pending identifier retrieval and reconciliation
apps/ios/Platform/Notifications/UserNotificationCenterClient.swift, apps/ios/Platform/Notifications/NotificationScheduler.swift, apps/ios/Tests/NotificationSchedulerTests.swift
The client returns pending request identifiers through a checked continuation. The scheduler retrieves identifiers directly, and its mock returns identifiers.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 85408

The notification-status and pending-cleanup changes preserve the inspected behavior. No material merge blocker remains; normal CI checks should still run.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: reading iOS notification permission through notification settings without sending notification settings data. It is concise and directly related to the …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

The scheduler only needs identifiers, and Xcode 16's SDK doesn't mark
UNNotificationRequest Sendable, so returning requests to the scheduler
actor failed the Swift 6 build in CI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
SamGu-NRX added a commit that referenced this pull request Oct 11, 2026
…ionSettings

Folds fix/notification-settings-sendable @ 8540848 into the app integration trunk, fold 10 of 12.

Co-authored-by: obvious-autobuild[bot] <262744130+obvious-autobuild[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant