Repository navigation
Conversation
Lets the server find the user in one partition instead of a Perseus lookup by subscription that scans every partition on a cache miss. The field is left out while the user only has a local placeholder id.
Same subscription-to-user lookup as the receipt, read at tap time from the identity model. The opened endpoint ignores unknown fields today, so this can ship before the server reads it.
Contributor
📊 Diff Coverage ReportDiff Coverage Report (Changed Lines Only)Gate: aggregate coverage on changed executable lines must be ≥ 80% (JaCoCo line data for lines touched in the diff). Changed Files Coverage
Overall (aggregate gate)12/17 touched executable lines covered (70.6% — requires ≥ 80%) Per-file detail (informational; gate is aggregate above):
❌ Coverage Check FailedAggregate coverage on touched lines is 70.6% (minimum 80%). |
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 reports when the SDK has a backend-assigned id.Details
Motivation
Both requests carry only the subscription id, so the server resolves the user through a Perseus lookup that scans every partition of the app's shard on a cache miss. Large sends turn that into tens of thousands of lookups a second and 500s on
report_received, which loses confirmed-delivery stats (SDK-5473, UD-4748). Withonesignal_idin the request the server can query one partition, confirm the subscription belongs to that user, and fall back to today's path if it does not.Scope
PUT notifications/:id/report_receivedandPUT notifications/:id(opened) gain a top-levelonesignal_idstring.login()orlogout()until the create-user response hydrates the real id. Local placeholder ids are never sent.onesignal_idand are untouched. Existing fields keep their names.Deploy order
The server's
report_receivedhandler currently rejects unknown JSON fields, so the receipt change must not release until the server acceptsonesignal_id. The opened endpoint ignores unknown fields. Neither handler reads the field yet; the server side is tracked by User Data.Testing
Unit testing
New tests cover the
backendOneSignalIdOrNullhelper (backend id, local id, empty, missing), the receipt processor, both backend methods with and without the id, and the lifecycle service reporting the id or omitting it on open. The full core and notifications suites pass. Detekt baseline entries were updated for the changed constructor and loop signatures.Manual testing
Not yet. Needs a build against a server that accepts the field.
Affected code checklist
Checklist
Overview
Testing
Final pass