Repository navigation
fix: [SDK-5606] send full email and SMS fields on composite login - #2815
Merged
Merged
Conversation
Contributor
|
Fix CI. |
fadi-george
requested changes
Oct 26, 2026
fadi-george
left a comment
Contributor
There was a problem hiding this comment.
Requesting changes for the resubscribe issue on LoginUserOperationExecutor.kt:214 (see inline comment).
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)45/49 touched executable lines covered (91.8% — requires ≥ 80%) |
Contributor
Author
|
@fadi-george addressed in e5ba296, CI is green. Could you take another look?
|
fadi-george
approved these changes
Oct 26, 2026
9 of 14 tasks
9 of 14 tasks
nan-li
reviewed
Oct 27, 2026
nan-li
approved these changes
Oct 27, 2026
Profile subscriptions were only type and token, so the backend stored notification_types -99. Match CreateSubscriptionOperation and drop the identity-verification warning. Co-authored-by: Cursor <cursoragent@cursor.com>
… SMS Create User applies enabled/notification_types to an existing address, which would re-subscribe a user who unsubscribed. Device fields are still sent. Also moves the test assertions out of withArg so they don't call a mocked AndroidUtils during verification, and suppresses TooManyFunctions. Co-authored-by: Cursor <cursoragent@cursor.com>
Create User applies a subscribed status to an address that already opted out, so status stays omitted unless the customer sets enabled false. Co-authored-by: Cursor <cursoragent@cursor.com>
The parameter sat next to the subscriptions map and read as another collection. Co-authored-by: Cursor <cursoragent@cursor.com>
Merged
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
Composite login email and SMS subscriptions now include the same device fields as
addEmailandaddSms, without a subscription status, and the identity-verification warning is gone.setEmailEnabled(false)is the exception: that email is sent unsubscribed so it can be collected without marketing consent.Details
Motivation
Fixes SDK-5606. Found in the 5.11.0 bug bash. Profile subscriptions were sent as type and token only, so the backend stored empty device fields. A successful composite login also logged a warning about identity verification that
addEmailnever logs.enabledandnotification_typesare deliberately not sent. Create User applies them to an email or SMS that already exists (on this user or moved from another), so sending "subscribed" would re-subscribe someone who unsubscribed, on every composite login. Add Subscription, whichaddEmailuses, ignores status for an existing address, so it never does this.The cost: a new address created through composite login is still stored as
notification_types: -99until the backend changes Create User to default a new email or SMS with no status to subscribed, and to apply status only on create. No SDK release is needed once that ships.A customer can still collect an email without marketing consent.
OneSignalUserProfile.Builder.setEmailEnabled(false)(Kotlin:emailEnabled = false) sendsenabled: falseandnotification_types: -2for that email, the same unsubscribed pair the rest of the SDK uses when someone opts out.setEmailEnabled(true)is not sent. Create User would apply a subscribed status to an address that already opted out. Leaving the flag unset still omits both fields.Scope
Create User payloads for an email or SMS that comes from the login profile. The only status this path sends is an explicit email unsubscribe. A grouped subscription operation that already has that token is unchanged. Identity-only
login(externalId)is unchanged. Composite login still does not identify the anonymous user.Testing
Unit testing
LoginUserOperationExecutorTestsemail-only and SMS-only cases assert thatenabledandnotification_typesare absent and that the SDK version and device fields are present and non-null (exceptcarrier, which is null under Robolectric). Putting the status back makes both tests fail. Assertions run aftercoVerifyso they don't call a mockedAndroidUtilsduring verification.emailEnabled = falseasserts the email subscription is sent withenabled: falseandnotification_types: -2, and the hydrated model is opted out. Forcing that send path off makes the test fail (enabledis null).emailEnabled = truestill omits both fields.Manual testing
Replayed the Create User and Add Subscription requests against the demo app for email and SMS. On an emulator, the previous commit's request matched the "status sent" replay; this PR's payload is the same minus the two status fields.
addEmail/addSms11-99(needs backend change)-2)-21-2-2-21-2setEmailEnabled(false)enabled: false,notification_types: -2Affected code checklist
Checklist
Overview
Testing
Final pass
Made with Cursor