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

test: add e2e for scenario where wallet_switchEthereumChain call is canceled with other confirmations queued behind it #25341

Merged
merged 6 commits into from
Jun 25, 2024

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Jun 14, 2024

Description

Add an e2e to catch regressions similar to the bug identified in this patch/cherry-pick fix to the v12.0.0 RC branch

We had an e2e for a similar flow but where the wallet_switchEthereumChain confirmation was confirmed rather than cancelled. The bug occurred when the confirmation was cancelled and so this test handles that case.

Open in GitHub Codespaces

Related issues

See: https://consensys.slack.com/archives/CTQAGKY5V/p1718385169900809?thread_ts=1718140104.578969&cid=CTQAGKY5V

Manual testing steps

N/A

Screenshots/Recordings

N/A

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.

@adonesky1 adonesky1 requested a review from a team as a code owner June 14, 2024 20:36
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.

@adonesky1 adonesky1 changed the title add e2e for scenario where wallet_switchEthereumChain call is canceled with other confirmations queued behind it test: add e2e for scenario where wallet_switchEthereumChain call is canceled with other confirmations queued behind it Jun 14, 2024
@adonesky1 adonesky1 changed the title test: add e2e for scenario where wallet_switchEthereumChain call is canceled with other confirmations queued behind it test: add e2e for scenario where wallet_switchEthereumChain call is canceled with other confirmations queued behind it Jun 14, 2024
@@ -165,4 +165,158 @@ describe('Request Queuing Dapp 1, Switch Tx -> Dapp 2 Send Tx', function () {
},
);
});

it('should queue send tx after switch network confirmation and transaction should target the correct network after switch is cancelled.', async function () {
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 it would be helpful if there were a comment above this describing that the original bug was noticed on https://app.odos.xyz/, describing the manual procedure for reproducing, and pointing to the PRs that fix it.

Copy link
Contributor

Choose a reason for hiding this comment

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

this test is covering a different scenario from the eth_requestAccount requests not being passed through that you discovered with ODOS

Instead see: #25310

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.93%. Comparing base (b8bd980) to head (de82f6e).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #25341   +/-   ##
========================================
  Coverage    64.93%   64.93%           
========================================
  Files         1385     1385           
  Lines        54958    54958           
  Branches     14421    14421           
========================================
  Hits         35682    35682           
  Misses       19276    19276           

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

@metamaskbot
Copy link
Collaborator

Builds ready [12baa92]
Page Load Metrics (232 ± 267 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint68185872412
domContentLoaded9201231
load402115232556267
domInteractive9201231
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [ffe44f1]
Page Load Metrics (46 ± 5 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint5711374126
domContentLoaded8241132
load389146115
domInteractive8241032
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@adonesky1 adonesky1 merged commit 1cc54f6 into develop Jun 25, 2024
73 of 74 checks passed
@adonesky1 adonesky1 deleted the ad/e2e-test-cancel-queued-switch-chain branch June 25, 2024 15:12
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants