feat: new metamask notifications
Description
This PR introduces new features within the MetaMask Extension:
Authentication -> Users can choose to authenticate using the new Profile Syncing feature. This functionality allows users to anonymously share data across different clients authenticated with the same account. MetaMask cannot decrypt this information. Notifications -> Users can decide whether to enable notifications to track their on-chain activities. Notifications can be viewed on a dedicated page or received via browser notifications. Users can choose to activate or deactivate these services at any time.
Four new controllers are managing the feature, already merged in previous PRs:
- Authentication Controller
- User Storage Controller
- Push Notification Controller
- MetaMask Notification Controller
Related issues
Manual testing steps
To test the function, it is necessary:
- Follow the onboarding procedure.
- In the menu, use the notifications option to enable notifications.
At this point, the user will have enabled notifications.
Screenshots/Recordings
Before
After
To see the entire flow, there is this Figma where the various steps used are described:
https://www.figma.com/design/c7GgNw2kScGrVyRGAPhwEd/Notifications
Pre-merge author checklist
- [x] I’ve followed MetaMask Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). 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.
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.
Codecov Report
Attention: Patch coverage is 37.47801% with 1066 lines in your changes are missing coverage. Please review.
Project coverage is 65.91%. Comparing base (
6bd968b) to head (1c53708).
:exclamation: Current head 1c53708 differs from pull request most recent head 0e5c10a
Please upload reports for the commit 0e5c10a to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## develop #24482 +/- ##
===========================================
- Coverage 67.42% 65.91% -1.51%
===========================================
Files 1295 1346 +51
Lines 50378 52534 +2156
Branches 13047 13484 +437
===========================================
+ Hits 33964 34625 +661
- Misses 16414 17909 +1495
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The notifications settings page seems to have a major perf issue:
Screen.Recording.2024-05-17.at.11.53.37.AM.mov
hey @darkwing , thank you very much. The bug you reported for the settings page is related to the issue highlighted in this PR https://github.com/MetaMask/metamask-extension/pull/24623. If you agree, we would like to have this PR ready to then merge the next one
The notifications settings page seems to have a major perf issue: Screen.Recording.2024-05-17.at.11.53.37.AM.mov
hey @darkwing , thank you very much. The bug you reported for the settings page is related to the issue highlighted in this PR #24623. If you agree, we would like to have this PR ready to then merge the next one
For more context, the KDF used is taking a considerable amount of time which is blocking the UI on MV2. (This is not an issue on MV3 as the logic is ran in the service worker).
See image
That separate PR significantly improves the time taken and should reduce blocking the rendering on MV2.
Also I'll do some more investigation on why this is blocking (the logic is async, how is it blocking the main thread lol)
Builds ready [26e1329]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1229 ± 623 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 65 | 174 | 112 | 36 | 17 |
| domContentLoaded | 9 | 54 | 20 | 15 | 7 | ||
| load | 52 | 3083 | 1229 | 1297 | 623 | ||
| domInteractive | 9 | 54 | 20 | 15 | 7 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 43.96 KiB (1.29%)
- ui: 156.35 KiB (2.37%)
- common: 10.78 KiB (0.17%)
Builds ready [06e037e]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1620 ± 637 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 66 | 1038 | 163 | 202 | 97 |
| domContentLoaded | 10 | 388 | 37 | 81 | 39 | ||
| load | 58 | 3276 | 1620 | 1327 | 637 | ||
| domInteractive | 10 | 388 | 37 | 81 | 39 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.29%)
- ui: 156.44 KiB (2.37%)
- common: 11.14 KiB (0.18%)
Builds ready [7e4f7e3]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (981 ± 608 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 67 | 170 | 101 | 35 | 17 |
| domContentLoaded | 8 | 78 | 20 | 20 | 10 | ||
| load | 55 | 3142 | 981 | 1265 | 608 | ||
| domInteractive | 8 | 78 | 20 | 20 | 10 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.29%)
- ui: 156.44 KiB (2.37%)
- common: 11.14 KiB (0.18%)
Builds ready [210baa9]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (904 ± 549 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 62 | 260 | 100 | 43 | 21 |
| domContentLoaded | 9 | 106 | 20 | 22 | 11 | ||
| load | 50 | 2795 | 904 | 1144 | 549 | ||
| domInteractive | 9 | 106 | 20 | 22 | 11 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.27%)
- ui: 156.44 KiB (2.37%)
- common: 11.14 KiB (0.18%)
Builds ready [7a6145f]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (765 ± 516 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 61 | 229 | 97 | 41 | 20 |
| domContentLoaded | 9 | 55 | 18 | 14 | 7 | ||
| load | 50 | 2528 | 765 | 1075 | 516 | ||
| domInteractive | 9 | 55 | 18 | 14 | 7 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.27%)
- ui: 156.44 KiB (2.36%)
- common: 11.14 KiB (0.18%)
Builds ready [1c53708]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1169 ± 582 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 63 | 237 | 108 | 39 | 19 |
| domContentLoaded | 10 | 94 | 21 | 19 | 9 | ||
| load | 51 | 2828 | 1169 | 1212 | 582 | ||
| domInteractive | 10 | 94 | 21 | 19 | 9 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.27%)
- ui: 156.44 KiB (2.36%)
- common: 11.14 KiB (0.18%)
Builds ready [1c53708]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1169 ± 582 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 63 | 237 | 108 | 39 | 19 |
| domContentLoaded | 10 | 94 | 21 | 19 | 9 | ||
| load | 51 | 2828 | 1169 | 1212 | 582 | ||
| domInteractive | 10 | 94 | 21 | 19 | 9 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.27%)
- ui: 156.44 KiB (2.36%)
- common: 11.14 KiB (0.18%)
"approved" in order to dismiss resolved "request for changes"
Builds ready [1c53708]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1169 ± 582 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 63 | 237 | 108 | 39 | 19 |
| domContentLoaded | 10 | 94 | 21 | 19 | 9 | ||
| load | 51 | 2828 | 1169 | 1212 | 582 | ||
| domInteractive | 10 | 94 | 21 | 19 | 9 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.27%)
- ui: 156.44 KiB (2.36%)
- common: 11.14 KiB (0.18%)
Builds ready [0e5c10a]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1037 ± 577 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 63 | 291 | 102 | 52 | 25 |
| domContentLoaded | 9 | 85 | 18 | 17 | 8 | ||
| load | 52 | 3202 | 1037 | 1201 | 577 | ||
| domInteractive | 9 | 85 | 18 | 17 | 8 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 44 KiB (1.27%)
- ui: 156.44 KiB (2.36%)
- common: 11.14 KiB (0.18%)
Builds ready [341d8b7]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (303 ± 338 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 62 | 124 | 86 | 17 | 8 |
| domContentLoaded | 9 | 35 | 13 | 6 | 3 | ||
| load | 51 | 2427 | 303 | 703 | 338 | ||
| domInteractive | 9 | 35 | 12 | 6 | 3 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 43.43 KiB (1.24%)
- ui: 159.42 KiB (2.40%)
- common: 11.22 KiB (0.18%)
Builds ready [636d009]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (619 ± 537 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 69 | 163 | 90 | 26 | 13 |
| domContentLoaded | 8 | 22 | 13 | 4 | 2 | ||
| load | 56 | 3129 | 619 | 1119 | 537 | ||
| domInteractive | 8 | 22 | 13 | 4 | 2 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 43.43 KiB (1.24%)
- ui: 159.8 KiB (2.41%)
- common: 11.4 KiB (0.18%)
Builds ready [3e1e984]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (284 ± 320 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 55 | 122 | 78 | 15 | 7 |
| domContentLoaded | 8 | 43 | 13 | 8 | 4 | ||
| load | 44 | 2500 | 284 | 666 | 320 | ||
| domInteractive | 8 | 43 | 13 | 8 | 4 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 43.03 KiB (1.23%)
- ui: 158.83 KiB (2.40%)
- common: 11.19 KiB (0.18%)