Skip to content

fix: Prevent transactionApproved event to be emitted when keyring throws during signing#7410

Merged
OGPoyraz merged 5 commits intomainfrom
ogp/18361
Dec 9, 2025
Merged

fix: Prevent transactionApproved event to be emitted when keyring throws during signing#7410
OGPoyraz merged 5 commits intomainfrom
ogp/18361

Conversation

@OGPoyraz
Copy link
Copy Markdown
Member

@OGPoyraz OGPoyraz commented Dec 9, 2025

Explanation

This PR aims to prevent controller to throw transactionApproved event when keyring throws during signing operation. This case is happening when user approve transaction in client but rejects on hardware wallet.

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

Note

Only emit TransactionController:transactionApproved after successful approval; add test and changelog entry.

  • Transaction Controller:
    • Emit transactionApproved event only when approval state is Approved (skip on signing failure or before-publish skip) in src/TransactionController.ts.
  • Tests:
    • Add test ensuring no transactionApproved event is published when keyring signing rejects in src/TransactionController.test.ts.
  • Changelog:
    • Note fix preventing TransactionController:transactionApproved from firing if keyring throws during signing.

Written by Cursor Bugbot for commit 171eadf. This will update automatically on new commits. Configure here.

@OGPoyraz OGPoyraz marked this pull request as ready for review December 9, 2025 09:51
@OGPoyraz OGPoyraz requested review from a team as code owners December 9, 2025 09:51
@OGPoyraz OGPoyraz changed the title fix: Prevent transactionApproved event when keyring throws during signing fix: Prevent transactionApproved event to be emitted when keyring throws during signing Dec 9, 2025
Comment thread packages/transaction-controller/CHANGELOG.md Outdated
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
@OGPoyraz OGPoyraz enabled auto-merge December 9, 2025 10:28
@OGPoyraz OGPoyraz added this pull request to the merge queue Dec 9, 2025
Merged via the queue into main with commit 8286d1d Dec 9, 2025
282 checks passed
@OGPoyraz OGPoyraz deleted the ogp/18361 branch December 9, 2025 10:37
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.

(Ext) [Bug]: Sign types fire an Approved event when I reject the signature on Hardware Wallets

2 participants