Skip to content

Commit e8b52cd

Browse files
authored
fix: Fix SignatureController hub cancelWithReason event handler (#29673)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> This PR aims to fix `cancelWithReason` event handler which is causing `rejectPendingApprovals` to be hang and throw. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29673?quickstart=1) ## **Related issues** Fixes: #29663 ## **Manual testing steps** 1. Create multiple signature request without accept or reject 2. Close notification window 3. See that no more badge number in extension bar ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [X] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent b52121e commit e8b52cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/scripts/metamask-controller.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,7 @@ export default class MetamaskController extends EventEmitter {
21142114

21152115
this.signatureController.hub.on(
21162116
'cancelWithReason',
2117-
({ message, reason }) => {
2117+
({ metadata: message, reason }) => {
21182118
this.metaMetricsController.trackEvent({
21192119
event: reason,
21202120
category: MetaMetricsEventCategory.Transactions,

0 commit comments

Comments
 (0)