Skip to content

fix(engagement): latch startup marketing consent prompt cp-7.80.0#30808

Merged
samir-acle merged 4 commits into
mainfrom
fix/ge-217-pre-prompt-trigger
May 29, 2026
Merged

fix(engagement): latch startup marketing consent prompt cp-7.80.0#30808
samir-acle merged 4 commits into
mainfrom
fix/ge-217-pre-prompt-trigger

Conversation

@samir-acle

@samir-acle samir-acle commented May 29, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an issue where the marketing_consent notification pre-prompt could be re-triggered during the same app session after the user turned marketing consent off in Settings.

The pre-prompt is intended to behave as a startup flow. This change latches the marketing consent value used for startup prompt resolution, so once startup eligibility has resolved, later Redux updates from user actions do not cause the prompt to appear unexpectedly.

Social-login marketing consent backfill is still respected as part of startup resolution. If backfill is pending, the prompt waits for it to clear, then decides once using the resolved consent value.

Risk
Low risk.

This change is scoped to usePushPrePromptVariant, which only decides which notification pre-prompt variant to show. It does not change notification registration, OS permission requests, Settings behavior, analytics opt-in/out behavior, or persisted storage keys.

The change preserves existing behavior for the main paths:

Users without OS push permission still resolve to the push permission prompt first.
Users who already saw the pre-prompt remain suppressed by PUSH_PRE_PROMPT_SHOWN.
Users with marketing consent enabled do not see the marketing consent prompt.
Users with marketing consent disabled at startup can still see the one-time startup prompt if otherwise eligible.
Social-login users still wait for marketing consent backfill before the marketing prompt decision is made.
The risk is low because the fix narrows when the marketing consent prompt can appear rather than expanding eligibility. The only behavior removed is the unintended mid-session re-trigger after Settings opt-out.

Changelog

CHANGELOG entry: Fixed an issue where the marketing consent notification pre-prompt could reappear after turning marketing consent off in Settings.

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@samir-acle samir-acle requested a review from a team as a code owner May 29, 2026 15:15
@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. size-M risk:medium AI analysis: medium risk labels May 29, 2026
@samir-acle samir-acle enabled auto-merge May 29, 2026 15:35
@baptiste-marchand baptiste-marchand removed risk:medium AI analysis: medium risk pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels May 29, 2026
@github-actions github-actions Bot added the risk:low AI analysis: low risk label May 29, 2026
@samir-acle samir-acle added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. and removed pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels May 29, 2026
@samir-acle samir-acle changed the title fix: latch startup marketing consent prompt fix (engagement): latch startup marketing consent prompt May 29, 2026
@samir-acle samir-acle changed the title fix (engagement): latch startup marketing consent prompt fix(engagement): latch startup marketing consent prompt May 29, 2026
@github-actions github-actions Bot added risk:medium AI analysis: medium risk and removed risk:low AI analysis: low risk labels May 29, 2026
@github-actions github-actions Bot added risk:low AI analysis: low risk and removed risk:medium AI analysis: medium risk labels May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 92%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are limited to two files in the notifications utility hooks directory:

  1. usePushPrePromptVariant.ts: Adds isMarketingConsentResolutionPending state to handle edge cases where marketing consent is being resolved during social login flows. This prevents the marketing consent pre-prompt from showing prematurely. The change is purely internal to the push notification pre-prompt logic.

  2. usePushPrePromptVariant.test.ts: Adds unit tests covering the new behavior (3 new test cases for social login marketing consent backfill scenarios).

Why no E2E tags are needed:

  • These changes are isolated to a utility hook for push notification pre-prompt UI logic
  • No E2E tests directly test the PushNotificationOnboarding component or usePushPrePromptVariant hook
  • The changes don't affect any core wallet flows (accounts, transactions, swaps, network, etc.)
  • No shared components (TabBar, Navigation, Modals, Confirmations) are modified
  • The changes are well-covered by unit tests
  • The SmokeSeedlessOnboarding tag tests social login onboarding flows, but the change is a minor fix to marketing consent state resolution timing that doesn't affect the core onboarding flow tested by E2E tests
  • No controllers, Engine, or Redux state structure changes that would cascade to other components

Performance Test Selection:
The changes are to a React hook managing push notification pre-prompt variant selection. This is UI state logic with no performance-sensitive operations (no list rendering, no heavy data loading, no app startup impact). No performance tests are warranted.

View GitHub Actions results

@samir-acle samir-acle added this pull request to the merge queue May 29, 2026
@samir-acle samir-acle changed the title fix(engagement): latch startup marketing consent prompt fix(engagement): latch startup marketing consent prompt cp-7.80.0 May 29, 2026
Merged via the queue into main with commit ae601d9 May 29, 2026
158 of 160 checks passed
@samir-acle samir-acle deleted the fix/ge-217-pre-prompt-trigger branch May 29, 2026 22:21
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.81.0 Issue or pull request that will be included in release 7.81.0 label May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.81.0 Issue or pull request that will be included in release 7.81.0 risk:low AI analysis: low risk size-M team-engagement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants