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

cherry-pick: remove methods from array used to determine which requests should be enqueued because they can be safely passed through (#27315) #27373

Merged

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Sep 24, 2024

Fix issues that arise when a STX is initated in a dapp and subsequent method calls were being unnecessarily queued until the STX was complete.

The following methods can be safely removed from the list of methods we use to determine whether a request should be queued or executed immediately:

  • 'wallet_addEthereumChain'
  • 'wallet_requestPermissions',
  • 'wallet_requestSnaps',
  • 'eth_decrypt',
  • 'eth_requestAccounts',
  • 'eth_getEncryptionPublicKey',

Open in GitHub Codespaces

Fixes: #27098

  1. Make sure you have STX enabled from settings
  2. Navigate to https://docs.metamask.io/wallet/reference/eth_sendtransaction/
  3. Connect the wallet and switch networks to Sepolia
  4. Trigger a TX (call run request)
  5. Confirm the transaction and see the STX pending screen
  6. Go to test dapp
  7. Click Connect --> this needs to happen while STX is pending
  8. See that you are able to connect
Before-wallet_requestSnaps.mov

wallet_requestPermissions:

Screen.Recording.2024-09-20.at.1.11.57.PM.mov

wallet_requestSnaps

Screen.Recording.2024-09-20.at.1.41.04.PM.mov

eth_requestAccounts

Screen.Recording.2024-09-20.at.1.14.44.PM.mov

wallet_addEthereumChain

Screen.Recording.2024-09-20.at.1.01.45.PM.mov
  • I've followed MetaMask Contributor Docs and MetaMask Extension Coding
    Standards
    .

  • 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 format if applicable

  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

Description

Open in GitHub Codespaces

Related issues

Fixes:

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.

…d be enqueued because they can be safely passed through (#27315)

Fix issues that arise when a STX is initated in a dapp and subsequent
method calls were being unnecessarily queued until the STX was complete.

The following methods can be safely removed from the list of methods we
use to determine whether a request should be queued or executed
immediately:
- 'wallet_addEthereumChain'
- 'wallet_requestPermissions',
- 'wallet_requestSnaps',
- 'eth_decrypt',
- 'eth_requestAccounts',
- 'eth_getEncryptionPublicKey',

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27315?quickstart=1)

Fixes: #27098

1. Make sure you have STX enabled from settings
2. Navigate to
https://docs.metamask.io/wallet/reference/eth_sendtransaction/
3. Connect the wallet and switch networks to Sepolia
4. Trigger a TX (call run request)
5. Confirm the transaction and see the STX pending screen
6. Go to test dapp
7. Click Connect --> this needs to happen while STX is pending
8. See that you are able to connect

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

https://github.com/user-attachments/assets/10be9a20-a22e-4be4-83f6-2bb66ad7a7fa

`wallet_requestPermissions`:

https://github.com/user-attachments/assets/a8ee940c-8d56-4107-8cb1-3683fd244cad

`wallet_requestSnaps`

https://github.com/user-attachments/assets/b4a57a14-8877-4081-82f6-99f2edc9e837

`eth_requestAccounts`

https://github.com/user-attachments/assets/91958cc5-a006-43a4-b4db-37e4b22f07d1

`wallet_addEthereumChain`

https://github.com/user-attachments/assets/23265cf1-3cfb-4e9c-9ea2-599d449d291e

- [ ] 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.
@adonesky1 adonesky1 requested a review from a team as a code owner September 24, 2024 16:55
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 requested a review from a team September 24, 2024 17:04
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.14%. Comparing base (439f7d6) to head (3e5fc36).
Report is 22 commits behind head on Version-v12.3.0.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           Version-v12.3.0   #27373      +/-   ##
===================================================
- Coverage            70.24%   70.14%   -0.10%     
===================================================
  Files                 1426     1432       +6     
  Lines                50239    50430     +191     
  Branches             13954    13989      +35     
===================================================
+ Hits                 35289    35371      +82     
- Misses               14950    15059     +109     

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

@metamaskbot
Copy link
Collaborator

Builds ready [3e5fc36]
Page Load Metrics (1706 ± 56 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15532103171111354
domContentLoaded1536200516719646
load15552111170611756
domInteractive156232115

@danjm danjm merged commit d0fb050 into Version-v12.3.0 Sep 25, 2024
75 of 76 checks passed
@danjm danjm deleted the ad/cherry-pick/v12.3.0/remove-methods-from-queuing branch September 25, 2024 12:39
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Sep 25, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-12.3.0 on PR, as PR was cherry-picked in branch 12.3.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.3.0 Issue or pull request that will be included in release 12.3.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants