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 enabled state #30008

Closed
wants to merge 20 commits into from

Conversation

httpJunkie
Copy link
Contributor

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.

metamaskbot and others added 20 commits January 16, 2025 21:07
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29781?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

Co-authored-by: António Regadas <[email protected]>
…#29822)

## **Description**

This is a cherry pick of #29805, which bumps
`@metamask/snaps-rpc-methods` from `^11.9.0` to `^11.9.1`, which fixes
some bugs and improves error messages related to state management.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29822?quickstart=1)

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
…29853)

## **Description**

Cherry-picking #29809
into v12.11.0 after validating that fix is working as expected.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29853?quickstart=1)

## **Related issues**

Fixes: #29793

Co-authored-by: infiniteflower <[email protected]>
… popup (#29854)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Cherry-pick of #29832

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29854?quickstart=1)

## **Related issues**

Fixes:
https://metamask.sentry.io/issues/6223741673/events/45f69bd1c05d473a80ecb544a4d7014b/?environment=production&project=273505

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
Ledger team request us to upgrade the @ledgerhq/hw-app-eth to 6.42.0 to
fix ledger bug for EIP-712 content
Here is some comment from Kevin LAMBERT from ledger team:



and this is original thread
https://consensys.slack.com/archives/C02CYKAA8G1/p1737132760664329?thread_ts=1737106010.543919&cid=C02CYKAA8G1



<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29820?quickstart=1)

## **Related issues**

Fixes: #29813 

## **Manual testing steps**
Will require a full regression test for ledger feature.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

---------

Co-authored-by: Xiaoming Wang <[email protected]>
Co-authored-by: MetaMask Bot <[email protected]>
…nsactions are… (#29897)

…… (#29891)

… enabled

Cherrypicked PR:
#29891

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

We [recently enabled custom nonce editing in all redesigned
flows](#29627),
independently of the custom nonce editing settings toggle. This toggle
was still used in the legacy flows that are no longer visible by the
user, and it will be removed soon in an upcoming PR.

This resulted in nonce editing being available for smart transactions
which is not needed as the user should never need to manipulate nonces
of smart transactions. This PR fixes this by removing that option to the
user.

If smart transactions are enabled but the transaction is on a chain that
doesn't currently support smart transactions, the nonce is still
editable.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution? -->

[![Open in GitHub

Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29891?quickstart=1)

## **Related issues**

Fixes: #29841

## **Manual testing steps**

1. Go to this page... 2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29897?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
📦 🚀

---------

Co-authored-by: MetaMask Bot <[email protected]>
Co-authored-by: Matthew Walsh <[email protected]>
Co-authored-by: Micaela Estabillo <[email protected]>
Co-authored-by: Dan J Miller <[email protected]>
Co-authored-by: Nidhi Kumari <[email protected]>
Co-authored-by: Derek Brans <[email protected]>
#29950)

…hed (#29933)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution? -->

[![Open in GitHub

Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29933?quickstart=1)

This PR reapplies the fixes from #29411.

This PR fixes an issue where the "You Received" row in the Activity item
for a bridge tx would be partially filled in. Now we just hide it until
the bridge tx completes and we have all the necessary data to display
the row properly.

## **Related issues**

Reapplies the fixes from #29411

## **Manual testing steps**

1. Start a bridge tx
1. Get navigated to Activity list
1. Click on bridge tx
1. Observe that "You received" is not present until the bridge is
completed.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->




https://github.com/user-attachments/assets/8536e6c7-34c1-49a3-a692-7e7acbcf5994



## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29950?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
…tTransactions` (#29947)

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


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

---------


<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29947?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

Co-authored-by: Ramon Acitores <[email protected]>
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR cherry-picks
#29903

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29998?quickstart=1)

## **Related issues**

Fixes: #29903
Cherry-pick: #29960

## **Manual testing steps**

See original issue
#29903

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

Co-authored-by: Harika <[email protected]>
…29775) (#29975)

Cherry-picks: #29775

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution? -->

There has been a [recent change to stop relying on transaction decoding
third
parties](#29341). The
parsed transaction data now varies depending on the ABIs, and for some
ERC1155 tokens the `._to` argument is expressed as simply `.to`.

[![Open in GitHub

Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29775?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page... 2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

<img width="320" alt="Screenshot 2025-01-17 at 10 03 10"
src="https://github.com/user-attachments/assets/ef3c39a1-0002-48a8-a64b-5479a2122dc5"
/>


### **After**

<!-- [screenshots/recordings] -->

<img width="320" alt="Screenshot 2025-01-17 at 10 05 45"
src="https://github.com/user-attachments/assets/0b95a3bc-420a-4150-908b-bed6cbb20206"
/>


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding

Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.


<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29975?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
## **Description**

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

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`)

```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](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29968?quickstart=1)

## **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**

<img width="150" alt="after-fix" src="https://github.com/user-attachments/assets/fe33da33-7828-45e2-b7a1-8b7d60b12de5" />

### **After**

<img width="150" alt="after-fix" src="https://github.com/user-attachments/assets/fe33da33-7828-45e2-b7a1-8b7d60b12de5" />

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable
- [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [x] 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.
@httpJunkie httpJunkie added type-bug Something isn't working Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. needs-qa Label will automate into QA workspace team-transactions Transactions team release-12.11.0 Issue or pull request that will be included in release 12.11.0 labels Jan 30, 2025
@httpJunkie httpJunkie self-assigned this Jan 30, 2025
@httpJunkie httpJunkie requested review from a team as code owners January 30, 2025 14:30
@httpJunkie httpJunkie requested review from a team as code owners January 30, 2025 14:30
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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 30, 2025
@httpJunkie httpJunkie closed this Jan 30, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2025
@httpJunkie
Copy link
Contributor Author

Wrong branch, cant select the right one.

1 similar comment
@httpJunkie
Copy link
Contributor Author

Wrong branch, cant select the right one.

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 needs-qa Label will automate into QA workspace release-12.11.0 Issue or pull request that will be included in release 12.11.0 Sev1-high High severity; partial loss of service with severe impact upon users, with no workaround. team-transactions Transactions team type-bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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