fix(oauth): sync marketing opt-in and analytics after OAuth rehydration unlock cp-7.72.0#28230
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
✅ E2E Fixture Validation — Schema is up to date |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No E2E test tags are warranted as this change is isolated to a specialized OAuth rehydration flow not covered by any available Detox test suite, and the risk to existing E2E flows is negligible. Performance Test Selection: |
|




Description
After a seedless / social-account wallet unlock on the OAuth rehydration screen, local marketing consent and analytics could drift from the account’s server-side marketing opt-in. That meant user profile properties and preference events were not reliably aligned with
getMarketingOptInStatusuntil some other flow ran.This change calls
OAuthService.getMarketingOptInStatus()immediately after a successful unlock onOAuthRehydration, then:setDataCollectionForMarketingso Redux matches the server flag.HAS_MARKETING_CONSENT.ANALYTICS_PREFERENCE_SELECTEDwithupdated_after_onboarding: true,location: 'oauth_rehydration', andaccount_typefrom the seedless auth connection.Failures are logged and do not block unlock. Unit tests assert the marketing sync runs on the happy path and is skipped when navigation does not complete that path.
Changelog
CHANGELOG entry: null
Related issues
Fixes: #28249
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches the post-unlock path of
OAuthRehydrationby adding a background network call plus Redux/analytics side effects; failures are best-effort but bugs here could desync consent state or misfire analytics.Overview
After a successful OAuth rehydration unlock, the app now fetches server-side marketing consent via
OAuthService.getMarketingOptInStatus()and syncs it locally.The unlock flow dispatches
setDataCollectionForMarketing, updates MetaMetrics identity (HAS_MARKETING_CONSENT), and emitsANALYTICS_PREFERENCE_SELECTEDwithupdated_after_onboarding,location: 'oauth_rehydration', and anaccount_typederived from the seedlessauthConnection; errors are logged and do not block unlock.Tests were updated to mock
analytics/getMarketingOptInStatus, assert the sync runs on the successful rehydration path, verify Redux + analytics payloads, and confirm the sync is skipped for the outdated password (non-oauth2) unlock path.Written by Cursor Bugbot for commit 0738153. This will update automatically on new commits. Configure here.