-
Notifications
You must be signed in to change notification settings - Fork 5.5k
chore: bump RemoteFeatureFlagController #40480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9973c22
a2e2d6b
d4613a2
96259b3
69a9694
7dc9f96
36e2a36
b4c42b3
cffeec7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,8 @@ export const RemoteFeatureFlagControllerInit: ControllerInitFunction< | |
| const onboardingState = initMessenger.call('OnboardingController:getState'); | ||
| const preferencesState = initMessenger.call('PreferencesController:getState'); | ||
| const { distribution, environment } = getConfigForRemoteFeatureFlagRequest(); | ||
| const prevClientVersion = | ||
| persistedState?.AppMetadataController?.currentAppVersion; | ||
|
|
||
| let canUseExternalServices = preferencesState.useExternalServices === true; | ||
| let hasCompletedOnboarding = onboardingState.completedOnboarding === true; | ||
|
|
@@ -91,6 +93,7 @@ export const RemoteFeatureFlagControllerInit: ControllerInitFunction< | |
| getMetaMetricsId: () => | ||
| initMessenger.call('MetaMetricsController:getMetaMetricsId'), | ||
| clientVersion: getBaseSemVerVersion(), | ||
| prevClientVersion, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New change from 4.1.0. See preview extension PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unit test missing assertion for new
|
||
| clientConfigApiService: new ClientConfigApiService({ | ||
| fetch: globalThis.fetch.bind(globalThis), | ||
| config: { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3510,6 +3510,8 @@ describe('MetaMaskController', () => { | |
| expect(preferencesController.state.useExternalServices).toBe(false); | ||
| expect(remoteFeatureFlagController.state).toStrictEqual({ | ||
| remoteFeatureFlags: {}, | ||
| localOverrides: {}, | ||
| rawRemoteFeatureFlags: {}, | ||
|
Comment on lines
+3513
to
+3514
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RemoteFeatureFlagController 4.0.0 has added these additional state properties. |
||
| cacheTimestamp: 0, | ||
| }); | ||
| }); | ||
|
|
@@ -3529,6 +3531,8 @@ describe('MetaMaskController', () => { | |
|
|
||
| expect(remoteFeatureFlagController.state).toStrictEqual({ | ||
| remoteFeatureFlags: {}, | ||
| localOverrides: {}, | ||
| rawRemoteFeatureFlags: {}, | ||
| cacheTimestamp: 0, | ||
| }); | ||
| }); | ||
|
|
@@ -3553,6 +3557,8 @@ describe('MetaMaskController', () => { | |
| // Verify the controller state remains unchanged after error | ||
| expect(remoteFeatureFlagController.state).toStrictEqual({ | ||
| remoteFeatureFlags: {}, | ||
| localOverrides: {}, | ||
| rawRemoteFeatureFlags: {}, | ||
| cacheTimestamp: 0, | ||
| }); | ||
| }); | ||
|
|
@@ -3578,6 +3584,8 @@ describe('MetaMaskController', () => { | |
| // Verify state is cleared | ||
| expect(remoteFeatureFlagController.state).toStrictEqual({ | ||
| remoteFeatureFlags: {}, | ||
| localOverrides: {}, | ||
| rawRemoteFeatureFlags: {}, | ||
| cacheTimestamp: 0, | ||
| }); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1974,6 +1974,9 @@ | |
| } | ||
| }, | ||
| "@metamask/remote-feature-flag-controller": { | ||
| "globals": { | ||
| "TextEncoder": true | ||
| }, | ||
|
Comment on lines
+1977
to
+1979
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TextEncoded is now being used in this package version (code) |
||
| "packages": { | ||
| "@metamask/base-controller": true, | ||
| "@metamask/controller-utils": true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,8 +168,8 @@ export const MOCK_REMOTE_FEATURE_FLAGS_RESPONSE = { | |
| feature1: true, | ||
| feature2: false, | ||
| feature3: { | ||
| name: 'groupC', | ||
| value: 'valueC', | ||
| name: 'groupA', | ||
| value: 'valueA', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Override test ineffective due to identical mock valuesLow Severity
Comment on lines
+171
to
+172
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need some confirmation here. |
||
| }, | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,8 @@ const getFixtureIgnoredKeys = (): string[] => [ | |
| 'data.ProfileMetricsController.initialDelayEndTimestamp', | ||
| 'data.RemoteFeatureFlagController.cacheTimestamp', | ||
| 'data.RemoteFeatureFlagController.remoteFeatureFlags', | ||
| 'data.RemoteFeatureFlagController.thresholdCache', | ||
| 'data.RemoteFeatureFlagController.rawRemoteFeatureFlags', | ||
|
Comment on lines
+72
to
+73
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excluding:
|
||
| // Entire objects/controllers ignored (dynamic or impractical to validate) | ||
| 'data.AccountsController.internalAccounts.accounts', | ||
| 'data.AuthenticationController', | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was modified by @metamaskbot to update fixtures. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,8 @@ import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow' | |
| import { connectAccountToTestDapp } from '../../page-objects/flows/test-dapp.flow'; | ||
| import { Driver } from '../../webdriver/driver'; | ||
|
|
||
| // Solana + EVM accounts (using the current E2E fixtures setup). | ||
| const ACCOUNTS_IN_MULTICHAIN_ACCOUNTS = 2; | ||
| // E2E Fixtures setup has 4 identities (1 EVM, 1 Solana, 1 Bitcoin, 1 Tron) | ||
| const METAMASK_IDENTITIES = 4; | ||
|
Comment on lines
+13
to
+14
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This baffled me.... Looking at the underlying logic and the fixtures, the test points to the number of identities, not accounts. I'm not entirely sure why now this e2e test is failing though. |
||
|
|
||
| async function waitForAccountsToBeAligned(driver: Driver) { | ||
| // Multichain accounts create non-EVM accounts asynchronously, thus we need to | ||
|
|
@@ -152,7 +152,7 @@ describe('Dapp viewed Event', function () { | |
| assert.equal(dappViewedEventProperties.is_first_visit, true); | ||
| assert.equal( | ||
| dappViewedEventProperties.number_of_accounts, | ||
| ACCOUNTS_IN_MULTICHAIN_ACCOUNTS, | ||
| METAMASK_IDENTITIES, | ||
| ); | ||
| assert.equal(dappViewedEventProperties.number_of_accounts_connected, 1); | ||
| }, | ||
|
|
@@ -198,7 +198,7 @@ describe('Dapp viewed Event', function () { | |
| assert.equal(dappViewedEventProperties.is_first_visit, false); | ||
| assert.equal( | ||
| dappViewedEventProperties.number_of_accounts, | ||
| ACCOUNTS_IN_MULTICHAIN_ACCOUNTS, | ||
| METAMASK_IDENTITIES, | ||
| ); | ||
| assert.equal(dappViewedEventProperties.number_of_accounts_connected, 1); | ||
| }, | ||
|
|
@@ -245,7 +245,7 @@ describe('Dapp viewed Event', function () { | |
| assert.equal(dappViewedEventProperties.is_first_visit, false); | ||
| assert.equal( | ||
| dappViewedEventProperties.number_of_accounts, | ||
| ACCOUNTS_IN_MULTICHAIN_ACCOUNTS, | ||
| METAMASK_IDENTITIES, | ||
| ); | ||
| assert.equal(dappViewedEventProperties.number_of_accounts_connected, 1); | ||
| }, | ||
|
|
@@ -294,7 +294,7 @@ describe('Dapp viewed Event', function () { | |
| assert.equal(dappViewedEventProperties.is_first_visit, false); | ||
| assert.equal( | ||
| dappViewedEventProperties.number_of_accounts, | ||
| ACCOUNTS_IN_MULTICHAIN_ACCOUNTS, | ||
| METAMASK_IDENTITIES, | ||
| ); | ||
| assert.equal(dappViewedEventProperties.number_of_accounts_connected, 1); | ||
| }, | ||
|
|
@@ -346,7 +346,7 @@ describe('Dapp viewed Event', function () { | |
| assert.equal(dappViewedEventProperties.is_first_visit, false); | ||
| assert.equal( | ||
| dappViewedEventProperties.number_of_accounts, | ||
| ACCOUNTS_IN_MULTICHAIN_ACCOUNTS, | ||
| METAMASK_IDENTITIES, | ||
| ); | ||
| assert.equal(dappViewedEventProperties.number_of_accounts_connected, 1); | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -323,11 +323,14 @@ | |
| "ProfileMetricsController": "object", | ||
| "RemoteFeatureFlagController": { | ||
| "cacheTimestamp": "number", | ||
| "localOverrides": "object", | ||
| "rawRemoteFeatureFlags": "object", | ||
| "remoteFeatureFlags": { | ||
| "feature1": true, | ||
| "feature2": false, | ||
| "feature3": { "name": "groupC", "value": "valueC" } | ||
| } | ||
| "feature3": { "name": "groupA", "value": "valueA" } | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need some confirmation here. |
||
| }, | ||
| "thresholdCache": "object" | ||
| }, | ||
| "RewardsController": { | ||
| "rewardsAccounts": "object", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -216,6 +216,7 @@ | |
| "lastUpdatedAt": null, | ||
| "lastViewedUserSurvey": null, | ||
| "ledgerTransportType": "webhid", | ||
| "localOverrides": "object", | ||
| "logs": "object", | ||
| "lostIdentities": "object", | ||
| "manageInstitutionalWallets": "boolean", | ||
|
|
@@ -312,13 +313,14 @@ | |
| "btc": { "conversionDate": 0, "conversionRate": 0 }, | ||
| "sol": { "conversionDate": 0, "conversionRate": 0 } | ||
| }, | ||
| "rawRemoteFeatureFlags": "object", | ||
| "recoveryPhraseReminderHasBeenShown": true, | ||
| "recoveryPhraseReminderLastShown": "number", | ||
| "referrals": "object", | ||
| "remoteFeatureFlags": { | ||
| "feature1": true, | ||
| "feature2": false, | ||
| "feature3": { "name": "groupC", "value": "valueC" } | ||
| "feature3": { "name": "groupA", "value": "valueA" } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need some confirmation here. |
||
| }, | ||
| "rewardsAccounts": "object", | ||
| "rewardsActiveAccount": null, | ||
|
|
@@ -400,6 +402,7 @@ | |
| "syncQueue": "object", | ||
| "termsOfUseLastAgreed": "number", | ||
| "theme": "light", | ||
| "thresholdCache": "object", | ||
| "throttledOrigins": "object", | ||
| "tokenBalances": "object", | ||
| "tokenScanCache": "object", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -259,11 +259,14 @@ | |
| "ProfileMetricsController": "object", | ||
| "RemoteFeatureFlagController": { | ||
| "cacheTimestamp": "number", | ||
| "localOverrides": "object", | ||
| "rawRemoteFeatureFlags": "object", | ||
| "remoteFeatureFlags": { | ||
| "feature1": true, | ||
| "feature2": false, | ||
| "feature3": { "name": "groupC", "value": "valueC" } | ||
| } | ||
| "feature3": { "name": "groupA", "value": "valueA" } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need some confirmation here. |
||
| }, | ||
| "thresholdCache": "object" | ||
| }, | ||
| "RewardsController": { | ||
| "rewardsAccounts": "object", | ||
|
|
||
This file was deleted.


Uh oh!
There was an error while loading. Please reload this page.