Skip to content

chore: bump profile-sync-controller to enable profile pairing#29357

Open
mathieuartu wants to merge 23 commits into
mainfrom
chore/bump-profile-sync-controller-profile-pairing
Open

chore: bump profile-sync-controller to enable profile pairing#29357
mathieuartu wants to merge 23 commits into
mainfrom
chore/bump-profile-sync-controller-profile-pairing

Conversation

@mathieuartu
Copy link
Copy Markdown
Contributor

@mathieuartu mathieuartu commented Apr 27, 2026

Description

Introduced changes:

  • Bumps @metamask/profile-sync-controller to version 28.1.0
  • The use of canonicals

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1737

Manual testing steps

Check epic for test cases: https://consensyssoftware.atlassian.net/browse/MUL-1408

Screenshots/Recordings

Not applicable

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Medium Risk
Touches authentication auto-sign-in/pairing logic and controller initialization, which can affect login/pairing behavior across upgrades. Dependency bump to @metamask/profile-sync-controller@28.1.0 also changes underlying auth/controller behavior and API mocks.

Overview
Upgrades @metamask/profile-sync-controller to 28.1.0 and updates test/mocking fixtures to include the new auth pairing endpoint and needsProfilePairing state (including defaulting initial background state to true).

Adds requestProfilePairing() identity action plus a new selectNeedsProfilePairing selector (defaulting to true when absent) and extends useAutoSignIn to trigger pairing on keyring changes and to force signIn(true) when pairing is needed even if already signed in.

Extends auth controller initialization to provide metametrics.getAppVersion via react-native-device-info getVersion(), and updates related tests; also updates card email verification tests to include canonicalProfileId in the mocked session profile.

Reviewed by Cursor Bugbot for commit d41351c. Bugbot is set up for automated code reviews on this repo. Configure here.

@mathieuartu mathieuartu self-assigned this Apr 27, 2026
@mathieuartu mathieuartu requested a review from a team as a code owner April 27, 2026 08:22
@github-actions
Copy link
Copy Markdown
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.

@mathieuartu mathieuartu requested a review from a team as a code owner April 27, 2026 08:43
@mathieuartu mathieuartu requested a review from a team as a code owner April 27, 2026 10:18
cortisiko
cortisiko previously approved these changes Apr 28, 2026
pull Bot pushed a commit to Reality2byte/core that referenced this pull request Apr 29, 2026
…e id management (MetaMask#8504)

## Explanation

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->

## References

- https://consensyssoftware.atlassian.net/browse/MUL-1722

### Client PRs

- [Extension](MetaMask/metamask-extension#42120)
- [Mobile](MetaMask/metamask-mobile#29357)

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches authentication and user-storage request scoping, adding new
network calls and state fields (`canonicalProfileId`) that can affect
login/session validity and storage partitioning if incorrect or
mismatched with backend behavior.
> 
> **Overview**
> Adds SRP *profile pairing* support by calling `POST
/api/v2/profile/pair` after `performSignIn` when 2+ SRPs exist,
propagating a new `canonicalProfileId` across cached SRP sessions and
emitting a new `AuthenticationController:profileSignIn` event when
aliases are returned or the canonical changes.
> 
> Extends the SRP auth flow to request pairing
(`X-MetaMask-Profile-Pairing: enabled` on `/srp/login`), parse and
surface `profile_aliases`, and resolve the original per-SRP `profileId`
from aliases (via new `computeIdentifierId`) while storing
`canonicalProfileId` separately; sessions missing `canonicalProfileId`
now force re-login.
> 
> Updates `UserStorage` to optionally scope requests by sending
`x-profile-id` when `profileId !== canonicalProfileId` (with an escape
hatch `useCanonicalScope`), adds `refreshCanonicalProfileId` to force a
fresh canonical fetch, and introduces validation/utilities
(`validatePairResponse`) plus expanded fixtures/tests for the new
pairing behavior.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
abc619c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Comment thread app/util/identity/hooks/useAuthentication/useAutoProfilePairing.ts Outdated
 useAutoProfilePairing logic
Comment thread app/util/identity/hooks/useAuthentication/useAutoProfilePairing.ts Outdated
Comment thread package.json Outdated
@mathieuartu mathieuartu requested review from a team as code owners April 30, 2026 17:03
gantunesr added 3 commits May 12, 2026 10:25
…to chore/bump-profile-sync-controller-profile-pairing
…to chore/bump-profile-sync-controller-profile-pairing
@gantunesr gantunesr changed the title chore: bump profile-sync-controller to introduce profile pairing chore: bump profile-sync-controller to enable profile pairing May 13, 2026
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​address-book-controller@​7.1.1 ⏵ 7.1.21001007394 +2100

View full report

@gantunesr
Copy link
Copy Markdown
Member

@metamaskbot update-mobile-fixture

@github-actions
Copy link
Copy Markdown
Contributor

🔄 Fixture update started. Running workflow from branch chore/bump-profile-sync-controller-profile-pairing. View workflow runs

@github-actions
Copy link
Copy Markdown
Contributor

E2E fixture update failed.\n\nCommon causes:\n- CI workflow is still running — wait for 'Build iOS Apps' to complete\n- CI workflow was skipped — ensure your PR has iOS-impacting changes or use skip-smart-e2e-selection label\n- iOS build failed — check the CI workflow for errors\n\nView logs and retry

@gantunesr gantunesr added the skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run label May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@gantunesr gantunesr enabled auto-merge May 15, 2026 23:49
@gantunesr gantunesr disabled auto-merge May 15, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-M skip-smart-e2e-selection Skip Smart E2E selection, i.e. select all E2E tests to run team-accounts team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants