Skip to content

fix: MMASSETS-626-new-rpc-no-confirmation#13883

Merged
bergarces merged 13 commits into
mainfrom
fix/MMASSETS-626-new-rpc-no-confirmation
Mar 11, 2025
Merged

fix: MMASSETS-626-new-rpc-no-confirmation#13883
bergarces merged 13 commits into
mainfrom
fix/MMASSETS-626-new-rpc-no-confirmation

Conversation

@bergarces

@bergarces bergarces commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

Description

When a dapp sends a wallet_addEthereumChain request for an existing network with a different RPC, there should be a confirmation dialog. It currently updates the network without asking for any sort of permission from the user.

Related issues

Fixes: #12850

Manual testing steps

  1. Add Polygon in MetaMask and switch back to Mainnet
  2. Open this dapp on the inapp browser
  3. If required, tap request accounts and connect while having Mainnet as the active chain
  4. Tap Add Polygon Chain
  5. A confirmation should show allowing the user to review the update (this was not happening before)
  6. Go to the list of chains in the wallet and verify the list of RPC urls under the Polygon

Screenshots/Recordings

Before

Check bug report

After

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-03-07.at.17.02.02.mp4

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.

@github-actions

github-actions Bot commented Mar 6, 2025

Copy link
Copy Markdown
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 mmi DEPRECATED: The product got sunset label Mar 6, 2025
@bergarces bergarces force-pushed the fix/MMASSETS-626-new-rpc-no-confirmation branch 3 times, most recently from e2a2af5 to d2ca9e2 Compare March 6, 2025 15:46
Comment thread app/components/Approvals/AddChainApproval/AddChainApproval.tsx Outdated
Comment thread app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.test.tsx Outdated
Comment thread app/components/UI/NetworkVerificationInfo/NetworkVerificationInfo.tsx Outdated
Comment thread app/core/RPCMethods/wallet_addEthereumChain.js Outdated
Comment thread app/core/RPCMethods/wallet_addEthereumChain.js Outdated
@bergarces bergarces force-pushed the fix/MMASSETS-626-new-rpc-no-confirmation branch from 147e418 to 12b59ce Compare March 6, 2025 18:37
@bergarces bergarces marked this pull request as ready for review March 6, 2025 18:38
@bergarces bergarces requested review from a team as code owners March 6, 2025 18:38
Comment thread app/components/Approvals/AddChainApproval/AddChainApproval.test.tsx
@bergarces bergarces added team-assets Run Smoke E2E and removed mmi DEPRECATED: The product got sunset labels Mar 6, 2025
@bergarces bergarces changed the title Fix/MMASSETS-626-new-rpc-no-confirmation fix/MMASSETS-626-new-rpc-no-confirmation Mar 6, 2025
@github-project-automation github-project-automation Bot moved this to Needs dev review in PR review queue Mar 6, 2025
@bergarces bergarces moved this from Needs dev review to Has approvals, needs CODEOWNER in PR review queue Mar 6, 2025
@bergarces bergarces changed the title fix/MMASSETS-626-new-rpc-no-confirmation fix: MMASSETS-626-new-rpc-no-confirmation Mar 6, 2025
@github-actions

github-actions Bot commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 434916e
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0411dcc3-755f-4388-b14e-1084e8ca3efa

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@sonarqubecloud

sonarqubecloud Bot commented Mar 7, 2025

Copy link
Copy Markdown

@adonesky1

Copy link
Copy Markdown
Contributor

I'm a bit confused in the video you've linked in the description. There appear to be two modals that pop up, the first one suggests you're adding the network for the first time, and then the second one suggests your updating the default rpcUrl for an existing network configuration. It seems like it should just be the second modal that shows?

@bergarces

Copy link
Copy Markdown
Contributor Author

I'm a bit confused in the video you've linked in the description. There appear to be two modals that pop up, the first one suggests you're adding the network for the first time, and then the second one suggests your updating the default rpcUrl for an existing network configuration. It seems like it should just be the second modal that shows?

I managed to paste the wrong video. I've updated it with one showing the "Update XXX" modal asking for confirmation.

The first time the modal shows, it's adding the network from the extension list of networks. The second one, shows how a dapp requesting to update the existing network with a new rpc requests permissions. Before this change, no permission was being asked to update the network with a new rpc.

@adonesky1

Copy link
Copy Markdown
Contributor

Ok nice! Yes the new video looks correct to me!

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread app/core/RPCMethods/wallet_addEthereumChain.js
Comment thread app/core/RPCMethods/wallet_addEthereumChain.js
Comment thread app/core/RPCMethods/wallet_addEthereumChain.js

@adonesky1 adonesky1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Didn't manually test, but code looks pretty good. Probably could be cleaned up/refactored a bit but won't block on that!

@github-project-automation github-project-automation Bot moved this from Has approvals, needs CODEOWNER to Review finalised - Ready to be merged in PR review queue Mar 11, 2025
@bergarces bergarces added this pull request to the merge queue Mar 11, 2025
Merged via the queue into main with commit cecaaf0 Mar 11, 2025
@bergarces bergarces deleted the fix/MMASSETS-626-new-rpc-no-confirmation branch March 11, 2025 15:24
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Mar 11, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 11, 2025
@metamaskbot metamaskbot added the release-7.43.0 Issue or pull request that will be included in release 7.43.0 label Mar 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.43.0 Issue or pull request that will be included in release 7.43.0 team-assets

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Bug]: wallet_addEthereumChain adds new default RPC URL without confirmation

6 participants