Skip to content

Commit 3e7286b

Browse files
refactor: deprecate transaction history and sendFlowHistory properties (#7326)
## Explanation This PR deprecates the `history` and `sendFlowHistory` properties and all the code related. Problem Extension state size has been identified as a major root cause for the app becoming bricked, particularly for power users. Analysis by the platform team revealed that `history` and `sendFlowHistory` are among the biggest contributors to excessive state size, leading to frequent disk writes and the infinite spinner issue. <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> fixes MetaMask/MetaMask-planning#2465 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Deprecates `history`/`sendFlowHistory`, removes history utilities/exports, makes history updates no-ops, and updates controller, types, and tests accordingly. > > - **Transaction Controller**: > - Remove reliance on `utils/history` (`addInitialHistorySnapshot`, `updateTransactionHistory`); stop recording mutation history. > - Deprecate options `disableHistory` and `disableSendFlowHistory` (kept for backward compatibility; no longer used). > - Make `updateTransactionSendFlowHistory` a no-op returning the transaction unchanged. > - Simplify internal updates by dropping history-related parameters (e.g., `skipHistory`, history notes now just logged). > - Keep behavior otherwise intact (simulation, gas updates, events, etc.). > - **Types/Exports**: > - Mark `TransactionMeta.history`, `sendFlowHistory`, `TransactionHistory`, and `TransactionHistoryEntry` as deprecated. > - Remove exports `DISPLAYED_TRANSACTION_HISTORY_PATHS` and `MAX_TRANSACTION_HISTORY_LENGTH` from package index. > - **Tests**: > - Remove history-related expectations and tests; adjust to new no-history behavior. > - **Changelog**: > - Document deprecation of `history` and `sendFlowHistory`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9d2d2b1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Matthew Walsh <[email protected]>
1 parent 902f9fc commit 3e7286b

File tree

8 files changed

+43
-1147
lines changed

8 files changed

+43
-1147
lines changed

packages/transaction-controller/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12+
- Deprecate `history` and `sendFlowHistory` properties from `TransactionMeta` and `TransactionController` options ([#7326](https://github.com/MetaMask/core/pull/7326))
1213
- Bump `@metamask/remote-feature-flag-controller` from `^3.0.0` to `^3.1.0` ([#7519](https://github.com/MetaMask/core/pull/7519))
1314
- Bump `@metamask/network-controller` from `^27.0.0` to `^27.1.0` ([#7534](https://github.com/MetaMask/core/pull/7534))
1415
- Bump `@metamask/controller-utils` from `^11.16.0` to `^11.17.0` ([#7534](https://github.com/MetaMask/core/pull/7534))

0 commit comments

Comments
 (0)