Conversation
|
Contributor
Builds ready [0e43dc2]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ameliejyc
approved these changes
Mar 17, 2026
AndyMBridges
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
The contacts list page (ContactsListPage) and the add/edit contact forms crash when an internal account has corrupted state — specifically when account.metadata or account.metadata.name is undefined. This can happen due to state corruption or migration edge cases.
This PR adds defensive handling in the contact list utility functions (buildDuplicateContactMap, hasDuplicateContacts, isDuplicateContact) via a getAccountName helper that safely accesses account?.metadata?.name, falling back to an empty string. Accounts with missing names are filtered out of duplicate detection rather than causing a runtime crash.
A component-level test is added to ContactsListPage to verify the page renders without crashing when an account has missing metadata
Changelog
CHANGELOG entry: Fixed a crash on the contacts page when an internal account had corrupted or missing metadata.
Related issues
Fixes: #39699
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk: adds defensive null/undefined handling around
InternalAccount.metadata.namein duplicate-contact utilities and a regression test to prevent crashes from corrupted account state.Overview
Prevents the Contacts UI from crashing when an
InternalAccountis missingmetadata/metadata.nameby introducing a safegetAccountNamehelper and skipping unnamed accounts in duplicate-name detection (buildDuplicateContactMap,hasDuplicateContacts,isDuplicateContact).Adds a
ContactsListPagetest that renders the page with a deliberately malformed internal account to verify the page still loads and shows contacts.Written by Cursor Bugbot for commit 0e43dc2. This will update automatically on new commits. Configure here.