Skip to content

fix: [SDK-5315] send one confirmed delivery per notification ID - #1786

Open
nan-li wants to merge 1 commit into
mainfrom
nan/sdk-5315
Open

nan-li wants to merge 1 commit into
mainfrom
nan/sdk-5315

Conversation

@nan-li

@nan-li nan-li commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Send one confirmed delivery per notification ID from the Notification Service Extension. SDK-5315

Details

Motivation

iOS can run the Notification Service Extension more than once for a single notification, seen on an iOS 27 beta where the system also displayed the notification twice. Each run reported a confirmed delivery, so one send showed two receipts on the subscription timeline.

Scope

  • A duplicate run skips the influence record as well as the receipt, on purpose. Android drops a duplicate FCM message before display and records neither, so this matches it.
  • The in-process list exists because shared defaults are unreadable before first unlock, and the iOS 27 duplicate runs land in one extension process seconds apart.
  • The second notification still displays. The extension cannot drop a notification.
  • A duplicate handled by a separate extension process before first unlock still reports. That gap is left in.

Testing

Unit testing

Six tests in OneSignalNotificationServiceExtensionHandlerTests drive the extension entry point twice, ten times concurrently, across a simulated process restart, and past the list cap, and count report_received requests through a recording client.

Manual testing

Test class run locally on an iPhone 17 Pro (iOS 26.5) simulator with Xcode 27.1.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

🤖 Generated with Claude Code

The notification service extension can run more than once for one notification, and each run sent a confirmed delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nan-li
nan-li marked this pull request as ready for review October 29, 2026 16:14
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