-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: (cherry-pick)(Version v12.2.0) Migration #122 set redesignedConfirmationsEnabled to true #26043
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
Conversation
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
This migration sets redesignedConfirmationsEnabled to true. Some users
may have explicitly turned off the experimental setting, which this
migration will reset to true. This is intentional as we also plan to
remove the setting in an upcoming release.
I also added the redesigned confirmation prop to the Sentry state log.
Needed to add or not add it to support the setting in the tests. I went
with adding it.
---
Getting the tests to pass were a bit tricky. It turns out the migrations
run after the fixtures are set. The withPreferencesController fixture
method is no help here.
One way we discussed to set the desired test state is to set the
previous migration data to the state and setting the fixture migration
version to the current version:
```
meta: { version: 122 }
```
This would require opening a live version, extracting the latest
migration state, and adding the mock state to the tests.
Instead, we manually toggle the setting off for each test that requires
the old signature pages.
[](https://codespaces.new/MetaMask/metamask-extension/pull/25768?quickstart=1)
Fixes: #24614
1. Turn off the Experimental > Improved signature redesign setting
2. Run newest version with migration
3. Observe setting has been turned on
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
<!-- [screenshots/recordings] -->
<!-- [screenshots/recordings] -->
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
- [ ] 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.
|
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. |
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 enables the redesigned confirmations feature for all users by setting redesignedConfirmationsEnabled to true and includes necessary migration and test updates.
- Migration Script: Added
app/scripts/migrations/122.tsto setredesignedConfirmationsEnabledto true. - Unit Tests: Introduced
app/scripts/migrations/122.test.tsto validate the migration. - Sentry Integration: Updated
app/scripts/lib/setupSentry.jsto track the new preference. - E2E Tests: Modified multiple E2E test files to include
tempToggleSettingRedesignedConfirmationsfor accurate testing. - UI Update: Added
data-testidattribute inui/pages/settings/experimental-tab/experimental-tab.component.tsxfor testing the toggle.
19 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings
| export async function migrate( | ||
| originalVersionedData: VersionedData, | ||
| ): Promise<VersionedData> { | ||
| const versionedData = cloneDeep(originalVersionedData); |
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.
Style: Consider adding a check to ensure originalVersionedData is not null or undefined before cloning.
| ); | ||
| } | ||
|
|
||
| if (!isObject(state.PreferencesController?.preferences)) { |
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.
Style: This condition could be simplified by using optional chaining and nullish coalescing.
|
thanks for the reviews! Sorry, but I needed to create a new PR to fix the snapshots since we cannot force push for cherry-pick PRs |
Description
Cherry-pick #25769 for Version v12.2.0
Related issues
Fixes: #24614
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist