Repository navigation
fix(assets-controller): include asset state in state logs - #11319
Merged
Merged
Conversation
Prithpal-Sooriya
marked this pull request as ready for review
November 5, 2026 12:05
Prithpal-Sooriya
temporarily deployed
to
default-branch
November 5, 2026 12:06 — with
GitHub Actions
Inactive
Prithpal-Sooriya
enabled auto-merge
November 5, 2026 12:36
juanmigdr
approved these changes
Nov 5, 2026
This was referenced Nov 5, 2026
Merged
Cal-L
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 5, 2026
… exemption (#39028) ## **Description** <!-- mms-check: type=text required=true --> Clean up the temporary mobile fix from #38986. Core fixed `includeInStateLogs` for AssetsController asset fields in MetaMask/core#11319, released as `@metamask/assets-controller` 20.2.3 (release MetaMask/core#11326), setting `includeInStateLogs: true` for `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences`, and `selectedCurrency`. This PR: - Bumps `@metamask/assets-controller` to `^20.2.3` and `@metamask/assets-controllers` to `^113.2.0` in `package.json` and updates `yarn.lock`. Both packages are deduped cleanly to single resolutions. - Removes `CONTROLLERS_EXEMPT_FROM_STATE_LOGS_METADATA` and its skip in `generateStateLogs`, restoring standard metadata filtering via `deriveStateFromMetadata`. - Updates `app/util/logs/index.test.ts` to assert that `AssetsController`'s real metadata in 20.2.3 sets `includeInStateLogs: true` for the fields and that state logs export the expected state through the standard metadata filter. - Fixes the failing Appium smoke `tests/smoke-appium/wallet/state-export-sanitization.spec.ts` which previously failed because the temporary exemption exported fields that 20.2.2 metadata marked as excluded. ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> CHANGELOG entry: null ## **Related issues** <!-- mms-check: type=issue-link required=true --> Follow-up to #38986 Upstream fix: MetaMask/core#11319 Fixes: State export sanitization Appium smoke failure (`state-export-sanitization.spec.ts`) ## **Manual testing steps** N/A. Verified via unit tests (`yarn jest app/util/logs/index.test.ts` and `yarn jest app/util/test/e2eStateExport.test.ts`), `yarn lint:tsc`, and ESLint. Note on CI: "Detect flaky unit tests" on run 42096576366 failed due to an AI analyzer infrastructure error ("Token exchange failed" / "AI analysis reviewed 0 of 1 requested file(s)"); the test itself passed deterministically on b3e431c and the failed job was re-run. ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## Adversarial review (adverse) Final verdict (round 3/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 1 warning · 6 info. Fixed: Added direct assertions on controller.metadata for all 7 fields, wrapped test body in try/finally to reliably call controller.destroy() and delete Engine.context.AssetsController. Declined: - Test builds a real AssetsController with heavy hand-rolled setup: constructing the real controller instance is necessary because @metamask/assets-controller does not export stateMetadata statically, and the test uses try/finally to reliably clean up the controller and Engine.context. - State logs now export AssetsController balances, customAssets and preferences: Exposing this asset data in state logs is the captain's decided intent (support relies on balances, prices, and token metadata to investigate user issues, restoring pre-8.18.0 behaviour). ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINDES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 6, 2026
…-logs exemption (#39028) ## **Description** <!-- mms-check: type=text required=true --> Clean up the temporary mobile fix from #38986. Core fixed `includeInStateLogs` for AssetsController asset fields in MetaMask/core#11319, released as `@metamask/assets-controller` 20.2.3 (release MetaMask/core#11326), setting `includeInStateLogs: true` for `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences`, and `selectedCurrency`. This PR: - Bumps `@metamask/assets-controller` to `^20.2.3` and `@metamask/assets-controllers` to `^113.2.0` in `package.json` and updates `yarn.lock`. Both packages are deduped cleanly to single resolutions. - Removes `CONTROLLERS_EXEMPT_FROM_STATE_LOGS_METADATA` and its skip in `generateStateLogs`, restoring standard metadata filtering via `deriveStateFromMetadata`. - Updates `app/util/logs/index.test.ts` to assert that `AssetsController`'s real metadata in 20.2.3 sets `includeInStateLogs: true` for the fields and that state logs export the expected state through the standard metadata filter. - Fixes the failing Appium smoke `tests/smoke-appium/wallet/state-export-sanitization.spec.ts` which previously failed because the temporary exemption exported fields that 20.2.2 metadata marked as excluded. ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> CHANGELOG entry: null ## **Related issues** <!-- mms-check: type=issue-link required=true --> Follow-up to #38986 Upstream fix: MetaMask/core#11319 Fixes: State export sanitization Appium smoke failure (`state-export-sanitization.spec.ts`) ## **Manual testing steps** N/A. Verified via unit tests (`yarn jest app/util/logs/index.test.ts` and `yarn jest app/util/test/e2eStateExport.test.ts`), `yarn lint:tsc`, and ESLint. Note on CI: "Detect flaky unit tests" on run 42096576366 failed due to an AI analyzer infrastructure error ("Token exchange failed" / "AI analysis reviewed 0 of 1 requested file(s)"); the test itself passed deterministically on b3e431c and the failed job was re-run. ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## Adversarial review (adverse) Final verdict (round 3/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 1 warning · 6 info. Fixed: Added direct assertions on controller.metadata for all 7 fields, wrapped test body in try/finally to reliably call controller.destroy() and delete Engine.context.AssetsController. Declined: - Test builds a real AssetsController with heavy hand-rolled setup: constructing the real controller instance is necessary because @metamask/assets-controller does not export stateMetadata statically, and the test uses try/finally to reliably clean up the controller and Engine.context. - State logs now export AssetsController balances, customAssets and preferences: Exposing this asset data in state logs is the captain's decided intent (support relies on balances, prices, and token metadata to investigate user issues, restoring pre-8.18.0 behaviour). ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINDES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 6, 2026
…-logs exemption (#39028) ## **Description** <!-- mms-check: type=text required=true --> Clean up the temporary mobile fix from #38986. Core fixed `includeInStateLogs` for AssetsController asset fields in MetaMask/core#11319, released as `@metamask/assets-controller` 20.2.3 (release MetaMask/core#11326), setting `includeInStateLogs: true` for `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences`, and `selectedCurrency`. This PR: - Bumps `@metamask/assets-controller` to `^20.2.3` and `@metamask/assets-controllers` to `^113.2.0` in `package.json` and updates `yarn.lock`. Both packages are deduped cleanly to single resolutions. - Removes `CONTROLLERS_EXEMPT_FROM_STATE_LOGS_METADATA` and its skip in `generateStateLogs`, restoring standard metadata filtering via `deriveStateFromMetadata`. - Updates `app/util/logs/index.test.ts` to assert that `AssetsController`'s real metadata in 20.2.3 sets `includeInStateLogs: true` for the fields and that state logs export the expected state through the standard metadata filter. - Fixes the failing Appium smoke `tests/smoke-appium/wallet/state-export-sanitization.spec.ts` which previously failed because the temporary exemption exported fields that 20.2.2 metadata marked as excluded. ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> CHANGELOG entry: null ## **Related issues** <!-- mms-check: type=issue-link required=true --> Follow-up to #38986 Upstream fix: MetaMask/core#11319 Fixes: State export sanitization Appium smoke failure (`state-export-sanitization.spec.ts`) ## **Manual testing steps** N/A. Verified via unit tests (`yarn jest app/util/logs/index.test.ts` and `yarn jest app/util/test/e2eStateExport.test.ts`), `yarn lint:tsc`, and ESLint. Note on CI: "Detect flaky unit tests" on run 42096576366 failed due to an AI analyzer infrastructure error ("Token exchange failed" / "AI analysis reviewed 0 of 1 requested file(s)"); the test itself passed deterministically on b3e431c and the failed job was re-run. ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## Adversarial review (adverse) Final verdict (round 3/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 1 warning · 6 info. Fixed: Added direct assertions on controller.metadata for all 7 fields, wrapped test body in try/finally to reliably call controller.destroy() and delete Engine.context.AssetsController. Declined: - Test builds a real AssetsController with heavy hand-rolled setup: constructing the real controller instance is necessary because @metamask/assets-controller does not export stateMetadata statically, and the test uses try/finally to reliably clean up the controller and Engine.context. - State logs now export AssetsController balances, customAssets and preferences: Exposing this asset data in state logs is the captain's decided intent (support relies on balances, prices, and token metadata to investigate user issues, restoring pre-8.18.0 behaviour). ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINDES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
runway-github Bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 6, 2026
… 20.2.3 and drop state-logs exemption (#39028) ## **Description** <!-- mms-check: type=text required=true --> Clean up the temporary mobile fix from #38986. Core fixed `includeInStateLogs` for AssetsController asset fields in MetaMask/core#11319, released as `@metamask/assets-controller` 20.2.3 (release MetaMask/core#11326), setting `includeInStateLogs: true` for `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences`, and `selectedCurrency`. This PR: - Bumps `@metamask/assets-controller` to `^20.2.3` and `@metamask/assets-controllers` to `^113.2.0` in `package.json` and updates `yarn.lock`. Both packages are deduped cleanly to single resolutions. - Removes `CONTROLLERS_EXEMPT_FROM_STATE_LOGS_METADATA` and its skip in `generateStateLogs`, restoring standard metadata filtering via `deriveStateFromMetadata`. - Updates `app/util/logs/index.test.ts` to assert that `AssetsController`'s real metadata in 20.2.3 sets `includeInStateLogs: true` for the fields and that state logs export the expected state through the standard metadata filter. - Fixes the failing Appium smoke `tests/smoke-appium/wallet/state-export-sanitization.spec.ts` which previously failed because the temporary exemption exported fields that 20.2.2 metadata marked as excluded. ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> CHANGELOG entry: null ## **Related issues** <!-- mms-check: type=issue-link required=true --> Follow-up to #38986 Upstream fix: MetaMask/core#11319 Fixes: State export sanitization Appium smoke failure (`state-export-sanitization.spec.ts`) ## **Manual testing steps** N/A. Verified via unit tests (`yarn jest app/util/logs/index.test.ts` and `yarn jest app/util/test/e2eStateExport.test.ts`), `yarn lint:tsc`, and ESLint. Note on CI: "Detect flaky unit tests" on run 42096576366 failed due to an AI analyzer infrastructure error ("Token exchange failed" / "AI analysis reviewed 0 of 1 requested file(s)"); the test itself passed deterministically on b3e431c and the failed job was re-run. ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## Adversarial review (adverse) Final verdict (round 3/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 1 warning · 6 info. Fixed: Added direct assertions on controller.metadata for all 7 fields, wrapped test body in try/finally to reliably call controller.destroy() and delete Engine.context.AssetsController. Declined: - Test builds a real AssetsController with heavy hand-rolled setup: constructing the real controller instance is necessary because @metamask/assets-controller does not export stateMetadata statically, and the test uses try/finally to reliably clean up the controller and Engine.context. - State logs now export AssetsController balances, customAssets and preferences: Exposing this asset data in state logs is the captain's decided intent (support relies on balances, prices, and token metadata to investigate user issues, restoring pre-8.18.0 behaviour). ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINDES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
5 of 7 tasks
5 of 7 tasks
LabinatorSolutions
pushed a commit
to LabinatorSolutions/metamask-extension
that referenced
this pull request
Nov 6, 2026
## **Description** Bumps `@metamask/assets-controller` from `^20.2.2` to `^20.2.3`, published from the core release MetaMask/core#11326. The mobile app already took this version in MetaMask/metamask-mobile#39028. `20.2.3` is a patch release. Verified by diffing the published tarballs (20.2.2 vs 20.2.3): the only `dist/` change flips six state-metadata flags — `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences` and `selectedCurrency` go from `includeInStateLogs: false` to `true` ([core#11319](MetaMask/core#11319)), so asset state is included in state logs and support can investigate asset issues. Confirmed in the installed package: `node_modules/@metamask/assets-controller/dist/AssetsController.js` sets `includeInStateLogs: true` on all six fields. The `persist`, `includeInDebugSnapshot` and `usedInUi` flags are unchanged. No extension source change is needed. The extension's state logs are built from the flat background state (`memStore.getFlatState()` → UI redux `state.metamask` → downloaded state logs), and these six fields already flow through that path — UI selectors read them from `state.metamask` today — so the extension already surfaces this asset state in its logs, and the metadata flip does not change what the extension logs. The flag matters for metadata-driven clients such as mobile, which started honoring `includeInStateLogs` in MetaMask/metamask-mobile#38227 and can now drop its temporary yarn patch. Core notes this restores the pre-8.18 state-log contents and exposes nothing new. The only other change in the release is the package's `@metamask/assets-controllers` range moving from `^113.1.1` to `^113.2.0`. Extension main already depends on `@metamask/assets-controllers` `^113.2.0` directly (resolved to 113.2.0 in the lockfile), so `package.json` needs only this one bump, and Yarn resolves a single `@metamask/assets-controller@20.2.3` entry in `yarn.lock` (deduped per `yarn lint:lockfile:dedupe`). LavaMoat policies were regenerated with `yarn lavamoat:auto`: no drift, since the bump adds no new packages to the resolution. `attribution.txt` is untouched (the attributions check runs on release branches only). ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: N/A — dependency bump with no linked issue. Core release: MetaMask/core#11326. Sibling mobile bump: MetaMask/metamask-mobile#39028. Follow-up to MetaMask#47609. ## **Manual testing steps** 1. Build and load this branch, then unlock a wallet that holds tokens on Ethereum Mainnet. 2. Open the home asset list and confirm symbols, balances, and fiat prices still appear. 3. In Settings → Privacy → Download state logs, confirm the downloaded JSON still includes asset state (e.g. `assetsInfo`, `assetsPrice`) and the wallet works normally. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Adversarial review (adverse)** Final verdict (round 1/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 2 warning · 4 info. Fixed: none (no code changes). Declined: - Balances entering shareable state logs: no change in extension state-log contents — the six fields already flow into the extension's flat-state logs today, and core#11319 states this exposes nothing new (it restores pre-8.18 mobile contents). - State-log redaction ignoring controller metadata / `includeInStateLogs` having no runtime consumer in the extension: accurate but pre-existing architecture (marked TODO in `state-utils.ts`), out of scope for a patch dependency bump; honoring the flag would be a feature change that alters state-log contents. - LavaMoat policies not regenerated: false premise — `yarn lavamoat:auto` was run and produced no diff (no new packages). - `bump:` commit type instead of `chore:`: kept `chore:` per the direct precedents MetaMask#47609/MetaMask#47489. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Lockfile and patch-version dependency bump only; no extension logic changes, typical supply-chain exposure for any npm upgrade. > > **Overview** > **Bumps** `@metamask/assets-controller` from `^20.2.2` to **`^20.2.3`** in `package.json` and refreshes **`yarn.lock`**. > > The lockfile now resolves **`@metamask/assets-controller@20.2.3`** and aligns that package’s **`@metamask/assets-controllers`** dependency with **`^113.2.0`** (matching what the extension already declared), with updated checksums and a tidier dedupe entry for `assets-controllers`. > > No application source changes: this is a dependency-only patch bump (published change is mainly controller metadata such as `includeInStateLogs` for asset-related state fields). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4640fa7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
sleepytanya
added a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 6, 2026
… 20.2.3 and drop state-logs exemption cp-8.18.0 (#39106) - chore: bump @metamask/assets-controller to 20.2.3 and drop state-logs exemption (#39028) ## **Description** <!-- mms-check: type=text required=true --> Clean up the temporary mobile fix from #38986. Core fixed `includeInStateLogs` for AssetsController asset fields in MetaMask/core#11319, released as `@metamask/assets-controller` 20.2.3 (release MetaMask/core#11326), setting `includeInStateLogs: true` for `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences`, and `selectedCurrency`. This PR: - Bumps `@metamask/assets-controller` to `^20.2.3` and `@metamask/assets-controllers` to `^113.2.0` in `package.json` and updates `yarn.lock`. Both packages are deduped cleanly to single resolutions. - Removes `CONTROLLERS_EXEMPT_FROM_STATE_LOGS_METADATA` and its skip in `generateStateLogs`, restoring standard metadata filtering via `deriveStateFromMetadata`. - Updates `app/util/logs/index.test.ts` to assert that `AssetsController`'s real metadata in 20.2.3 sets `includeInStateLogs: true` for the fields and that state logs export the expected state through the standard metadata filter. - Fixes the failing Appium smoke `tests/smoke-appium/wallet/state-export-sanitization.spec.ts` which previously failed because the temporary exemption exported fields that 20.2.2 metadata marked as excluded. ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> CHANGELOG entry: null ## **Related issues** <!-- mms-check: type=issue-link required=true --> Follow-up to #38986 Upstream fix: MetaMask/core#11319 Fixes: State export sanitization Appium smoke failure (`state-export-sanitization.spec.ts`) ## **Manual testing steps** N/A. Verified via unit tests (`yarn jest app/util/logs/index.test.ts` and `yarn jest app/util/test/e2eStateExport.test.ts`), `yarn lint:tsc`, and ESLint. Note on CI: "Detect flaky unit tests" on run 42096576366 failed due to an AI analyzer infrastructure error ("Token exchange failed" / "AI analysis reviewed 0 of 1 requested file(s)"); the test itself passed deterministically on b3e431c and the failed job was re-run. ## **Screenshots/Recordings** ### **Before** N/A ### **After** N/A ## Adversarial review (adverse) Final verdict (round 3/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 1 warning · 6 info. Fixed: Added direct assertions on controller.metadata for all 7 fields, wrapped test body in try/finally to reliably call controller.destroy() and delete Engine.context.AssetsController. Declined: - Test builds a real AssetsController with heavy hand-rolled setup: constructing the real controller instance is necessary because @metamask/assets-controller does not export stateMetadata statically, and the test uses try/finally to reliably clean up the controller and Engine.context. - State logs now export AssetsController balances, customAssets and preferences: Exposing this asset data in state logs is the captain's decided intent (support relies on balances, prices, and token metadata to investigate user issues, restoring pre-8.18.0 behaviour). ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINDES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Cursor <cursoragent@cursor.com> [178a32b](178a32b) Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: sleepytanya <104780023+sleepytanya@users.noreply.github.com>
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Nov 7, 2026
## Explanation Release 1397.0.0. It bumps two packages: | Package | From | To | Why | | --- | --- | --- | --- | | `@metamask/assets-controller` | 20.2.2 | **20.2.3** (patch) | Unreleased only has a `Changed` entry: asset state now included in state logs ([MetaMask#11319](MetaMask#11319)) | | `@metamask/assets-controllers` | 113.1.1 | **113.2.0** (minor) | `Added`: `serviceProfile` option on `searchTokens` ([MetaMask#11274](MetaMask#11274)), plus a `uuid` bump | Nothing breaking has landed in either package since its last release. The `refactor(network-controller)!` commit (MetaMask#11266) only touched test fixtures in these packages. Generated with `yarn create-release-branch`. I didn't edit any changelog by hand. Uncategorized entries are left for the changelog bot. ### Other changes the tool made - Bumped dependents' ranges: `bridge-controller` (`assets-controller` ^20.2.3, `assets-controllers` ^113.2.0), `transaction-pay-controller` (`assets-controller` ^20.2.3), `assets-controller` (`assets-controllers` ^113.2.0), and `yarn.lock`. - Root version 1396.0.0 → 1397.0.0. ### Packages marked `intentionally-skip` The tool requires these because they are dependencies of the released packages. Neither release relies on any unreleased change in them: account-tree-controller, accounts-controller, approval-controller, base-controller, client-controller, config-registry-controller, controller-utils, core-backend, keyring-controller, messenger, multichain-account-service, multichain-transactions-controller, network-controller, network-enablement-controller, permission-controller, phishing-controller, polling-controller, preferences-controller, profile-sync-controller, remote-feature-flag-controller, storage-service, transaction-controller, utils. ## Checks run locally - `yarn constraints`: passes - Tests for `@metamask/assets-controller` (1384 passed) and `@metamask/assets-controllers` (1863 passed): pass - `yarn changelog:validate`: passes (after the internal-only `Uncategorized` entries were removed) ## Adversarial review (adverse) Round 1 verdict: **SHIP-WITH-CAVEATS (3/3 ship, 0/3 block)**. Findings: 0 critical, 2 warnings, 2 info. - Warning: the `Uncategorized` block is left in both changelogs. **Fixed.** I removed both blocks. They held only MetaMask#11324 (dev tooling) and MetaMask#11266 (test fixtures only in these packages), so nothing changes for consumers. - Warning: patch bump despite a `Changed` entry. **Declined.** The change only adds state-log metadata, with no API change and no new behavior for consumers, so patch is right. - Info: the `refactor(network-controller)!` entry appears in packages that weren't really affected. **Fixed** by the same removal. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This branch was previously deployed
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
AssetsControllermarksassetsInfo,assetsBalance,assetsPrice,customAssets,assetPreferencesandselectedCurrencyasincludeInStateLogs: false. OnlyassetsLoadingStatusgets into state logs.Until recently this didn't matter. Mobile exported the raw controller state, so support saw these fields (8.17 state logs include them). Since MetaMask/metamask-mobile#38227 (cp-8.18.0), mobile follows the
includeInStateLogsflags. Support now gets no asset state at all and can't investigate users' balance, token or price issues.This PR sets
includeInStateLogs: trueon those six fields. Thepersist,includeInDebugSnapshotandusedInUiflags are unchanged. Clients already exported this data before mobile#38227, so this brings back the earlier state-log contents. It doesn't expose anything new.Mobile is shipping a temporary yarn patch that flips exactly these six flags: MetaMask/metamask-mobile#38986. Once this change is released, mobile can drop that patch.
References
includeInStateLogs)Checklist
Adversarial review (adverse)
Final verdict (round 1/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block)
Findings: 0 critical · 3 warning · 3 info. Fixed: removed a duplicate, brittle allowlist test that re-checked the metadata keys. Declined:
Note
Medium Risk
State logs will again carry per-account balances and token holdings (intentional for support); log size and data sensitivity increase but match pre–8.18 mobile exports.
Overview
AssetsController now marks six persisted state slices—
assetsInfo,assetsBalance,assetsPrice,customAssets,assetPreferences, andselectedCurrency—withincludeInStateLogs: trueinstead offalse. Clients that build state logs from controller metadata (e.g. MetaMask Mobile since cp-8.18.0) will again include full asset, balance, price, and preference data for support debugging;persist,includeInDebugSnapshot, andusedInUiare unchanged.A
metadatatest usesderiveStateFromMetadata(..., 'includeInStateLogs')to assert those fields match the expected default shape. The package changelog documents the behavior change.Reviewed by Cursor Bugbot for commit 67f9f1c. Bugbot is set up for automated code reviews on this repo. Configure here.