Repository navigation
fix: [SDK-5315] send one confirmed delivery per notification ID - #1786
Conversation
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>
abdulraqeeb33
left a comment
There was a problem hiding this comment.
The same-process dedup matches the iOS 27 double run, and the notification still displays. Two things should change before this lands: the id is recorded before the send is known to have succeeded, and the shared list is a read-modify-write that two extension processes can clobber.
|
I replied in each thread. I'm keeping the record-before-send order, because a duplicate run almost never gets a usable retry and a retry risks double-counting again. I'm leaving the cross-process race as a known gap, since its worst case is today's behavior. Both are now in the Scope section. The log line stays at DEBUG. |
abdulraqeeb33
left a comment
There was a problem hiding this comment.
Approving. The replies on record-before-send, the two-process race, the DEBUG line, and the badge stand.
Known gap, same class as the ones already in Scope: the id is recorded before the checks that return without a request (no app id, receipts read as off). Before first unlock those reads are empty unless OSResilientStorage already has them. The failure block does not clear the id, so a later extension process after unlock will not send. No change requested.
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
Testing
Unit testing
Six tests in
OneSignalNotificationServiceExtensionHandlerTestsdrive the extension entry point twice, ten times concurrently, across a simulated process restart, and past the list cap, and countreport_receivedrequests 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
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code