Derive transaction status-change events from state in `#updateTransactionInternal`
Maintainers usually reply within 1 day
@matthewwalsh0 is already working on this.
Since Jul 7, 2026.
Assessment
This issue has not been assessed yet.
Description
What
Emit transaction status-change events by diffing status inside #updateTransactionInternal, instead of relying on callers to manually invoke #onTransactionStatusChange (and the status-specific transactionFailed / transactionConfirmed / transactionDropped / transactionFinished publishes).
Why
Today these events are fired manually at ~8 separate call sites. That makes emitting an event a "conscious decision" the author has to remember, rather than something derived from the state, which should be the source of truth. Any code path that mutates a transaction's status without also calling the emit helpers silently skips the events.
This is exactly what caused https://github.com/MetaMask/core/pull/9400: SmartTransactionsController marked a transaction failed via the plain updateTransaction action, which doesn't emit transactionStatusUpdated / transactionFailed, so the bridge status controller was never notified and the transaction stayed stuck as pending.
#9400 fixed the symptom with a targeted failTransaction action, but the underlying fragility remains.
Proposal
- Diff previous vs new
statusinside#updateTransactionInternaland publish the appropriate event(s) automatically after the update. - Remove the ~8 manual
#onTransactionStatusChangecall sites once the diff covers them. - Consider whether the public
failTransactionaction (added in #9400) can then be removed.
Risk / notes
Not just transactionStatusUpdated — the status-specific events (transactionFailed, transactionConfirmed, transactionDropped, transactionFinished) also need to be derived from the diff, and every existing manual emit must be removed to avoid double-firing. This touches every add/approve/sign/submit/confirm/drop/fail path, so it needs careful review and test coverage. Raised as a follow-up from #9400 rather than folded into that fix.
Context: review discussion on https://github.com/MetaMask/core/pull/9400
- Dominant language
- TypeScript
- Stars
- 422
- Forks
- 313
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 414
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MetaMask/core
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
CI: "Validate changelog diffs" job fails on every fork-sourced pull requestPossibly taken @Roxen-AS claimed this 20 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
platform-api-docs: `scan` strategy misses ESM-only packages, which ship `.d.ts` rather than `.d.cts`Possibly taken @gaohan1994 claimed this 21 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
[utils] Replace the `uuid` dependency with `crypto.randomUUID()`Possibly taken @avantikonde claimed this 34 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
MetaMask/core#10210 · 1 reaction ·
Maintainers usually reply within 1 day
-
[utils] `toWei` accepts fractional wei and returns wrong valuesPossibly taken @Roxen-AS claimed this 20 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
Similar issues
-
enhancement module: library-ui
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
chthollyphile/folia-major#1206 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
typescript-eslint/typescript-eslint#13189 ·
Maintainers usually reply within 2 days
-
severity:medium triage:confirmed triage:in-progress triage:reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Cotal-AI/Cotal#6442 · 2 comments ·
Maintainers usually reply within 1 day
-
wrong type
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
elastic/elasticsearch-specification#6919 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day