-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: hwb 76 fix incorrect transaction approved events log when user reject in hardware wallet #38089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: hwb 76 fix incorrect transaction approved events log when user reject in hardware wallet #38089
Changes from all commits
073ea77
a452c97
af50248
65e499e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import { | |
| TransactionController, | ||
| TransactionControllerMessenger, | ||
| TransactionMeta, | ||
| TransactionStatus, | ||
| TransactionType, | ||
| } from '@metamask/transaction-controller'; | ||
| import { | ||
|
|
@@ -300,7 +301,23 @@ function addTransactionControllerListeners( | |
| 'TransactionController:transactionApproved', | ||
| // TODO: Fix in https://github.com/MetaMask/metamask-extension/issues/31879 | ||
| // eslint-disable-next-line @typescript-eslint/no-misused-promises | ||
| handleTransactionApproved.bind(null, transactionMetricsRequest), | ||
| async ({ transactionMeta }) => { | ||
| // when hardware wallet failed or rejected, due to user already click the confirm, then the flow will come to here. | ||
| // but because hardware wallet need double confirm in device, so we need to handle the transaction rejected here. | ||
| // if status is failed or rejected, then we need to handle the transaction rejected | ||
| if ( | ||
| transactionMeta.status === TransactionStatus.failed || | ||
| transactionMeta.status === TransactionStatus.rejected | ||
| ) { | ||
| await handleTransactionRejected(transactionMetricsRequest, { | ||
| transactionMeta, | ||
| }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Duplicate metrics and incorrect event classificationManually calling |
||
| } else { | ||
| await handleTransactionApproved(transactionMetricsRequest, { | ||
| transactionMeta, | ||
| }); | ||
| } | ||
| }, | ||
| ); | ||
|
|
||
| initMessenger.subscribe( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.