-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: Fix ens domain name resolution in confirmation after send flow #37047
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
Conversation
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (2 files, +72 -1)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [10ea528]
UI Startup Metrics (1241 ± 82 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| const chainIdInt = parseInt(finalChainId, 16); | ||
| const resolutions = await fetchResolutions({ | ||
| domain: trimmedDomainName, | ||
| chainId: `eip155:${chainIdInt}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are avoiding use of redux in redesigned confirmations, we should try to avoid it here also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already in use unfortunately and it's not redesigned confirmation but Name component.
There is no other fix in order to show reverse lookup ENS domain in the Name component unless we always want Name component to resolve name resolutions by default but that is not the case.
|
If user is using a different snap in name resolution for ens, above fix will not work. |
|
@jpuri default ENS snap is not removable and the matcher we have it on If you still think that the fix wont work - can you provide a recording with repro steps? Thanks in advance. |
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [5771055]
UI Startup Metrics (1232 ± 88 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [d9502f6]
UI Startup Metrics (1266 ± 93 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
jpuri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to re-think the approach as it will not resolve name from different resolver snaps.
|
Fixed conflict |
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [b9ed520]
UI Startup Metrics (1266 ± 100 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [0478753]
UI Startup Metrics (1247 ± 71 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…end flow (#21515) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Similarly what's being done in MetaMask/metamask-extension#37047 this PR implements a short living cache for `Name` component to use after send flow. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Show ENS name in the confirmation after picking ENS recipient in send flow ## **Related issues** Fixes: #19072 ## **Manual testing steps** 1. Go to send flow 2. Pick ENS recipient 3. Proceed into confirmation - you should be able to see ENS in the confirmation now ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/d74ee373-8df0-43d4-924a-5520eb203240 ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a 5‑minute ENS resolution cache used post-send and surfaces cached ENS in Name display; integrates with validation and updates tests. > > - **ENS caching (5 min TTL)**: > - Add `useSendFlowEnsResolutions` with `setResolvedAddress` and `getResolvedENSName` to cache ENS per `chainId:address`. > - **Send flow integration**: > - Update `useNameValidation` to call `setResolvedAddress(chainId, ensName, resolvedAddress)` when `isEvmSendType` and ENS resolves. > - **Display name integration**: > - Update `useDisplayName` to read `ensName` via `getResolvedENSName(variation, value)` and prioritize it in `name` selection. > - **Tests**: > - New tests for cache storage, expiration, chain separation, overwrite behavior. > - Extend `useNameValidation` tests to assert cache writes only for EVM/ENS. > - Add `useDisplayName` test to verify ENS name is returned. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c5a24a9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…end flow (#21515) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Similarly what's being done in MetaMask/metamask-extension#37047 this PR implements a short living cache for `Name` component to use after send flow. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Show ENS name in the confirmation after picking ENS recipient in send flow ## **Related issues** Fixes: #19072 ## **Manual testing steps** 1. Go to send flow 2. Pick ENS recipient 3. Proceed into confirmation - you should be able to see ENS in the confirmation now ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/d74ee373-8df0-43d4-924a-5520eb203240 ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds a 5‑minute ENS resolution cache used post-send and surfaces cached ENS in Name display; integrates with validation and updates tests. > > - **ENS caching (5 min TTL)**: > - Add `useSendFlowEnsResolutions` with `setResolvedAddress` and `getResolvedENSName` to cache ENS per `chainId:address`. > - **Send flow integration**: > - Update `useNameValidation` to call `setResolvedAddress(chainId, ensName, resolvedAddress)` when `isEvmSendType` and ENS resolves. > - **Display name integration**: > - Update `useDisplayName` to read `ensName` via `getResolvedENSName(variation, value)` and prioritize it in `name` selection. > - **Tests**: > - New tests for cache storage, expiration, chain separation, overwrite behavior. > - Extend `useNameValidation` tests to assert cache writes only for EVM/ENS. > - Add `useDisplayName` test to verify ENS name is returned. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c5a24a9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Description
Changelog
CHANGELOG entry: Fix showing ENS recipient if it's typed in the send flow
Related issues
Fixes: #36966
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
On EVM sends, dispatch a domain reverse lookup to populate store for ENS display in confirmation;
lookupDomainNamenow accepts an explicitchainIdand tests updated accordingly.useNameValidation, after a successful name resolution, dispatchlookupDomainName(to, chainId)whenuseSendType().isEvmSendTypeis true to populate store for ENS display.useDispatchanduseSendTypeusage; update hook dependencies.lookupDomainName(domainName, chainId)to accept optionalchainId, defaulting togetCurrentChainId(state); computechainIdIntfrom the final value.useDispatch,lookupDomainName, anduseSendTypeinuseNameValidation.test.ts.lookupDomainNameis called with('test.eth', chainId)on EVM send after resolution.Written by Cursor Bugbot for commit 0478753. This will update automatically on new commits. Configure here.