Skip to content

Commit 7d99071

Browse files
committed
feat(identity): bump profile-sync-controller to enable automatic pairing of seedless onboarding profiles
see MetaMask/core#6048 Signed-off-by: Mircea Nistor <mirceanis@gmail.com>
1 parent 14d3f94 commit 7d99071

File tree

5 files changed

+145
-88
lines changed

5 files changed

+145
-88
lines changed

app/scripts/controller-init/identity/authentication-controller-init.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import {
22
AuthenticationControllerState,
33
Controller as AuthenticationController,
44
} from '@metamask/profile-sync-controller/auth';
5-
import { Platform } from '@metamask/profile-sync-controller/sdk';
5+
import { Env, Platform } from '@metamask/profile-sync-controller/sdk';
66
import { ControllerInitFunction } from '../types';
77
import { AuthenticationControllerMessenger } from '../messengers/identity';
8+
import { isProduction } from '../../../../shared/modules/environment';
89

910
/**
1011
* Initialize the Authentication controller.
@@ -20,6 +21,9 @@ export const AuthenticationControllerInit: ControllerInitFunction<
2021
AuthenticationControllerMessenger
2122
> = ({ controllerMessenger, persistedState, getMetaMetricsId }) => {
2223
const controller = new AuthenticationController({
24+
config: {
25+
env: isProduction() ? Env.PRD : Env.DEV,
26+
},
2327
messenger: controllerMessenger,
2428
state:
2529
persistedState.AuthenticationController as AuthenticationControllerState,

app/scripts/controller-init/identity/user-storage-controller-init.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import {
2+
Controller as UserStorageController,
23
UserStorageControllerMessenger,
34
UserStorageControllerState,
4-
Controller as UserStorageController,
55
} from '@metamask/profile-sync-controller/user-storage';
66
import { captureException } from '@sentry/browser';
7+
import { Env } from '@metamask/profile-sync-controller/sdk';
78
import { ControllerInitFunction } from '../types';
89
import { isProduction } from '../../../../shared/modules/environment';
910
import {
@@ -31,6 +32,7 @@ export const UserStorageControllerInit: ControllerInitFunction<
3132
// @ts-expect-error Controller uses string for names rather than enum
3233
trace,
3334
config: {
35+
env: isProduction() ? Env.PRD : Env.DEV,
3436
accountSyncing: {
3537
maxNumberOfAccountsToAdd: isProduction() ? undefined : 100,
3638
onAccountAdded: (profileId) => {

app/scripts/controller-init/messengers/identity/authentication-controller-messenger.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ import {
44
KeyringControllerLockEvent,
55
KeyringControllerUnlockEvent,
66
} from '@metamask/keyring-controller';
7+
import { SeedlessOnboardingControllerGetStateAction } from '@metamask/seedless-onboarding-controller';
78
import { HandleSnapRequest } from '@metamask/snaps-controllers';
89

9-
type MessengerActions = KeyringControllerGetStateAction | HandleSnapRequest;
10+
type MessengerActions =
11+
| KeyringControllerGetStateAction
12+
| HandleSnapRequest
13+
| SeedlessOnboardingControllerGetStateAction;
1014

1115
type MessengerEvents =
1216
| KeyringControllerLockEvent
@@ -31,6 +35,7 @@ export function getAuthenticationControllerMessenger(
3135
allowedActions: [
3236
'KeyringController:getState',
3337
'SnapController:handleRequest',
38+
'SeedlessOnboardingController:getState',
3439
],
3540
allowedEvents: ['KeyringController:lock', 'KeyringController:unlock'],
3641
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"attributions:generate": "./development/generate-attributions.sh"
130130
},
131131
"resolutions": {
132+
"@metamask/profile-sync-controller": "npm:@metamask-previews/profile-sync-controller@21.0.0-preview-91d59c3",
132133
"http-cache-semantics": "^4.1.1",
133134
"semver-regex": "^3.1.4",
134135
"base-x@^3.0.x": "^3.0.11",

0 commit comments

Comments
 (0)