-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: add migration for profile syncing controller #26004
fix: add migration for profile syncing controller #26004
Conversation
we want existing users to have profile syncing disabled, this will remove/nullify the isEnableProfileSyncing state field.
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. |
@@ -27,15 +27,15 @@ export type UserStorageControllerState = { | |||
/** | |||
* Condition used by UI and to determine if we can use some of the User Storage methods. | |||
*/ | |||
isProfileSyncingEnabled: boolean; | |||
isProfileSyncingEnabled: boolean | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked all references (JS and TS files) it seems okay to change this field to be nullable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not perform strict boolean checks in references, it is truthy checks (isProfileSyncingEnabled && ...
or isProfileSyncingEnabled || ...
)
… fix/add-profile-syncing-enabled-migration
app/scripts/controllers/user-storage/user-storage-controller.ts
Outdated
Show resolved
Hide resolved
…ration we need to also handle migration of new users who migrated from 11.16 that might have UserStorage in their state
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26004 +/- ##
========================================
Coverage 69.67% 69.67%
========================================
Files 1402 1403 +1
Lines 49652 49676 +24
Branches 13720 13726 +6
========================================
+ Hits 34594 34611 +17
- Misses 15058 15065 +7 ☔ View full report in Codecov by Sentry. |
Tested the migration on v12 and v11. Seems to work as intended |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One pending suggestion about how to handle corrupted state, which would be ideal to fix but doesn't seem critical enough to block.
2ed2f4c
to
5c08942
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request introduces a migration to ensure that profile syncing is disabled by default for existing users, aligning with the opt-in policy.
- Migration Script: Added
app/scripts/migrations/120.1.ts
to setisProfileSyncingEnabled
tonull
for existing users. - Controller Update: Modified
app/scripts/controllers/user-storage/user-storage-controller.ts
to handlenull
state forisProfileSyncingEnabled
. - Unit Tests: Added
app/scripts/migrations/120.1.test.ts
to validate the migration logic. - Migration Index: Updated
app/scripts/migrations/index.js
to include the new migration script. - E2E Test States: Modified multiple E2E test state files to reflect the new default
null
value forisProfileSyncingEnabled
.
8 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings
test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json
Show resolved
Hide resolved
test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json
Show resolved
Hide resolved
test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json
Outdated
Show resolved
Hide resolved
test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The pull request introduces a migration to ensure that profile syncing is disabled by default for existing users, aligning with the opt-in policy.
- Migration Script Update: Enhanced
app/scripts/migrations/120.1.ts
to handle malformedUserStorageController
states and added Sentry error handling. - Test Case Addition: Updated
app/scripts/migrations/120.1.test.ts
to include scenarios where theUserStorageController
state is invalid. - E2E Test State Updates: Modified multiple E2E test state files (
errors-after-init-opt-in-background-state.json
,errors-after-init-opt-in-ui-state.json
,errors-before-init-opt-in-background-state.json
,errors-before-init-opt-in-ui-state.json
) to setisProfileSyncingEnabled
totrue
by default.
6 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings
Hmm, still some e2e test failure in the error capture tests |
a3b8a3a
to
5d46b4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The pull request introduces a migration to ensure that profile syncing is disabled by default for existing users, aligning with the opt-in policy.
- Migration Script Update: Enhanced
app/scripts/migrations/120.1.ts
to handle malformedUserStorageController
states and added Sentry error handling. - Test Case Addition: Updated
app/scripts/migrations/120.1.test.ts
to include scenarios where theUserStorageController
state is invalid. - E2E Test State Updates: Modified multiple E2E test state files (
errors-before-init-opt-in-background-state.json
,errors-before-init-opt-in-ui-state.json
) to setisProfileSyncingEnabled
totrue
by default.
4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings
Builds ready [5d46b4d]
Page Load Metrics (254 ± 242 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
(updates since last review)
The pull request introduces a migration to ensure that profile syncing is disabled by default for existing users, aligning with the opt-in policy.
- Mock Active Tab for E2E Tests: Updated
app/scripts/ui.js
to mock the active tab during E2E tests using theactiveTabOrigin
query string parameter. - New SIWE E2E Tests: Added
test/e2e/tests/confirmations/signatures/siwe.spec.ts
to cover SIWE functionality. - Request Queuing E2E Tests: Enhanced
test/e2e/tests/request-queuing/ui.spec.js
with new scenarios and helper functions. - Constrain Window Size in WebDriver: Modified
test/e2e/webdriver/chrome.js
,test/e2e/webdriver/firefox.js
, andtest/e2e/webdriver/index.js
to addconstrainWindowSize
option. - SIWE Message Handling: Updated
ui/pages/confirmations/hooks/useCurrentConfirmation.ts
and its test to handle SIWE messages correctly.
8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go!
Builds ready [8c483f9]
Page Load Metrics (151 ± 168 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
For existing users, we want to ensure that profile syncing is disabled (opt-in). This migration ensures that the
isProfileSyncingEnabled
controller state is changed to false for existing users.This will need to be cherry-picked into v12.0.0
Related issues
Fixes: V12 testing issue of the state for profile syncing.
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist