Skip to content
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

feat: (cherry-pick)(Version v12.2.0) Migration #122 set redesignedConfirmationsEnabled to true #26139

Conversation

digiwand
Copy link
Contributor

Description

Cherry-pick #25769 for Version v12.2.0

Open in GitHub Codespaces

Related issues

Fixes: #24614

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • 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.

<!--
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.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](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.
@digiwand digiwand requested review from a team as code owners July 25, 2024 17:33
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jul 25, 2024
@@ -203,7 +203,8 @@
"useNativeCurrencyAsPrimaryCurrency": true,
"petnamesEnabled": true,
"showTokenAutodetectModal": "boolean",
"isRedesignedConfirmationsDeveloperEnabled": "boolean"
"isRedesignedConfirmationsDeveloperEnabled": "boolean",
"redesignedConfirmationsEnabled": true
},
"ipfsGateway": "string",
"isIpfsGatewayEnabled": "boolean",
Copy link
Contributor Author

@digiwand digiwand Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshot differences (compare):
1 less - line change
1 less + line change

CleanShot 2024-07-25 at 20 36 26

@@ -255,6 +251,7 @@
"swapsStxGetTransactionsRefreshTime": 10000,
"swapsStxMaxFeeMultiplier": 2
},
"bridgeState": { "bridgeFeatureFlags": { "extensionSupport": "boolean" } },
"ensEntries": "object",
"ensResolutionsByAddress": "object",
"pendingApprovals": "object",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapshot differences (compare):
1 less - line change
1 less + line change

CleanShot 2024-07-25 at 20 38 20

@@ -132,6 +132,7 @@ const migrations = [
require('./119'),
require('./120'),
require('./121'),
require('./122'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 less -1 line change here (compare)

Copy link
Contributor Author

@digiwand digiwand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line changes diff lgtm 👍🏼

delta (-2 -3)

@digiwand digiwand added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Jul 25, 2024
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (Version-v12.2.0@582c619). Learn more about missing BASE report.

Files Patch % Lines
app/scripts/migrations/122.ts 86.67% 2 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##             Version-v12.2.0   #26139   +/-   ##
==================================================
  Coverage                   ?   69.97%           
==================================================
  Files                      ?     1392           
  Lines                      ?    48955           
  Branches                   ?    13467           
==================================================
  Hits                       ?    34253           
  Misses                     ?    14702           
  Partials                   ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chloeYue chloeYue merged commit 636406d into Version-v12.2.0 Jul 29, 2024
67 checks passed
@chloeYue chloeYue deleted the chore-cherry-pick-feat-migration-122-redesignedConfirmationsEnabled branch July 29, 2024 08:58
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants