Skip to content

fix: cp-7.57.0 prevent unnecessary reward navigation on account change#21264

Merged
VGR-GIT merged 3 commits into
mainfrom
fix-prevent-reward-navigation-account-change
Oct 16, 2025
Merged

fix: cp-7.57.0 prevent unnecessary reward navigation on account change#21264
VGR-GIT merged 3 commits into
mainfrom
fix-prevent-reward-navigation-account-change

Conversation

@VGR-GIT

@VGR-GIT VGR-GIT commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Description

When you reinstalled the app and reimported an SRP where the first account/group was tied to the rewards program, you wouldn't see the rewards gtm modal as its logic wouldn't trigger. In the same session, when switching to an account that wasn't tied to the rewards program yet, the gtm modal would trigger a navigation to the onboarding/gtm modal but then we'd detect that there was opted in for another/other accounts (i.e. primary) and the rewards dashboard would be seen.

To prevent this, in the logic that spawns the gtm modal, as soon as we detect a subscriptionId, we set the gtm modal seen storage prop to true, preventing it to be spawned/navigated to when changing an account that had no subscriptionId.

Minor extra fix; as we're moving ahead with prod readiness, we are switching the geo check URI to prod.

Changelog

CHANGELOG entry: null

Related issues

Fixes: #21252

Manual testing steps

  1. Reinstall app
  2. import existing SRP where primary account (first) is already opted in to rewards program but second/other accounts not
  3. the primary view/wallet view will load and no gtm modal should open
  4. switch to an account that is not tied to the rewards program.
  5. Before this fix, you would've been redirected to the rewards program. With this fix, nothing should happen.

Note

Marks the rewards intro modal as seen when a subscription exists and on intro step mount to prevent unwanted navigation, simplifies the intro modal, and forces the geolocation service to use the PROD URL; tests updated accordingly.

  • Rewards Onboarding:
    • Move REWARDS_GTM_MODAL_SHOWN persistence to OnboardingIntroStep (set on mount) and simplify RewardsIntroModal to be presentational only.
    • In useRewardsIntroModal, if subscriptionId exists, set REWARDS_GTM_MODAL_SHOWN to true and skip navigation.
    • Minor robustness: swallow errors in RewardsController:isOptInSupported check.
  • Services:
    • RewardsDataService.fetchGeoLocation now always uses GEOLOCATION_URLS.PROD.
  • Tests:
    • Update/relocate storage expectations to OnboardingIntroStep and useRewardsIntroModal.
    • Adjust geolocation tests to expect PROD URL irrespective of environment.

Written by Cursor Bugbot for commit 63407dd. This will update automatically on new commits. Configure here.

@VGR-GIT VGR-GIT requested a review from a team as a code owner October 16, 2025 09:52
@VGR-GIT VGR-GIT added No E2E Smoke Needed no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed team-rewards Rewards team regression-RC-7.57.0 Regression bug that was found in release candidate (RC) for release 7.57.0 labels Oct 16, 2025
@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.

@VGR-GIT VGR-GIT changed the title fix: cp-7.57.0 prevent unnecessary reward navigaton on account change fix: cp-7.57.0 prevent unnecessary reward navigation on account change Oct 16, 2025
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 16, 2025
cursor[bot]

This comment was marked as outdated.

@MetaMask MetaMask deleted a comment from sonarqubecloud Bot Oct 16, 2025
@sonarqubecloud

Copy link
Copy Markdown

@VGR-GIT VGR-GIT enabled auto-merge October 16, 2025 10:44
@VGR-GIT VGR-GIT added this pull request to the merge queue Oct 16, 2025
@EugeniyBykov EugeniyBykov self-requested a review October 16, 2025 11:23
Merged via the queue into main with commit bffddee Oct 16, 2025
86 checks passed
@VGR-GIT VGR-GIT deleted the fix-prevent-reward-navigation-account-change branch October 16, 2025 11:26
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 16, 2025
@metamaskbot metamaskbot added the release-7.58.0 Issue or pull request that will be included in release 7.58.0 label Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed regression-RC-7.57.0 Regression bug that was found in release candidate (RC) for release 7.57.0 release-7.58.0 Issue or pull request that will be included in release 7.58.0 size-M team-rewards Rewards team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Rewards tab opens when switching accounts

4 participants