Repository navigation
Conversation
The NSE runs in its own process, so the id is read from the OS_SNAPSHOT_ONESIGNAL_ID shared UserDefaults key that the user module writes once the server has assigned one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Send the user's
onesignal_idwith confirmed receipts and notification opened. SDK-5473.Details
Motivation
The server resolves the user behind a receipt from the subscription id. On a cache miss that lookup scans every partition of the user store, and large sends turned it into 500s on
report_received(UD-4748). With theonesignal_idin the body the server can query one partition and verify that the subscription belongs to that user.Scope
onesignal_idstring. The key is left out when the id is nil or empty, never sent as null.OneSignalIdentifiers.onesignalIdaccessor, which reads theOS_SNAPSHOT_ONESIGNAL_IDshared UserDefaults key the user module writes once the server assigns an id. The NSE reads it the same way it reads the app id and subscription id.OSRequestReceiveReceiptsandOSRequestSubmitNotificationOpenedgain anonesignalId:parameter. Both are internal request classes.player_id,app_idanddevice_typeare unchanged. Outcomes already send the field and are untouched.Deploy order
The server's
report_receivedhandler rejects unknown JSON fields today, so this must not release before the server accepts the field. The opened endpoint ignores unknown fields. Neither handler reads the field yet. The server side is tracked under UD-4748.Freshness
The key lags
login()andlogout()by the Create User round trip. During that window a receipt names the previous user, which matches what the server resolves from the subscription in the same window, since the subscription moves to the new user when that same Create User lands.logout()under identity verification clears the key synchronously, so receipts omit the field until the next login.Testing
Unit testing
Twelve new tests: three for the accessor in
OneSignalIdentifiersFallbackTests, three for the Live Activities receipt inOSLiveActivitiesExecutorTests, three for the NSE path in the newReceiveReceiptsRequestTests(UnitTests target, drivingOneSignalReceiveReceiptsControllerthrough a recording client), and three for the opened request inOneSignalCoreTests. Each set covers a known id, a missing id and an empty string.Manual testing
The four test classes run locally, 47 tests, on an iPhone 17 Pro (iOS 26.5) simulator with Xcode 27.1. Not tested against a server that accepts the field, and not run on a device.
Affected code checklist
Checklist
Overview
Testing
Final pass