fix: watch asset origin metadata#24488
Conversation
|
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. |
cf50cd1 to
6ae90b2
Compare
6ae90b2 to
3051d87
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe changes modify the
The E2E test
The changes are well-scoped with unit tests updated, but since they touch core RPC handling and confirmation UI, running these smoke tests provides adequate coverage. |
|


Pass page meta and origin into watchAsset approvals so the UI displays the requesting dapp instead of the active tab.
Description
Changelog
CHANGELOG entry:
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2395
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Aligns watch-asset requests with the requesting dapp’s metadata so approvals display the correct origin.
pageMeta(url/title/icon/channelId/analytics) through RPC middleware intowallet_watchAsset; deriveoriginfrompageMeta.urlorhostname.wallet_watchAsset, sanitizepageMetaviagetSafeJsonand forwardorigin,pageMeta, andrequestMetadatatoTokensController.watchAsset; adjust tests to assert these fields.ApproveTransactionHeaderurlnow falls back tocurrentPageInformation?.url ?? activeTabUrlto show the requesting page.Written by Cursor Bugbot for commit 3051d87. This will update automatically on new commits. Configure here.