Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
82b6386
refactor(assets-controller): remove websocket balance freshness guard
salimtb Jun 25, 2026
eec90eb
fix: route account-activity WS notifications and refresh balances rel…
salimtb Jun 25, 2026
9c1e6af
fix: fix changelog
salimtb Jun 25, 2026
59ff1b4
chore: fix oxfmt formatting in BackendWebSocketService
salimtb Jun 25, 2026
9bfadcf
chore: link core-backend changelog entry to PR #9273
salimtb Jun 25, 2026
5e0bda5
fix: increase changelog
salimtb Jun 25, 2026
12040e2
fix: increase test coverage
salimtb Jun 25, 2026
7b5df18
fix: increase test coverage
salimtb Jun 25, 2026
a35d740
fix: fix linter
salimtb Jun 25, 2026
aabb3f2
fix: fix linter
salimtb Jun 25, 2026
ba933fc
fix: fix rpc data source
salimtb Jun 25, 2026
20e0dde
fix(assets-controller): apply real-time WS balances via AccountActivi…
salimtb Jun 26, 2026
a634c41
fix: clean up
salimtb Jun 26, 2026
a0474be
fix: clean up
salimtb Jun 26, 2026
b8ead26
Potential fix for pull request finding 'CodeQL / Prototype-polluting …
salimtb Jun 26, 2026
b6f495b
fix: clean up
salimtb Jun 26, 2026
3dd6a75
fix: clean up
salimtb Jun 26, 2026
9298fa4
fix: clean up
salimtb Jun 26, 2026
9c3cb7a
fix(assets-controller): refresh balances after transaction confirmed
salimtb Jun 26, 2026
adcf89b
fix(assets-controller): refresh assets and activeChains on EVM networ…
salimtb Jun 26, 2026
4c62dd9
fix: fix and clean
salimtb Jun 26, 2026
5332676
fix: reduce complexity
salimtb Jun 26, 2026
5a86895
fix: fix prices
salimtb Jun 27, 2026
18dd0df
fix: fix linter
salimtb Jun 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@
"count": 6
}
},
"packages/assets-controller/src/AssetsController.ts": {
"no-restricted-syntax": {
"count": 7
}
},
"packages/assets-controller/src/__fixtures__/MockAssetControllerMessenger.ts": {
"no-restricted-syntax": {
"count": 4
Expand Down Expand Up @@ -851,11 +846,6 @@
"count": 1
}
},
"packages/core-backend/src/ws/BackendWebSocketService.test.ts": {
"no-restricted-syntax": {
"count": 1
}
},
"packages/core-backend/src/ws/BackendWebSocketService.ts": {
"no-restricted-syntax": {
"count": 5
Expand Down
9 changes: 7 additions & 2 deletions packages/assets-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING:** `AssetsController` messenger must now allow `AccountActivityService:balanceUpdated` so unified `assetsBalance` state receives real-time websocket balance updates when `AccountActivityService` owns the server subscription ([#9273](https://github.com/MetaMask/core/pull/9273))
- Bump `@metamask/transaction-controller` from `^68.1.1` to `^68.2.0` ([#9253](https://github.com/MetaMask/core/pull/9253))

### Fixed

- Fix stale token balances after transactions when switching accounts or when websocket subscriptions reconnect; `AssetsController` now fetches before re-subscribing on account switch, serializes overlapping refresh work, treats `getAssets({ forceUpdate: true })` as authoritative over recent websocket freshness guards, and prevents passive polling from overwriting websocket balances for 120 seconds ([#9265](https://github.com/MetaMask/core/pull/9265))
- Fix stale token balances after transactions when switching accounts or when websocket subscriptions reconnect; `AssetsController` now fetches before re-subscribing on account switch and serializes overlapping refresh work ([#9265](https://github.com/MetaMask/core/pull/9265))
- `AccountsApiDataSource` bypasses the TanStack Query balance cache when `forceUpdate` is true so forced refreshes return up-to-date balances instead of 60-second cached values ([#9265](https://github.com/MetaMask/core/pull/9265))
- `BackendWebsocketDataSource` re-subscribes when subscribed accounts change (case-insensitive EVM address matching), serializes subscribe/unsubscribe to prevent races on account switch, and registers optional channel callbacks for more reliable notification delivery ([#9265](https://github.com/MetaMask/core/pull/9265))
- `BackendWebsocketDataSource` re-subscribes when subscribed accounts change (case-insensitive EVM address matching), serializes subscribe/unsubscribe to prevent races on account switch, and registers channel callbacks as a fallback when server `subscriptionId` values do not match ([#9265](https://github.com/MetaMask/core/pull/9265))
- Remove the 120-second websocket balance freshness guard that blocked force-refresh and polling updates from correcting stale websocket balances ([#9273](https://github.com/MetaMask/core/pull/9273))
- `BackendWebsocketDataSource` registers subscription handlers before the subscribe handshake so in-flight account-activity notifications are not dropped, cleans up subscription state on subscribe failure, and resolves balance updates from stored subscription state when notifications arrive with stale subscription IDs ([#9273](https://github.com/MetaMask/core/pull/9273))
- `AssetsController` refreshes data-source `activeChains`, re-subscribes, and force-fetches balances for the newly selected EVM chain when the user switches networks via `NetworkController:networkDidChange`
- `AssetsController` bypasses the price deduper cache and fetches spot prices for assets on a newly selected or added EVM network only when those assets have no entry in `assetsPrice` yet; `DetectionMiddleware` queues newly detected assets for the same pipeline price fetch so RPC-detected tokens are priced without waiting for the poll interval

## [9.1.0]

Expand Down
Loading
Loading