feat(account-tree-controller): add :{initialized,uninitialized} events - #9880
Merged
Conversation
ccharly
marked this pull request as ready for review
August 14, 2026 11:37
ccharly
enabled auto-merge
August 14, 2026 12:32
gantunesr
approved these changes
Aug 14, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
Adding those events so consumers can rely on this instead of
:stateChangeduring theinitphase that can trigger multiple times.The
:uninitializedone is to have a symmetric event that can be used for any kind of teardown.References
N/A
Checklist
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
:stateChangeduringinit.AccountTreeController:initializedis published at the end ofinit()(and therefore afterreinit()), with the full controller state as payload so listeners can bootstrap without a separategetState().AccountTreeController:uninitializedis published at the end ofclearState()with an empty payload, for symmetric teardown handling (e.g. wallet reset).New event types are wired into
AccountTreeControllerEventsand exported from the package index; unit tests assert emission timing (including thatinitializeddoes not fire onclearStateanduninitializeddoes not fire oninit).Reviewed by Cursor Bugbot for commit 7f9d4bc. Bugbot is set up for automated code reviews on this repo. Configure here.