Skip to content

fix(assets-controller): include asset state in state logs - #11319

Merged
Prithpal-Sooriya merged 3 commits into
mainfrom
fm/core-assets-state-logs
Nov 5, 2026
Merged

Prithpal-Sooriya merged 3 commits into
mainfrom
fm/core-assets-state-logs

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explanation

AssetsController marks assetsInfo, assetsBalance, assetsPrice, customAssets, assetPreferences and selectedCurrency as includeInStateLogs: false. Only assetsLoadingStatus gets 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 includeInStateLogs flags. Support now gets no asset state at all and can't investigate users' balance, token or price issues.

This PR sets includeInStateLogs: true on those six fields. The persist, includeInDebugSnapshot and usedInUi flags 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

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

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:

  • Unbounded state size in state logs: the same fields were in mobile state logs before mobile#38227 (8.17 logs have the full shape), so this restores the earlier size.
  • Per-account balances and holdings exported in state logs: exposing this data to support is the intended change, and clients exported the same data before mobile#38227.

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, and selectedCurrency—with includeInStateLogs: true instead of false. 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, and usedInUi are unchanged.

A metadata test uses deriveStateFromMetadata(..., '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.

@Prithpal-Sooriya
Prithpal-Sooriya marked this pull request as ready for review November 5, 2026 12:05
@Prithpal-Sooriya
Prithpal-Sooriya requested review from a team as code owners November 5, 2026 12:05
@Prithpal-Sooriya
Prithpal-Sooriya added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 473eb2e Nov 5, 2026
51 checks passed
@Prithpal-Sooriya
Prithpal-Sooriya deleted the fm/core-assets-state-logs branch November 5, 2026 12:49
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>
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

1 inactive deployment
default-branch — 67f9f1c0 Deployed Nov 5, 2026 by Prithpal-Sooriya via Determine whether this PR is a release PR #6556
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