Skip to content

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Sep 24, 2025

Explanation

We now enforce that init got called before making any change to the tree to avoid having out-of-order account groups.

I stumbled upon this bug when running E2E on mobile. Basically, the way the fixture are setup on mobile were triggering :accountAdded before calling AccountTreeController.init, which resulted in having "Account 2" inserted before "Account 1".

But, since "Account 1" was already part of the initial internalAccounts it should have been inserted before any new accounts.

Thus, forcing init to be called implicitly fixes this order/sequence.

References

E2E were failing on this PR, because of this bug:

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

@ccharly ccharly marked this pull request as ready for review September 24, 2025 13:45
@ccharly ccharly requested review from a team as code owners September 24, 2025 13:45
cursor[bot]

This comment was marked as outdated.

@ccharly ccharly enabled auto-merge (squash) September 24, 2025 15:09
owencraston
owencraston previously approved these changes Sep 24, 2025
Co-authored-by: Fabio Bozzo <fabio.bozzo@gmail.com>
@ccharly ccharly merged commit a263c74 into main Sep 24, 2025
239 checks passed
@ccharly ccharly deleted the fix/account-tree-controller-force-init branch September 24, 2025 15:26
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