Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick: fix: Update STX Banner Alert, include chainSupportsSmartTransactions #29947

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

httpJunkie
Copy link
Contributor

@httpJunkie httpJunkie commented Jan 28, 2025

Cherry-pick of #29911
Related Issue (#29869)

  • Added selectors for chain support and preference enabled
  • Updated alertConditions to include chain support and preference enabled checks

The banner will now only show if the chain supports smart transactions and they are enabled in preferences.

Description

  1. Reason for change: The Smart Transactions banner was showing incorrectly for users who had STX enabled before migration. The banner should only show for users when STX is newly enabled by the migration.

  2. Improvement/solution: Modified migration script to only set smartTransactionsMigrationApplied when STX is newly enabled during migration, rather than setting it for all migrated users. This ensures the banner's display logic correctly identifies users who need to see the STX announcement.

Related issues

Fixes: #29869

Manual testing steps

  1. Install older version of MetaMask with STX enabled
  2. Upgrade to version with these changes
  3. Verify banner does not show for pre-enabled STX users
  4. Install older version with STX disabled
  5. Upgrade to version with these changes
  6. Verify banner shows when migration enables STX

Screenshots/Recordings

Load old version 12.5.0 and turn STX OFF, go through migration and ensure that:

  • STX is now ON
  • Banner Alert shows only on STX supported chains
stx-off-to-on.mp4

Load old version 12.5.0 and turn STX ON, go through migration and ensure that:

  • STX is still ON
  • Banner Alert does not show
stx-on-to-on.mp4

Before

Banner shows for all users after migration, even those who had STX previously enabled.

After

Banner only shows for users where migration newly enabled STX.

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards
  • I've completed the PR template to the best of my ability
  • I've included tests:
    • Updated migration tests to verify new behavior
    • Updated component tests to work with new migration logic
    • Fixed existing integration tests
  • I've documented my code using JSDoc format where applicable
  • I've applied the right labels on the PR

Pre-merge reviewer checklist

  • I've manually tested the PR
  • I confirm that this PR addresses all acceptance criteria and includes necessary testing evidence

Description

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

#29911)

- Added selectors for chain support and preference enabled
- Updated alertConditions to include chain support and preference
enabled checks

The banner will now only show if the chain supports smart transactions
and they are enabled in preferences.


## **Description**

1. Reason for change: The Smart Transactions banner was showing
incorrectly for users who had STX enabled before migration. The banner
should only show for users when STX is newly enabled by the migration.

2. Improvement/solution: Modified migration script to only set
`smartTransactionsMigrationApplied` when STX is newly enabled during
migration, rather than setting it for all migrated users. This ensures
the banner's display logic correctly identifies users who need to see
the STX announcement.

## **Related issues**

Fixes: #[issue number]

## **Manual testing steps**

1. Install older version of MetaMask with STX enabled
2. Upgrade to version with these changes
3. Verify banner does not show for pre-enabled STX users
4. Install older version with STX disabled
5. Upgrade to version with these changes
6. Verify banner shows when migration enables STX

## **Screenshots/Recordings**

Load old version 12.5.0 and turn STX OFF, go through migration and
ensure that:
- STX is now ON
- Banner Alert shows only on STX supported chains


https://github.com/user-attachments/assets/f85da8e9-5e4f-46eb-9132-95a8129a4f4e

Load old version 12.5.0 and turn STX ON, go through migration and ensure
that:
- STX is still ON
- Banner Alert does not show


https://github.com/user-attachments/assets/0bff702c-a24d-4d52-b6a3-2d9615589fd5

### **Before**
Banner shows for all users after migration, even those who had STX
previously enabled.

### **After**
Banner only shows for users where migration newly enabled STX.

## **Pre-merge author checklist**

- [x] I've followed MetaMask Contributor Docs and MetaMask Extension
Coding Standards
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests:
  - Updated migration tests to verify new behavior
  - Updated component tests to work with new migration logic
  - Fixed existing integration tests
- [x] I've documented my code using JSDoc format where applicable
- [x] I've applied the right labels on the PR

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR
- [x] I confirm that this PR addresses all acceptance criteria and
includes necessary testing evidence

---------

Co-authored-by: Ramon Acitores <[email protected]>
@httpJunkie httpJunkie requested review from a team as code owners January 28, 2025 19:49
Copy link
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.

@httpJunkie httpJunkie self-assigned this Jan 28, 2025
@httpJunkie httpJunkie added team-confirmations Push issues to confirmations team team-transactions Transactions team Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. release-blocker This bug is blocking the next release type-bug Something isn't working release-12.11.0 Issue or pull request that will be included in release 12.11.0 labels Jan 28, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [3fca9ef]
Page Load Metrics (1783 ± 71 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15682069177915072
domContentLoaded15532046174314067
load15702074178314771
domInteractive24123432612
backgroundConnect693332211
firstReactRender1682292010
getState5150343517
initialActions01000
loadScripts11291593129412259
setupStore75716178
uiStartup17462548205119794

@dbrans dbrans changed the title fix: Update STX Banner Alert, include chainSupportsSmartTransactions cherry-pick: fix: Update STX Banner Alert, include chainSupportsSmartTransactions Jan 30, 2025
@dbrans dbrans merged commit 9862c9d into Version-v12.11.0 Jan 30, 2025
93 of 95 checks passed
@dbrans dbrans deleted the fix/stx-banner-migration branch January 30, 2025 13:30
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 release-blocker This bug is blocking the next release Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-confirmations Push issues to confirmations team team-transactions Transactions team type-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants