perf(account-tree-controller): use batched account events#8160
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
fe2427d to
79aed9e
Compare
79aed9e to
e41ba68
Compare
e41ba68 to
a4507b3
Compare
hmalik88
reviewed
Mar 10, 2026
| "packages/account-tree-controller/src/AccountTreeController.ts": { | ||
| "@typescript-eslint/explicit-function-return-type": { | ||
| "count": 10 | ||
| "count": 8 |
hmalik88
approved these changes
Mar 10, 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
Use new
:accounts{Added,Removed}events from theAccountsController.References
N/A
Checklist
Note
Medium Risk
Switching from single-account to batched
AccountsControllerevents changes the controller’s event contract and could cause missed tree/selection updates if any publisher/consumer still emits or expects the old events. Batched removal also changes whenselectedAccountGroupChangeis emitted, so regressions would show up as incorrect auto-selection after removals.Overview
Account add/remove handling is migrated to the new batched
AccountsController:accountsAdded/accountsRemovedevents. The controller now filters out already-known accounts/unknown removals and performs inserts/removals within a singleupdatecall, emittingAccountTreeController:accountTreeChangeonce per batch.Selection-change emission is adjusted for batched removals.
selectedAccountGroupChangeis now published only after the batch update when the selected group actually differs from the pre-batch value.Tests, messenger mocks, and
AllowedEventstypings are updated to use the new event names/payload shapes, and the package changelog notes the change.Written by Cursor Bugbot for commit a4507b3. This will update automatically on new commits. Configure here.