Skip to content

feat(account-tree-controller): add :{initialized,uninitialized} events - #9880

Merged
ccharly merged 2 commits into
mainfrom
cc/feat/account-tree-init-event
Aug 14, 2026
Merged

feat(account-tree-controller): add :{initialized,uninitialized} events#9880
ccharly merged 2 commits into
mainfrom
cc/feat/account-tree-init-event

Conversation

@ccharly

@ccharly ccharly commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Explanation

Adding those events so consumers can rely on this instead of :stateChange during the init phase that can trigger multiple times.

The :uninitialized one is to have a symmetric event that can be used for any kind of teardown.

References

N/A

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Additive, opt-in messenger events with no change to existing init/clearState behavior beyond one extra publish at the end of each path.

Overview
Adds lifecycle messenger events so consumers can wait for a ready account tree without inferring readiness from repeated :stateChange during init.

AccountTreeController:initialized is published at the end of init() (and therefore after reinit()), with the full controller state as payload so listeners can bootstrap without a separate getState(). AccountTreeController:uninitialized is published at the end of clearState() with an empty payload, for symmetric teardown handling (e.g. wallet reset).

New event types are wired into AccountTreeControllerEvents and exported from the package index; unit tests assert emission timing (including that initialized does not fire on clearState and uninitialized does not fire on init).

Reviewed by Cursor Bugbot for commit 7f9d4bc. Bugbot is set up for automated code reviews on this repo. Configure here.

@ccharly
ccharly marked this pull request as ready for review August 14, 2026 11:37
@ccharly
ccharly requested review from a team as code owners August 14, 2026 11:37
@ccharly
ccharly enabled auto-merge August 14, 2026 12:32
@ccharly
ccharly added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit fb5cb45 Aug 14, 2026
148 checks passed
@ccharly
ccharly deleted the cc/feat/account-tree-init-event branch August 14, 2026 12:49
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.

2 participants