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

v12.2.0 sync with v12.1.0 #26695

Merged
merged 287 commits into from
Aug 28, 2024
Merged

v12.2.0 sync with v12.1.0 #26695

merged 287 commits into from
Aug 28, 2024

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Aug 27, 2024

Description

Merge changes from v12.1.0 into the v12.2.0 RC.

Open in GitHub Codespaces

Related issues

N/A

Manual testing steps

N/A

Screenshots/Recordings

N/A

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.

danjm and others added 30 commits June 13, 2024 19:01
Cherry pick: update @metamask/smart-transactions-controller@^10.0.1->^10.1.2
…to Version v11.16.11 (#25304)

cherry-pick chore: revert recent gas api endpoint changes
04642d2 (#25230) into Version v11.16.11

Merge conflicts were resolved by comparing this PR diff with the
[intended
diff](https://github.com/MetaMask/metamask-extension/pull/25230/files).

```bash
CONFLICT (content): Merge conflict in app/scripts/metamask-controller.js
CONFLICT (content): Merge conflict in package.json
CONFLICT (content): Merge conflict in shared/constants/swaps.ts
CONFLICT (content): Merge conflict in shared/lib/swaps-utils.js
CONFLICT (content): Merge conflict in test/e2e/mock-e2e.js
CONFLICT (content): Merge conflict in test/jest/constants.js
CONFLICT (content): Merge conflict in yarn.lock
```

---------

Co-authored-by: MetaMask Bot <[email protected]>
… (#25318)

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

Ensures that the notification modal screen does not crash due to bad
inputs.
This was due to some bad type assertions, and we did not receive the
correct value expected for a function. A crash was caused due to trying
to `.split()` on an undefined.
This adds some safer logic and also fixes the area that call the
function with the wrong inputs.

PR: #25315
Commit Hash:
[0d32814](0d32814)

There were no merge conflicts when picking these commits.

<!--
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/25315?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Create a MATIC send/receive notification
2. Open details
3. See crash

## **Screenshots/Recordings**

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

### **Before**

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


![image](https://github.com/MetaMask/metamask-extension/assets/17534261/5708ddee-ad6c-4470-98c2-244d5caf7a04)

### **After**

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

![Screenshot 2024-06-14 at 12 34
11](https://github.com/MetaMask/metamask-extension/assets/17534261/4ee28636-9ef8-4f7e-9270-570940ebbe29)


## **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/develop/.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/develop/.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.
…mChain` error handling bug (#25339)

## **Description**
A bug was introduced in
#24415, where user
rejected request errors are not correctly handled in either
`wallet_switchEthereumChain` nor `wallet_addEthereumChain` calls.

At first we thought his just resulted in incorrect errors being returned
to dapps when users clicked cancel on `wallet_switchEthereumChain` calls
but it turns out this incorrect error handling results in very strange
and severe bugs when subsequent requests are enqueued in the
`QueuedRequestController` - the functionality of which is turned on by
default in release v12.0.0. See the `Before` video below.

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

## **Related issues**

See:
https://consensys.slack.com/archives/CTQAGKY5V/p1718385169900809?thread_ts=1718140104.578969&cid=CTQAGKY5V

## **Manual testing steps**
(have gnosis chain added to the wallet)
1. Go to https://metamask.github.io/test-dapp/ and connect 
2. Go to
https://docs.metamask.io/wallet/reference/wallet_switchethereumchain/
3. Submit the switch chain request on the dapp but do not confirm or
reject the confirmation
4. Go back to https://metamask.github.io/test-dapp/
5. Click `Send EIP-1559 Transaction`, see that the badge number in the
MM tray icon increments
6. Open the pop up and cancel the still pending switchChain confirmation
7. You should see the transactions you initiated on
https://metamask.github.io/test-dapp/ pop up now

## **Screenshots/Recordings**

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

### **Before**


https://github.com/MetaMask/metamask-extension/assets/34557516/a1e355d3-b39f-4670-975c-99beb878e75b

### **After**


https://github.com/MetaMask/metamask-extension/assets/34557516/60fb422b-cb63-4e6f-9be7-0065f9a52143

## **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/develop/.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/develop/.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.
…n is called for test networks (#25184) (#25260)

## **Description**

Cuts down the duplication of the NetworkListItem and ensures that
`setNetworkClientIdForDomain` is called for test networks so that
manually choosing a test network sends a signal to the dapp to change
chain.

PR: #25195
Commit Hash:
[c67aa3f](c67aa3f)

There were no merge conflicts when picking these commits.

<!--
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/25070?quickstart=1)

## **Related issues**

Fixes: The current Profile Syncing Feature doesn't fully respect Basic
Functionality when turned off. This ensures that the notifications
feature and profile syncing are actually turned off when Basic
Functionality if off.

## **Manual testing steps**

1. Go to a given dapp, connect using Ethereum Mainnet
2. Manually open MetaMask, click the network picker, choose Sepolia
3. See dapp change to sepolia

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

Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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/develop/.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?
4. What is the improvement/solution?
-->

[![Open in GitHub

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

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
5.

## **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/develop/.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
- [ ] 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/develop/.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/25260?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/develop/.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/develop/.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: Brian Bergeron <[email protected]>
Co-authored-by: Nidhi Kumari <[email protected]>
Adds data collection for marketing toggles (and toasts/warnings) on:
- Onboarding
- Toast in Wallet
- Settings page

<!--
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.
-->

<!--
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/24605?quickstart=1)

Fixes:
MetaMask/MetaMask-planning#2437
MetaMask/MetaMask-planning#2438
MetaMask/MetaMask-planning#2526

Onboarding checkbox:
Make the `metametrics.js` to return `renderOnboarding` instead of
`renderLegacyOnboarding`
1. Start a new account
2. There should be a new checkbox that asks for marketing consent
3. Checking it should set the marketing consent to true (check at
Settings, Securty tab page)

Security tab:
1. Go to Security tab
2. When checking the "Data collection for marketing" to `true`, the
"Participate in MetaMetrics" toggle should turn to `true`
3. When checking "Participate in MetaMetrics" to `false`, "Data
collection for marketing" should be set to `false`
4. When "Participate in Metametrics" is `true` and "Data collection for
marketing" is `true`, and the latter is set to `false`, a warning
message should appear.

Toast:
An already onboarded user will have the "dataCollectionForMarketing"
value as `null` (neither `true` or `false`). This will trigger the
toast.
1. By clicking on "I accept", it should set the "Data collection for
marketing" to `true`.
2. By closing the toast or clicking on "No thanks", it should set the
"Data collection for marketing" to `false`.

All of these actions should trigger subsequent Segment events.

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

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

<img width="646" alt="Screenshot 2024-05-20 at 14 19 53"
src="https://github.com/MetaMask/metamask-extension/assets/11148144/a13b70ec-1d89-4e9f-8df1-2096dd56e642">

https://github.com/MetaMask/metamask-extension/assets/11148144/5eb59902-768d-4d07-a112-5aeb5471587d

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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: Mircea Nistor <[email protected]>
Co-authored-by: NidhiKJha <[email protected]>
Co-authored-by: David Walsh <[email protected]>
Co-authored-by: legobeat <[email protected]>
Co-authored-by: Nidhi Kumari <[email protected]>
Fixes lint errors and e2e failures on v11.16.12, which would have been
introduced during conflict resolution when cherry-picking #24605

Specifically:
- `test/e2e/default-fixture.js` is deleted as that file does not exist
on master yet and is not used. However, importantly, the change made in
`test/e2e/default-fixture.js` in #24605 is now applied to
`test/e2e/fixture-builder.js` (this was needed for e2e tests to pass)
- delete
`ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.tsx`
and the associated test file, as these seem to be unused
- delete unused variables in
`ui/pages/settings/security-tab/security-tab.component.js`
…emoved (#25342) into v12.0.0 (#25353)

cherry-pick fix: re-add patch to nonce-tracker that was incorrectly
removed 8b764fa (#25342) into v12.0.0

Merge conflict in package.json:
```json
    "@expo/config/glob": "^10.3.10",
    "@expo/config-plugins/glob": "^10.3.10",
<<<<<<< HEAD
    "@metamask/network-controller": "patch:@metamask/network-controller@npm%3A18.1.2#~/.yarn/patches/@metamask-network-controller-npm-18.1.2-1bcb8d8610.patch",
    "@solana/web3.js/rpc-websockets": "^8.0.1"
=======
    "@metamask/network-controller": "patch:@metamask/network-controller@npm%3A19.0.0#~/.yarn/patches/@metamask-network-controller-npm-19.0.0-a5e0d1fe14.patch",
    "@solana/web3.js/rpc-websockets": "^8.0.1",
    "@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A19.0.0#~/.yarn/patches/@metamask-network-controller-npm-19.0.0-a5e0d1fe14.patch",
    "@metamask/gas-fee-controller@npm:^15.1.1": "patch:@metamask/gas-fee-controller@npm%3A15.1.2#~/.yarn/patches/@metamask-gas-fee-controller-npm-15.1.2-db4d2976aa.patch",
    "@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch"
>>>>>>> 8b764fa (fix: re-add patch to nonce-tracker that was incorrectly removed (#25342))
  },
  "dependencies": {
    "@babel/runtime": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch",
```
<!--
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**

This fixes push notifications so that they are not silent push
notifications. Some of our notifications we send through push, have a
different data shape. And since the shape was different (missing
polyfilled fields) it was not parsable and hence would only show the
default notification message

PR: #25340
Commit Hash:
[68d35f0](68d35f0)

**There were no merge conflicts when picking these commits.**

<!--
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/25340?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Create a wallet notification
2. See push notification received

## **Screenshots/Recordings**

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

### **Before**



![image](https://github.com/MetaMask/metamask-extension/assets/17534261/672702a9-b8d1-40ba-970e-adca7fbfedfc)


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

### **After**

![Screenshot 2024-06-14 at 21 04

55](https://github.com/MetaMask/metamask-extension/assets/17534261/3fcf8792-04c2-4825-89dc-389006f0e4f9)



<!-- [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/develop/.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/develop/.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**

This PR introduces two small fixes:
- If there are no snaps with notifications, the tabs for filtering
results are not displayed on the notifications page.
- Feature announcements are included in the onChain tab and not in the
Web3 tab.

[![Open in GitHub

Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25350?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/develop/.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/develop/.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.


<!--
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/25382?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/develop/.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/develop/.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.
Cherry-pick #25372 to
v12

this will fix the audit failure on the v12 branch/PR

Co-authored-by: legobeat <[email protected]>
Refactor initialization logic to defer creation of the offscreen
document until the `MetaMaskController` is initialized. This adds a
`offscreenPromise` to the controller that can be awaited for
functionality that requires the offscreen document to be created.

Additionally this PR adds a message that the offscreen document will
send once initial execution of the offscreen page has finished. This is
awaited in the `offscreenPromise`.

We await `offscreenPromise` before unlocking the keyrings as some
keyrings rely on the offscreen document to process requests, e.g.
hardware wallets.

There may be room for more improvements here though, that I have not
tackled in this PR. As the hardware wallet logic doesn't seem to wait
for iframes to fully load, so there is a chance of some missed messages.

I have tested that hardware wallet support, at least for Ledger, is
still working following the changes in this PR.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25302?quickstart=1)
Bump snaps packages to latest and handle breaking changes.

~~Depends on #25302~~

Summary of changes in the snaps deps:
- **Breaking:** Defer creation of offscreen document
- Fix an issue with decrypting legacy state blobs
- Support nested children in JSX
- Allow usage of the `tooltip` prop on `Row`
- Revert requiring at least one child in JSX components
- Update `onNameLookup` response to include `domainName`

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25292?quickstart=1)
<!--
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**

Improves stability of initial state sync when using Snaps UI.
Previously, sometimes, the `initialState` in the `SnapInterfaceContext`
wouldn't be updated when the content of the interface changed and thus
initial values would be missing.

This PR changes the implementation to use one selector in the renderer,
which only changes when the content does, but passes the `initialState`
and `context` to the `SnapInterfaceContext` itself. This way we are
guaranteed for the content and state to stay in sync.

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


Can be tested with a Snap like:

```ts
export const onRpcRequest: OnRpcRequestHandler = async ({
  origin,
  request,
}) => {
  switch (request.method) {
    case 'hello': {
      const id = await snap.request({
        method: 'snap_createInterface',
        params: {
          ui: (
            <Box>
              <Text>foo</Text>
              <Button>Click me</Button>
            </Box>
          ),
          context: { foo: 'bar' },
        },
      });

      return snap.request({
        method: 'snap_dialog',
        params: {
          type: 'confirmation',
          id,
        },
      });
    }
    default:
      throw new Error('Method not found.');
  }
};

export const onUserInput: OnUserInputHandler = async ({
  id,
  event,
  context,
}) => {
  if (event.type === 'ButtonClickEvent') {
    await snap.request({
      method: 'snap_updateInterface',
      params: {
        id,
        ui: (
          <Box>
            <Heading>Settings</Heading>
            <Input name="foo" value="foo" />
            <Form name="settingsForm">
              <Field label="foo">
                <Input name="foo" value="foo" />
              </Field>
            </Form>
          </Box>
        ),
      },
    });
    return;
  }
};

```
… policy components to not be shown (#25390)

<!--
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.
-->

Fixture / mock data in unit and e2e tests have been modified to handle
the privacy policy toast. These tests previously assumed that the
privacy policy toast, and in one case the updated metametrics component
during onboarding, would not be shown. However, their display was date
dependent. With this PR, the updated test data takes these dates into
account, and tests should now pass.

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

Fixes: failing tests on develop

e2e and unit tests should pass

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

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

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

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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: Dan Miller <[email protected]>
Cherry-pick #25364

## **Description**

This PR fixes a small bug in the display of certain types of
notifications. Specifically, in the case of receiving or sending
notifications of native currencies, the symbol of the native currency is
now correctly displayed.

[![Open in GitHub

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

## **Related issues**

Fixes:

## **Manual testing steps**

## **Screenshots/Recordings**

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

### **Before**

<img width="387" alt="Screenshot 2024-06-17 at 11 16 01"
src="https://github.com/MetaMask/metamask-extension/assets/1284304/5f66746e-7b32-45a3-899a-672ef65db44e">

### **After**

<img width="443" alt="Screenshot 2024-06-17 at 11 43 31"
src="https://github.com/MetaMask/metamask-extension/assets/1284304/686351cd-7940-499b-9e42-f626fe705677">

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


<!--
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/25376?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/develop/.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/develop/.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: Dan J Miller <[email protected]>
@Gudahtt Gudahtt changed the title V12.2.0 sync with v12.1.0 v12.2.0 sync with v12.1.0 Aug 27, 2024
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.

Copy link

socket-security bot commented Aug 27, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@sentry-internal/[email protected], npm/@sentry/[email protected], npm/@sentry/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@Gudahtt
Copy link
Member Author

Gudahtt commented Aug 27, 2024

@metamaskbot update-policies

@Gudahtt
Copy link
Member Author

Gudahtt commented Aug 27, 2024

@SocketSecurity ignore npm/@sentry-internal/[email protected]
@SocketSecurity ignore npm/@sentry/[email protected]
@SocketSecurity ignore npm/@sentry/[email protected]

These packages all require network access, this is expected

@metamaskbot
Copy link
Collaborator

Policies updated

davibroc and others added 3 commits August 27, 2024 20:27
The following Enhanced Transaction Protection modal has been removed
from onboarding steps so I also had to remove the step from the e2e test
automation script

<img width="358" alt="Screenshot 2024-07-17 at 10 14 06 PM"
src="https://github.com/user-attachments/assets/8a78d27c-3397-4039-aee6-ae0a7ae7023c">


## **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/25910?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/develop/.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/develop/.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.
…hange from Netwo… (#26704)

Redo the cherry-pick for PR #25765 :

Adds an end to end tests for:
* Autoswitching networks upon UI load
* Autoswitching networks upon last confirmation rejection/confirmation
* Signaling network change from extension to dapp

[![Open in GitHub

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

Fixes:

1. N/A, this is a E2E addition

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

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

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

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

Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.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/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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/26704?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/develop/.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/develop/.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: David Walsh <[email protected]>
@metamaskbot
Copy link
Collaborator

Builds ready [945b77c]
Page Load Metrics (74 ± 25 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint643931136632
domContentLoaded10412084
load41293745225
domInteractive10412084

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 68.99879% with 257 lines in your changes missing coverage. Please review.

Please upload report for BASE (Version-v12.2.0@fc0ee27). Learn more about missing BASE report.

Files with missing lines Patch % Lines
app/scripts/lib/setupSentry.js 16.24% 98 Missing ⚠️
...s/metamask-notifications/useSwitchNotifications.ts 0.00% 30 Missing ⚠️
...ns-settings/notifications-settings-per-account.tsx 0.00% 18 Missing ⚠️
...ges/settings/developer-options-tab/sentry-test.tsx 51.43% 17 Missing ⚠️
ui/components/multichain/pages/send/send.js 13.33% 13 Missing ⚠️
.../notifications-settings/notifications-settings.tsx 0.00% 10 Missing ⚠️
app/scripts/lib/sentry-filter-events.ts 11.11% 8 Missing ⚠️
app/scripts/ui.js 0.00% 7 Missing ⚠️
app/scripts/background.js 0.00% 5 Missing ⚠️
...s/metamask-notifications/metamask-notifications.ts 80.77% 5 Missing ⚠️
... and 27 more
Additional details and impacted files
@@                Coverage Diff                 @@
##             Version-v12.2.0   #26695   +/-   ##
==================================================
  Coverage                   ?   70.16%           
==================================================
  Files                      ?     1402           
  Lines                      ?    49435           
  Branches                   ?    13585           
==================================================
  Hits                       ?    34685           
  Misses                     ?    14750           
  Partials                   ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Gudahtt Gudahtt marked this pull request as ready for review August 28, 2024 19:28
@Gudahtt Gudahtt requested review from a team and kumavis as code owners August 28, 2024 19:28
Copy link
Contributor

@desi desi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I paired on this merge/sync. I also just did a scan of the changes and ran a super fast smoke test. LTGM

@Gudahtt Gudahtt merged commit ab3c6d0 into Version-v12.2.0 Aug 28, 2024
67 checks passed
@Gudahtt Gudahtt deleted the v12.2.0-sync-with-v12.1.0 branch August 28, 2024 19:44
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.