fix(transaction-controller): Skip resimulation check when failing incomplete transactions at boot - #9821
Merged
Merged
Conversation
signed transaction failures
signed transaction failures
OGPoyraz
marked this pull request as ready for review
August 11, 2026 12:26
OGPoyraz
force-pushed
the
ogp/fix-tc-fail-transaction
branch
from
August 11, 2026 12:32
c8f1d20 to
4d1fd5d
Compare
matthewwalsh0
self-requested a review
August 11, 2026 12:57
matthewwalsh0
approved these changes
Aug 11, 2026
pull Bot
pushed a commit
to Reality2byte/core
that referenced
this pull request
Aug 11, 2026
## Explanation Release `1187.0.0` with a patch version bump for: - **`@metamask/transaction-controller`** `69.5.1` → `69.5.2` ### `@metamask/transaction-controller@69.5.2` #### Changed - Bump `@metamask/accounts-controller` from `^39.0.7` to `^39.1.0` ([MetaMask#9807](MetaMask#9807)) #### Fixed - Skip resimulation check when failing incomplete transactions at startup, preventing a crash when `isSimulationEnabled` depends on controllers not yet registered ([MetaMask#9821](MetaMask#9821)) ### Dependency updates 17 packages had their `@metamask/transaction-controller` dependency range updated to `^69.5.2` with corresponding changelog entries under `[Unreleased]`: `@metamask/assets-controller`, `@metamask/assets-controllers`, `@metamask/bridge-controller`, `@metamask/bridge-status-controller`, `@metamask/client-utils`, `@metamask/eip-5792-middleware`, `@metamask/gator-permissions-controller`, `@metamask/money-account-utils`, `@metamask/network-enablement-controller`, `@metamask/phishing-controller`, `@metamask/profile-metrics-controller`, `@metamask/shield-controller`, `@metamask/smart-transactions-controller`, `@metamask/subscription-controller`, `@metamask/transaction-pay-controller`, `@metamask/user-operation-controller`, `@metamask/wallet` ## References - [MetaMask#9807](MetaMask#9807) — Bump `@metamask/accounts-controller` - [MetaMask#9821](MetaMask#9821) — Skip resimulation check when failing incomplete transactions at startup ## 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 - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Dependency and release-metadata only; behavioral change is limited to the patch-level transaction-controller fix already shipped in 69.5.2. > > **Overview** > **Monorepo release `1187.0.0`** bumps the root version from `1186.0.0` and publishes **`@metamask/transaction-controller` `69.5.2`** (from `69.5.1`). > > Downstream packages only change **`package.json`** dependency ranges to `^69.5.2`, **`yarn.lock`**, and **`[Unreleased]` changelog** lines (17 consumers such as `wallet`, bridge, assets, EIP-5792 middleware, etc.). There is no application source change in this diff. > > Consumers of **`69.5.2`** get the fixes documented on that release: skip the resimulation check when failing incomplete transactions at startup (avoids a crash when `isSimulationEnabled` touches controllers not registered yet), plus the `accounts-controller` bump noted in that package’s changelog. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 90794b1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
When
TransactionControlleris constructed,#onBootCleanup()runs#failIncompleteTransactions()to transition anysignedorapprovedtransactions tofailed. This calls#failTransaction(), which internally calls#updateTransactionInternal().The problem is that
#updateTransactionInternal()callsthis.#isSimulationEnabled()for its resimulation check. In mobile, theisSimulationEnabledcallback callsPreferencesController:getStatevia the messenger — but this is a controller initialization order problem:TransactionControlleris constructed insideWalletduringEngine.init, and at that pointPreferencesControllerhas not yet registered its action handler on the root messenger. ThePreferencesControlleris a mobile-only controller that does not exist in the@metamask/walletpackage, so the Wallet has no way to guarantee its availability duringTransactionControllerconstruction.This causes
#failTransactionto throw, and the catch block creates a fallbackTransactionMetawithstatus: failedbut never writes it back to state. The transaction remainssignedin persisted state permanently, surviving every app restart.The fix adds
skipResimulateCheck: trueto the#updateTransactionInternalcall inside#failTransaction. There is no reason to check whether a transaction needs resimulation when the intent is to mark it as failed.References
batchtransaction on Arbitrum (0xa4b1) stuck insignedstatus indefinitely across app restartsChecklist
Note
Low Risk
Narrow change to the failure update path at boot with a targeted test; no API or simulation behavior changes for normal transaction flows.
Overview
Fixes startup cleanup so signed/approved transactions left over from a prior session are reliably marked failed instead of staying stuck in signed.
#failTransactionnow passesskipResimulateCheck: trueinto#updateTransactionInternal, so boot-time failure no longer runs the resimulation path that callsisSimulationEnabled. That avoids throws when the callback depends on controllers (e.g. mobilePreferencesController) that are not registered yet duringTransactionControllerconstruction—previously the error could prevent the failed status from being persisted.Adds a regression test where
isSimulationEnabledthrows and both signed and approved txs still end up failed, plus an Unreleased changelog entry.Reviewed by Cursor Bugbot for commit 0935188. Bugbot is set up for automated code reviews on this repo. Configure here.