Skip to content

Commit d81e865

Browse files
temp+fix: (cp-12.17.1) patch notification services controller (#32391)
## **Description** Wow, huge oopsy on my side. Urgh, a little annoyed that I didn't spot this earlier. After doing some thorough debugging, I found an infinite state update loop from the NotificationServicesController. I didn't find the full context but this controller: - Listens to `KeyringController:stateChange` events - When receiving an event we perform a `KeyringController:withKeyring` action. Somewhere above (or potentially another controller firing events or actions?) will then fire another `KeyringController:stateChange` and the loop repeats. This prevents other state updates and redux updates. Controller fix: MetaMask/core#5731 However this patch can be an interim for existing releases or until the CORE package is released. <details><summary>Screenshot of background logs</summary> ![Screenshot 2025-04-29 at 22 43 03](https://github.com/user-attachments/assets/a1f07672-d471-4e60-8124-e6644df0b5f4) </details> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/32391?quickstart=1) ## **Related issues** Fixes: Potentially fixes #32416 #31422 ## **Manual testing steps** 1. Turn on notifications 2. Try dismissing the carousel banners 3. Try switching networks 4. Try the send flow where you send 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 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.
1 parent 9ce7f3f commit d81e865

File tree

1,067 files changed

+30803
-45210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,067 files changed

+30803
-45210
lines changed

.circleci/config.yml

+304
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,29 @@ executors:
2525
resource_class: medium+
2626
environment:
2727
NODE_OPTIONS: --max_old_space_size=4096
28+
playwright:
29+
docker:
30+
- image: mcr.microsoft.com/playwright:v1.44.1-focal
31+
resource_class: medium
2832

2933
orbs:
3034
gh: circleci/[email protected]
35+
codecov: codecov/[email protected]
36+
slack: circleci/[email protected]
37+
38+
rc_branch_only: &rc_branch_only
39+
filters:
40+
branches:
41+
only:
42+
- /^Version-v(\d+)[.](\d+)[.](\d+)/
43+
44+
main_master_rc_only: &main_master_rc_only
45+
filters:
46+
branches:
47+
only:
48+
- main
49+
- master
50+
- /^Version-v(\d+)[.](\d+)[.](\d+)/
3151

3252
aliases:
3353
# Shallow Git Clone
@@ -101,6 +121,9 @@ workflows:
101121
- prep-build-test-mv2:
102122
requires:
103123
- prep-deps
124+
- prep-build-test-webpack:
125+
requires:
126+
- prep-deps
104127
- prep-build-test-flask:
105128
requires:
106129
- prep-deps
@@ -110,6 +133,24 @@ workflows:
110133
- prep-build-ts-migration-dashboard:
111134
requires:
112135
- prep-deps
136+
- test-e2e-chrome-webpack:
137+
<<: *main_master_rc_only
138+
requires:
139+
- prep-build-test-webpack
140+
- get-changed-files-with-git-diff
141+
- test-e2e-chrome:
142+
requires:
143+
- prep-build-test
144+
- get-changed-files-with-git-diff
145+
- test-e2e-firefox:
146+
<<: *main_master_rc_only
147+
requires:
148+
- prep-build-test-mv2
149+
- get-changed-files-with-git-diff
150+
- test-e2e-chrome-rpc:
151+
requires:
152+
- prep-build-test
153+
- get-changed-files-with-git-diff
113154
- test-api-specs:
114155
requires:
115156
- prep-build-test
@@ -118,6 +159,29 @@ workflows:
118159
requires:
119160
- prep-build-test-flask
120161
- get-changed-files-with-git-diff
162+
- test-e2e-chrome-multiple-providers:
163+
requires:
164+
- prep-build-test
165+
- get-changed-files-with-git-diff
166+
- test-e2e-chrome-flask:
167+
requires:
168+
- prep-build-test-flask
169+
- get-changed-files-with-git-diff
170+
- test-e2e-firefox-flask:
171+
<<: *main_master_rc_only
172+
requires:
173+
- prep-build-test-flask-mv2
174+
- test-e2e-swap-playwright - OPTIONAL:
175+
requires:
176+
- prep-build
177+
- test-e2e-chrome-vault-decryption:
178+
filters:
179+
branches:
180+
only:
181+
- main
182+
- /^Version-v(\d+)[.](\d+)[.](\d+)/
183+
requires:
184+
- prep-build
121185
- validate-source-maps:
122186
requires:
123187
- prep-build
@@ -144,6 +208,13 @@ workflows:
144208
- validate-source-maps-flask
145209
- test-mozilla-lint-mv2
146210
- test-mozilla-lint-flask-mv2
211+
- test-e2e-chrome
212+
- test-e2e-chrome-multiple-providers
213+
- test-e2e-firefox
214+
- test-e2e-chrome-flask
215+
- test-e2e-firefox-flask
216+
- test-e2e-chrome-vault-decryption
217+
- test-e2e-chrome-webpack
147218
- job-publish-prerelease:
148219
requires:
149220
- prep-deps
@@ -504,6 +575,26 @@ jobs:
504575
- dist-test-mv2
505576
- builds-test-mv2
506577

578+
prep-build-test-webpack:
579+
executor: node-linux-medium
580+
steps:
581+
- run: *shallow-git-clone-and-enable-vnc
582+
- attach_workspace:
583+
at: .
584+
- run:
585+
name: Activate yarn
586+
command: corepack enable
587+
- run:
588+
name: Build extension for testing
589+
command: yarn build:test:webpack
590+
- run:
591+
name: Move test build to 'dist-test-webpack' to avoid conflict with production build
592+
command: mv ./dist ./dist-test-webpack
593+
- persist_to_workspace:
594+
root: .
595+
paths:
596+
- dist-test-webpack
597+
507598
prep-build-ts-migration-dashboard:
508599
executor: node-browsers-small
509600
steps:
@@ -530,6 +621,27 @@ jobs:
530621
name: Rerun workflows from failed
531622
command: yarn ci-rerun-from-failed
532623

624+
test-e2e-chrome-webpack:
625+
executor: node-browsers-medium-plus
626+
parallelism: 20
627+
steps:
628+
- run: *shallow-git-clone-and-enable-vnc
629+
- run: sudo corepack enable
630+
- attach_workspace:
631+
at: .
632+
- run:
633+
name: Move test build to dist
634+
command: mv ./dist-test-webpack ./dist
635+
- run:
636+
name: test:e2e:chrome:webpack
637+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:chrome:webpack
638+
no_output_timeout: 5m
639+
- store_artifacts:
640+
path: test-artifacts
641+
destination: test-artifacts
642+
- store_test_results:
643+
path: test/test-results/e2e
644+
533645
test-api-specs-multichain:
534646
executor: node-browsers-medium-plus
535647
steps:
@@ -592,6 +704,198 @@ jobs:
592704
path: html-report
593705
destination: html-report
594706

707+
test-e2e-chrome:
708+
executor: node-browsers-medium-plus
709+
parallelism: 20
710+
steps:
711+
- run: *shallow-git-clone-and-enable-vnc
712+
- run: sudo corepack enable
713+
- attach_workspace:
714+
at: .
715+
- run:
716+
name: Move test build to dist
717+
command: mv ./dist-test ./dist
718+
- run:
719+
name: Move test zips to builds
720+
command: mv ./builds-test ./builds
721+
- run:
722+
name: test:e2e:chrome
723+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:chrome
724+
no_output_timeout: 5m
725+
- store_artifacts:
726+
path: test-artifacts
727+
destination: test-artifacts
728+
- store_test_results:
729+
path: test/test-results/e2e
730+
731+
test-e2e-chrome-rpc:
732+
executor: node-browsers-medium
733+
parallelism: 1
734+
steps:
735+
- run: *shallow-git-clone-and-enable-vnc
736+
- run: sudo corepack enable
737+
- attach_workspace:
738+
at: .
739+
- run:
740+
name: Move test build to dist
741+
command: mv ./dist-test ./dist
742+
- run:
743+
name: Move test zips to builds
744+
command: mv ./builds-test ./builds
745+
- run:
746+
name: test:e2e:chrome:rpc
747+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:chrome:rpc
748+
no_output_timeout: 5m
749+
- store_artifacts:
750+
path: test-artifacts
751+
destination: test-artifacts
752+
- store_test_results:
753+
path: test/test-results/e2e
754+
755+
test-e2e-chrome-multiple-providers:
756+
executor: node-browsers-small
757+
parallelism: 1
758+
steps:
759+
- run: *shallow-git-clone-and-enable-vnc
760+
- run: sudo corepack enable
761+
- attach_workspace:
762+
at: .
763+
- run:
764+
name: Move test build to dist
765+
command: mv ./dist-test ./dist
766+
- run:
767+
name: Move test zips to builds
768+
command: mv ./builds-test ./builds
769+
- run:
770+
name: test:e2e:chrome:multi-provider
771+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:chrome:multi-provider
772+
no_output_timeout: 5m
773+
- store_artifacts:
774+
path: test-artifacts
775+
destination: test-artifacts
776+
- store_test_results:
777+
path: test/test-results/e2e
778+
779+
test-e2e-chrome-vault-decryption:
780+
executor: node-browsers-medium-plus
781+
steps:
782+
- run: *shallow-git-clone-and-enable-vnc
783+
- run: sudo corepack enable
784+
- attach_workspace:
785+
at: .
786+
- run:
787+
name: test:e2e:single
788+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.ts --browser chrome
789+
no_output_timeout: 5m
790+
- store_artifacts:
791+
path: test-artifacts
792+
destination: test-artifacts
793+
- store_test_results:
794+
path: test/test-results/e2e
795+
796+
test-e2e-firefox-flask:
797+
executor: node-browsers-medium-plus
798+
parallelism: 10
799+
steps:
800+
- run: *shallow-git-clone-and-enable-vnc
801+
- run: sudo corepack enable
802+
- attach_workspace:
803+
at: .
804+
- run:
805+
name: Move test build to dist
806+
command: mv ./dist-test-flask-mv2 ./dist
807+
- run:
808+
name: Move test zips to builds
809+
command: mv ./builds-test-flask-mv2 ./builds
810+
- run:
811+
name: test:e2e:firefox:flask
812+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:firefox:flask
813+
no_output_timeout: 5m
814+
- store_artifacts:
815+
path: test-artifacts
816+
destination: test-artifacts
817+
- store_test_results:
818+
path: test/test-results/e2e
819+
820+
test-e2e-chrome-flask:
821+
executor: node-browsers-medium-plus
822+
parallelism: 8
823+
steps:
824+
- run: *shallow-git-clone-and-enable-vnc
825+
- run: sudo corepack enable
826+
- attach_workspace:
827+
at: .
828+
- run:
829+
name: Move test build to dist
830+
command: mv ./dist-test-flask ./dist
831+
- run:
832+
name: Move test zips to builds
833+
command: mv ./builds-test-flask ./builds
834+
- run:
835+
name: test:e2e:chrome:flask
836+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:chrome:flask
837+
no_output_timeout: 5m
838+
- store_artifacts:
839+
path: test-artifacts
840+
destination: test-artifacts
841+
- store_test_results:
842+
path: test/test-results/e2e
843+
844+
test-e2e-swap-playwright - OPTIONAL:
845+
executor: playwright
846+
parallelism: 2
847+
steps:
848+
- run: *shallow-git-clone-and-enable-vnc
849+
- run: corepack enable
850+
- attach_workspace:
851+
at: .
852+
- run:
853+
name: Install chromium
854+
command: yarn playwright install chromium
855+
- run:
856+
name: test:e2e:chrome:swap
857+
command: |
858+
TESTFILES=$(circleci tests glob "test/e2e/playwright/swap/**/*.spec.ts")
859+
echo "$TESTFILES"
860+
echo "$TESTFILES" | timeout 20m circleci tests run --command="xvfb-run xargs yarn playwright test --project=swap" verbose || true
861+
# above line makes it never fail, and these tests are going away soon
862+
no_output_timeout: 10m
863+
- slack/notify:
864+
event: fail
865+
mentions: <@davide.brocchetto>
866+
template: basic_fail_1
867+
channel: C06BEG71R1S
868+
- store_artifacts:
869+
name: html-report and artifacts
870+
path: public/playwright/playwright-reports
871+
- store_test_results:
872+
name: report for pipeline integration
873+
path: public/playwright/playwright-reports/junit/test-results.xml
874+
875+
test-e2e-firefox:
876+
executor: node-browsers-medium-plus
877+
parallelism: 24
878+
steps:
879+
- run: *shallow-git-clone-and-enable-vnc
880+
- run: sudo corepack enable
881+
- attach_workspace:
882+
at: .
883+
- run:
884+
name: Move test build to dist
885+
command: mv ./dist-test-mv2 ./dist
886+
- run:
887+
name: Move test zips to builds
888+
command: mv ./builds-test-mv2 ./builds
889+
- run:
890+
name: test:e2e:firefox
891+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:firefox
892+
no_output_timeout: 5m
893+
- store_artifacts:
894+
path: test-artifacts
895+
destination: test-artifacts
896+
- store_test_results:
897+
path: test/test-results/e2e
898+
595899
job-publish-prerelease:
596900
executor: node-browsers-medium
597901
steps:

.depcheckrc.yml

-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ignores:
2424
- '@metamask/phishing-warning' # statically hosted as part of some e2e tests
2525
- '@metamask/test-dapp'
2626
- '@metamask/test-dapp-multichain'
27-
- '@metamask/test-dapp-solana'
2827
- '@metamask/design-tokens' # Only imported in index.css
2928
- '@tsconfig/node22' # required dynamically by TS, used in tsconfig.json
3029
- '@sentry/cli' # invoked as `sentry-cli`
@@ -44,8 +43,6 @@ ignores:
4443
- 'prettier-eslint' # used by the Prettier ESLint VSCode extension
4544
- 'tar' # used by foundryup.ts
4645
- 'minipass' # used by foundryup.ts
47-
- 'tweetnacl' # used by solana-wallet-standard
48-
- 'bs58' # used by solana-wallet-standard
4946
# storybook
5047
- '@storybook/cli'
5148
- '@storybook/core'
@@ -88,14 +85,6 @@ ignores:
8885
- '@testing-library/dom'
8986
- 'mini-css-extract-plugin'
9087
- 'webpack-cli'
91-
# preinstalled snaps
92-
- '@metamask/preinstalled-example-snap'
93-
- '@metamask/ens-resolver-snap'
94-
- '@metamask/message-signing-snap'
95-
- '@metamask/account-watcher'
96-
- '@metamask/bitcoin-wallet-snap'
97-
- '@metamask/solana-wallet-snap'
98-
- '@metamask/institutional-wallet-snap'
9988

10089
# files depcheck should not parse
10190
ignorePatterns:

0 commit comments

Comments
 (0)