Braze: Fix - No remove OldEid and subscribe new users to email notifications#2152
Merged
JohnathanWhite merged 2 commits intoApr 30, 2026
Merged
Conversation
cmgustavo
force-pushed
the
bug/braze-email-subscription-01
branch
from
April 24, 2026 16:34
1559b8d to
f305ce4
Compare
cmgustavo
force-pushed
the
bug/braze-email-subscription-01
branch
from
April 24, 2026 17:20
f305ce4 to
3664735
Compare
cmgustavo
force-pushed
the
bug/braze-email-subscription-01
branch
from
April 24, 2026 17:28
3664735 to
ed6dba5
Compare
cmgustavo
force-pushed
the
bug/braze-email-subscription-01
branch
from
April 24, 2026 19:12
ed6dba5 to
cd6272d
Compare
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.
Commit f305ce4
New users could end up with
UNSUBSCRIBEDemail status in Braze becauseagreedToMarketingCommunicationswas propagated through the pairing chain and used to gate the setEmailNotifications call.Now setEmailNotificationsAccepted(true) is dispatched immediately after account creation, and the
agreedToMarketingCommunicationsparameter is removed from the chain.The OPTED_IN vs SUBSCRIBED distinction is determined solely by the BitPay user's optInEmailMarketing + verified flags.
RN-2700
Commit a823539
Anonymous Braze tracking data was not migrating to the authenticated user profile on login.
Root cause
Braze.changeUser(newEid) and the server-side merge were called in the wrong order, and buffered SDK events were never flushed before switching users.
Fix
Added Braze.requestImmediateDataFlush() before Braze.changeUser() in BrazeWrapper.identify to flush buffered anonymous events to Braze servers first.
Reordered the login flow so identify (→ changeUser) runs before the server-side merge API call.
Removed programmatic delete of the anonymous profile — it races against Braze's async merge and can cancel it. The empty shell is harmless and handled by Braze's User Archival policy.
RN-2699