Commit 3e7286b
## 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- packages/transaction-controller
- src
- utils
8 files changed
+43
-1147
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments