Skip to content

Feat/notify beyond first srp#8108

Merged
oilnam merged 10 commits intomainfrom
feat/notify-beyond-first-srp
Mar 11, 2026
Merged

Feat/notify beyond first srp#8108
oilnam merged 10 commits intomainfrom
feat/notify-beyond-first-srp

Conversation

@oilnam
Copy link
Copy Markdown
Contributor

@oilnam oilnam commented Mar 4, 2026

Explanation

  • Expand notification account discovery from only the first HD keyring to all keyrings, so notification setup now includes addresses from HD, hardware, imported, and snap keyrings.
  • Ensure notification account collection only keeps valid Ethereum hex addresses and deduplicates addresses across keyrings.
  • Add backend push unlink support via DELETE /api/v2/token and invoke it when notification accounts are disabled (e.g. SRP/account removal), so backend can remove all linked Firebase tokens for those address/platform pairs.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes the set of accounts that will be registered for notifications and adds a new backend unlink call during account disablement, which could impact notification subscription state and cleanup behavior if misconfigured or if the endpoint behaves unexpectedly.

Overview
Notification setup now derives subscription accounts from all keyrings (not just the first HD/SRP), with address collection deduping, checksumming, and filtering to valid Ethereum hex addresses before creating on-chain triggers.

Adds a new NotificationServicesPushController:deletePushNotificationLinks messenger action and deleteLinksAPI (DELETE to the registration tokens endpoint) and wires it into NotificationServicesController.disableAccounts so removing/disablement of accounts also unlinks backend push-token associations for those address/platform pairs. Tests, mocks, exports, and changelog are updated accordingly.

Written by Cursor Bugbot for commit 18c65df. This will update automatically on new commits. Configure here.

@oilnam oilnam requested review from a team as code owners March 4, 2026 12:04
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@oilnam oilnam added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit b6aaf40 Mar 11, 2026
322 checks passed
@oilnam oilnam deleted the feat/notify-beyond-first-srp branch March 11, 2026 15:50
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Apr 16, 2026
<!--
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 updates the extension notifications settings page so account
activity toggles are shown for all notification-eligible accounts across
all wallets/keyrings, instead of effectively being limited to the first
SRP flow.

This builds on the core changes in MetaMask/core#8108, where
notification account discovery was expanded beyond the first keyring to
include all supported EVM accounts. The extension now reflects that
broader account set in the UI by grouping notification toggles by wallet
and preserving the existing per-account enable/disable behavior.

Further adjustments to the core changes were merged in
MetaMask/core#8449

Example with accounts from `Wallet 1` (outside screenshot), accounts
from `Wallet 2`, and a manually imported account from the `Notifications
Settings` page:

<img width="531" height="575" alt="image"
src="https://github.com/user-attachments/assets/11b1d60b-74ff-4503-80cf-21e70fb0ca42"
/>


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

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Extend notification account toggles to all wallet
keyrings

## **Related issues**

Fixes:

## **Manual testing steps**

  1. Open Notifications Settings with notifications enabled.
2. Verify account activity toggles are shown under each wallet section
for eligible accounts across multiple wallets/keyrings.
  3. Verify non-EVM accounts are not shown.
4. Toggle an account notification setting and confirm the existing
behavior still works.

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Bumps `@metamask/notification-services-controller` and updates
messenger allowlists/LavaMoat policies, which could affect notification
subscription/linking and bundling behavior if mismatched with runtime
expectations.
> 
> **Overview**
> Updates Notifications Settings to show per-account notification
toggles **grouped by wallet/keyring**, using multichain account groups
and filtering to notification-eligible EVM addresses; the per-account
enable/disable behavior is preserved while the section is hidden when no
eligible accounts exist.
> 
> Adds `getNotificationWalletGroups` with unit tests plus a new
`NotificationsSettingsContent` render test for grouped output. Expands
the notifications controller messenger delegation to include push link
add/delete actions, updates a rate-limit messenger type import, and
bumps `@metamask/notification-services-controller` to `^23.1.0` with
corresponding LavaMoat policy updates (notably adding `lodash`).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d2c65a8. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Baptiste Marchand <75846779+baptiste-marchand@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants