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: Enable redesigned transaction confirmations for all users #28321

Merged
merged 19 commits into from
Nov 26, 2024

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Nov 6, 2024

Description

Migrates all users to the redesigned transactions. The setting will be automatically toggled on.

This change initially broke a number of end-to-end tests. After an analysis, I grouped these failing tests into three categories:

  1. User flows that have to be tested before enabling the redesign to all users, 🔴

This includes multichain and transaction insights tests. All tests on these files were tweaked to pass on redesigned confirmations. Specific tests that initially broke for new confirmations were also duplicated and included the temporary helper method tempToggleSettingRedesignedTransactionConfirmations so they were run for the old confirmations that we still need to support.

  1. User flows that we don't need to migrate immediately, but will have to be migrated or adapted when old confirmations flows are deleted, 🟡

For these tests, we simply added tempToggleSettingRedesignedTransactionConfirmations. Once we remove the old flows, we can modify the tests to support the new flows. We didn't think it was as urgent to test these flows with the redesigned screens.

  1. User flows that we don't need to migrate to redesigned confirmations. 🟢

For these tests, we simply added tempToggleSettingRedesignedTransactionConfirmations. Once we remove the old confirmation screens, we can delete these tests because they are no longer relevant, or otherwise already tested in the redesigned confirmation specific tests.

Summary of the e2e tests that broke with the migration

  1. User flows that have to be tested before enabling the redesign to all users, 🔴

    • test/e2e/snaps/test-snap-txinsights-v2.spec.js ✅
    • test/e2e/snaps/test-snap-txinsights.spec.js ✅
    • test/e2e/json-rpc/switchEthereumChain.spec.js ✅
    • test/e2e/tests/request-queuing/batch-txs-per-dapp-diff-network.spec.js ✅
    • test/e2e/tests/request-queuing/batch-txs-per-dapp-extra-tx.spec.js ✅
    • test/e2e/tests/request-queuing/batch-txs-per-dapp-same-network.spec.js ✅
    • test/e2e/tests/request-queuing/dapp1-send-dapp2-signTypedData.spec.js ✅
    • test/e2e/tests/request-queuing/dapp1-switch-dapp2-eth-request-accounts.spec.js ✅
    • test/e2e/tests/request-queuing/dapp1-switch-dapp2-send.spec.js ✅
    • test/e2e/tests/request-queuing/multi-dapp-sendTx-revokePermission.spec.js ✅
    • test/e2e/tests/request-queuing/multiple-networks-dapps-txs.spec.js ✅
    • test/e2e/tests/request-queuing/switch-network.spec.js ✅
    • test/e2e/tests/request-queuing/ui.spec.js ✅
    • test/e2e/tests/account/snap-account-transfers.spec.ts ✅
  2. User flows that we don't need to migrate immediately, but will have to be migrated or adapted when old confirmations flows are deleted, 🟡

    • test/e2e/json-rpc/eth_sendTransaction.spec.js
    • test/e2e/tests/account/add-account.spec.ts
    • test/e2e/tests/petnames/petnames-transactions.spec.js
    • test/e2e/tests/ppom/ppom-blockaid-alert-simple-send.spec.js
    • test/e2e/tests/responsive-ui/metamask-responsive-ui.spec.js
    • test/e2e/tests/tokens/custom-token-send-transfer.spec.js
    • test/e2e/tests/transaction/change-assets.spec.js
    • test/e2e/tests/transaction/edit-gas-fee.spec.js
    • test/e2e/tests/transaction/gas-estimates.spec.js
    • test/e2e/tests/transaction/multiple-transactions.spec.js
    • test/e2e/tests/transaction/navigate-transactions.spec.js
    • test/e2e/tests/transaction/send-edit.spec.js
    • test/e2e/tests/transaction/send-eth.spec.js
    • test/e2e/tests/transaction/send-hex-address.spec.js
  3. User flows that we don't need to migrate to redesigned confirmations. 🟢

    • test/e2e/tests/dapp-interactions/contract-interactions.spec.js
    • test/e2e/tests/dapp-interactions/dapp-tx-edit.spec.js
    • test/e2e/tests/dapp-interactions/failing-contract.spec.js
    • test/e2e/tests/network/network-error.spec.js
    • test/e2e/tests/settings/4byte-directory.spec.js
    • test/e2e/tests/settings/show-hex-data.spec.js
    • test/e2e/tests/tokens/custom-token-add-approve.spec.js
    • test/e2e/tests/tokens/increase-token-allowance.spec.js
    • test/e2e/tests/transaction/simple-send.spec.ts
    • test/e2e/tests/tokens/nft/erc721-interaction.spec.js
    • test/e2e/tests/tokens/nft/erc1155-interaction.spec.js
    • test/e2e/tests/tokens/nft/send-nft.spec.js

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/3026

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.

@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Nov 6, 2024
@pedronfigueiredo pedronfigueiredo self-assigned this Nov 6, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 2024

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.

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/3026 branch 11 times, most recently from 03d87cf to 806f6d6 Compare November 14, 2024 09:48
@metamaskbot
Copy link
Collaborator

Builds ready [806f6d6]
Page Load Metrics (1936 ± 89 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint37622171848384184
domContentLoaded15872199191318790
load16372219193618589
domInteractive30195744320
backgroundConnect875222010
firstReactRender462001153718
getState44712126
initialActions01000
loadScripts11531690141115876
setupStore55513157
uiStartup18582493214719996
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 876 Bytes (0.01%)
  • ui: 69 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/3026 branch 3 times, most recently from 8ece0b5 to 819c05b Compare November 19, 2024 10:26
@pedronfigueiredo pedronfigueiredo marked this pull request as ready for review November 19, 2024 14:59
@pedronfigueiredo pedronfigueiredo requested review from a team as code owners November 19, 2024 14:59
@pedronfigueiredo pedronfigueiredo requested review from kumavis and a team as code owners November 20, 2024 12:20
@metamaskbot
Copy link
Collaborator

Builds ready [9365487]
Page Load Metrics (2353 ± 128 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26426611818826397
domContentLoaded192431382318257124
load193531542353266128
domInteractive32141522311
backgroundConnect10162383718
firstReactRender6248913010350
getState592581215426
initialActions01000
loadScripts142524721742223107
setupStore6421174
uiStartup221642502776445213
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 876 Bytes (0.01%)
  • ui: 69 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/3026 branch 2 times, most recently from b8cfa35 to 3a69a65 Compare November 21, 2024 08:38
jpuri
jpuri previously approved these changes Nov 21, 2024
// fix race condition with mmi build
if (process.env.MMI) {
await driver.waitForSelector('[data-testid="global-menu-mmi-portfolio"]');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏼

| Record<string, unknown>
| undefined;

if (isObject(preferencesControllerState) && isObject(preferences)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's no need to check isObject(preferencesControllerState) since preferences is derived from preferencesControllerState

Suggested change
if (isObject(preferencesControllerState) && isObject(preferences)) {
if (isObject(preferences)) {

): Record<string, unknown> {
const preferencesControllerState = state?.PreferencesController as
| Record<string, unknown>
| undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

We have supported the case when no preferences state is found in previous migrations. It may be a good idea to support it here as well. Then we can ensure we set redesignedTransactionsEnabled for this migration. Maybe it's automatically set to true by default later, in which case we wouldn't need this.

example: migration 122

  if (!isObject(state.PreferencesController?.preferences)) {
    state.PreferencesController = {
      preferences: {},
    };
  }

@metamaskbot
Copy link
Collaborator

Builds ready [7b198b9]
Page Load Metrics (1704 ± 90 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14652054170518589
domContentLoaded14532047167818388
load14622053170418790
domInteractive25114472512
backgroundConnect761302010
firstReactRender1775412411
getState4461094
initialActions00000
loadScripts10161553122016278
setupStore66819199
uiStartup16472266189619493
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 993 Bytes (0.02%)
  • ui: 69 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pedronfigueiredo pedronfigueiredo added this pull request to the merge queue Nov 26, 2024
Merged via the queue into develop with commit 6dda444 Nov 26, 2024
75 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/3026 branch November 26, 2024 16:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2024
@metamaskbot metamaskbot added the release-12.9.0 Issue or pull request that will be included in release 12.9.0 label Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.9.0 Issue or pull request that will be included in release 12.9.0 skip-e2e-quality-gate team-confirmations Push issues to confirmations team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants