Skip to content

Commit a44ae6e

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 9a502b8 commit a44ae6e

File tree

5 files changed

+146
-74
lines changed

5 files changed

+146
-74
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 {
@@ -28,6 +29,7 @@ export const UserStorageControllerInit: ControllerInitFunction<
2829
messenger: controllerMessenger,
2930
state: persistedState.UserStorageController as UserStorageControllerState,
3031
config: {
32+
env: isProduction() ? Env.PRD : Env.DEV,
3133
accountSyncing: {
3234
maxNumberOfAccountsToAdd: isProduction() ? undefined : 100,
3335
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
"@metamask/post-message-stream": "^10.0.0",
323323
"@metamask/ppom-validator": "0.36.0",
324324
"@metamask/preinstalled-example-snap": "^0.6.0",
325-
"@metamask/profile-sync-controller": "^20.0.0",
325+
"@metamask/profile-sync-controller": "21.0.0-preview-d90711c",
326326
"@metamask/providers": "^22.1.0",
327327
"@metamask/rate-limit-controller": "^6.0.3",
328328
"@metamask/remote-feature-flag-controller": "^1.6.0",

0 commit comments

Comments
 (0)