Skip to content

Conversation

mathieuartu
Copy link
Contributor

@mathieuartu mathieuartu commented Aug 6, 2025

Explanation

This PR adds support for handling AccountsController:accountRenamed events in AccountTreeController to maintain compatibility with both legacy account syncing and the multichain accounts state 1 implementation.

AccountTreeController now subscribes to and handles AccountsController:accountRenamed events. When an EVM account is renamed, the controller automatically updates the corresponding account group name if the group has a default name pattern ("Account X") but the account now has a custom name. This ensures that custom account names are reflected at the group level for better user experience.

This change maintains support for legacy account syncing flows that depend on programmatic account renames while ensuring AccountTreeController state remains consistent with account renames even though the UI doesn't use the tree structure yet in multichain state 1.

References

Fixes: https://consensyssoftware.atlassian.net/browse/MUL-521

Changelog

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@mathieuartu mathieuartu self-assigned this Aug 6, 2025
@mathieuartu mathieuartu marked this pull request as ready for review August 6, 2025 15:00
@mathieuartu mathieuartu requested review from a team as code owners August 6, 2025 15:00
fabiobozzo
fabiobozzo previously approved these changes Aug 6, 2025
@mathieuartu mathieuartu marked this pull request as draft August 7, 2025 10:34
@mathieuartu mathieuartu marked this pull request as ready for review August 7, 2025 12:53
@mathieuartu mathieuartu changed the title feat(account-tree-controller): add AccountsController:accountRenamed event handling for legacy account sync compatibility feat(account-tree-controller): add AccountsController:accountRenamed event handling Aug 7, 2025
cursor[bot]

This comment was marked as outdated.

@mathieuartu mathieuartu marked this pull request as draft August 7, 2025 12:58
@mathieuartu mathieuartu marked this pull request as ready for review August 7, 2025 12:58
fabiobozzo
fabiobozzo previously approved these changes Aug 7, 2025
Co-authored-by: Charly Chevalier <charly.chevalier@consensys.net>
@mathieuartu mathieuartu enabled auto-merge (squash) August 7, 2025 14:20
@mathieuartu mathieuartu merged commit a4659d1 into main Aug 7, 2025
223 checks passed
@mathieuartu mathieuartu deleted the feat/handle-account-renamed-legacy-account-sync branch August 7, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants