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

fix: handle null STX status as pre-enabled state #29968

Merged
merged 11 commits into from
Jan 30, 2025

Conversation

httpJunkie
Copy link
Contributor

@httpJunkie httpJunkie commented Jan 29, 2025

Description

Only remaining QA issue for feature: [EXT] STX Banner Alert & STX x Default Migration

Update migration to treat null preference value as an existing enabled state, preventing unneeded banner display for v12.6.0-12.7.2 migrations.

The update removes the null check in the migration's transformState function (near line 46 of 135.ts)

  if (
    currentOptInStatus === undefined ||
    currentOptInStatus === null ||  // remove this line
    (currentOptInStatus === false && !hasExistingSmartTransactions(state))
  ) {

And let the condition fall through to the else block. This will ensure that smartTransactionsMigrationApplied: false and ensure that we don't see a banner on Transaction Confirmation.

Open in GitHub Codespaces

Related issues

Fixes: #29970

Description
Migration fails when the origin extension is version 12.7.x (tested 1 and 2)
In this cases, the alert banner is displayed in the confirmation screen (e.g: send and swaps) when the parameter STX in settings was enabled in the older extension.

Expected behavior
The behaviour should be:
extension 12.11.0 < with STX activated -> update to 12.11.0 and no banner is displayed in the confirmation screen

Manual testing steps for fix

  1. Migrate from any version 12.6.* to 12.7.* to 12.10.1 (or 12.11.0 depending)
  2. Ensure that STX is ON in the old version (before migrating to the newer version)
  3. After migration try to Swap or Send on Ethereum Mainnet & Sepolia and ensure there is no STX Banner Alert shown

Screenshots/Recordings

For users with STX ON before and after Migration:

Before

after-fix

After

after-fix

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.

Update migration to treat null preference value as an existing enabled state,
preventing unneeded banner display for v12.6.0-12.7.2 migrations.
@httpJunkie httpJunkie added the team-transactions Transactions team label Jan 29, 2025
@httpJunkie httpJunkie self-assigned this Jan 29, 2025
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.

- ui/components/app/snaps/snap-ui-address/snap-ui-address.test.tsx
- ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx
@httpJunkie httpJunkie requested review from a team as code owners January 29, 2025 16:05
- ui/components/multichain/connect-accounts-modal/__snapshots__/connect-accounts-modal.test.tsx.snap
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 29, 2025
- ui/components/multichain/connect-accounts-modal/__snapshots__/connect-accounts-modal.test.tsx.snap
Adds Google's image hosting domain to allowed hosts list for Solana
account testing.
@httpJunkie httpJunkie requested a review from a team as a code owner January 29, 2025 17:08
@httpJunkie httpJunkie marked this pull request as draft January 29, 2025 17:10
@metamaskbot
Copy link
Collaborator

Builds ready [2972e76]
Page Load Metrics (1921 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29621671737484232
domContentLoaded16442407188817182
load16552412192117685
domInteractive29106482412
backgroundConnect10110302612
firstReactRender17104412914
getState697222311
initialActions01000
loadScripts11801823137914570
setupStore980272311
uiStartup192329702257284136
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -10 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@httpJunkie httpJunkie added release-12.11.0 Issue or pull request that will be included in release 12.11.0 and removed INVALID-PR-TEMPLATE PR's body doesn't match template labels Jan 29, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [54b7ef1]
Page Load Metrics (1824 ± 81 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29724061669468225
domContentLoaded15982379179716981
load16122395182416981
domInteractive26116422411
backgroundConnect115828178
firstReactRender1684352311
getState55417157
initialActions00000
loadScripts11551872134415273
setupStore758282211
uiStartup18432645209520196
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -10 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [c1df208]
Page Load Metrics (1464 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1306167314628038
domContentLoaded1280165114418038
load1301167714648340
domInteractive226830136
backgroundConnect86424189
firstReactRender1498352914
getState46515188
initialActions00000
loadScripts877122210357435
setupStore65312136
uiStartup14822149170016579
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -10 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [11904f6]
Page Load Metrics (1667 ± 68 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24520801599344165
domContentLoaded14482000164314067
load14572043166714268
domInteractive2111035199
backgroundConnect95324168
firstReactRender1578432612
getState5481094
initialActions01000
loadScripts10521467120211656
setupStore794202311
uiStartup167329611972286137
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -10 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [bb84ecb]
Page Load Metrics (1599 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1470179216008340
domContentLoaded1461177715778541
load1470179115998541
domInteractive227135157
backgroundConnect97526188
firstReactRender1572342311
getState447994
initialActions01000
loadScripts1041129611407235
setupStore75316168
uiStartup1648204418059947
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -10 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 30, 2025
@httpJunkie httpJunkie removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 30, 2025
@httpJunkie httpJunkie marked this pull request as ready for review January 30, 2025 13:12
@metamaskbot
Copy link
Collaborator

Builds ready [367f825]
Page Load Metrics (1697 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26321721614347167
domContentLoaded13982101165714570
load14062255169717283
domInteractive247138168
backgroundConnect10192404321
firstReactRender1695452713
getState4152233617
initialActions01000
loadScripts10041614119913062
setupStore75314136
uiStartup158228821964271130
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -10 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@httpJunkie httpJunkie added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit 5bbe82c Jan 30, 2025
74 checks passed
@httpJunkie httpJunkie deleted the fix/handle-null-stx-state branch January 30, 2025 14:11
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
@metamaskbot metamaskbot added the release-12.12.0 Issue or pull request that will be included in release 12.12.0 label 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-12.12.0 Issue or pull request that will be included in release 12.12.0 team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Migration fails with extension version 12.7.x
4 participants