Skip to content
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

[Bug]: Permissions - Using wallet_revokePermissions a second time does not clear pending tx's #29272

Open
seaona opened this issue Dec 17, 2024 · 0 comments
Labels
regression-prod-12.9.1 Regression bug that was found in production in release 12.9.1 Sev2-normal Normal severity; minor loss of service or inconvenience. team-api-platform team-wallet-api-platform type-bug

Comments

@seaona
Copy link
Contributor

seaona commented Dec 17, 2024

Describe the bug

Whenever I have a pending transaction and I use the wallet_revokePermissions method, that transaction is then cleared, as expected.
However, if I connect again into the dapp and trigger a new transaction and then again the wallet_revokePermissions, that transaction is not cleared.

Expected behavior

We should clear pending transactions anytime wallet_revokePermissions is used.
The PR which fixes the issue should also add an e2e for it here, as the current test doesn't cover this more complex scenario.

Screenshots/Recordings

revoke-permission-not-clear-txs.mp4

Steps to reproduce

  1. With a fresh install, go to the test dapp
  2. Connect
  3. Trigger a transaction (don't accept or reject)
  4. Open dapp console
  5. Trigger the request wallet_revokePermissions
  6. See tx is cleared
  7. Connect again to the test dapp
  8. Trigger a transaction (don't accept or reject)
  9. Trigger the request wallet_revokePermissions
  10. See tx is not cleared
await window.ethereum.request({
  method: 'wallet_revokePermissions',
  params: [
    {
      eth_accounts: {},
    },
  ],
})

Error messages or log output

Detection stage

In production (default)

Version

12.9.1

Build type

None

Browser

Chrome

Operating system

Linux

Hardware wallet

No response

Additional context

No response

Severity

No response

@seaona seaona added Sev2-normal Normal severity; minor loss of service or inconvenience. team-api-platform team-wallet-api-platform type-bug labels Dec 17, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Dec 17, 2024
@metamaskbot metamaskbot added the regression-prod-12.9.1 Regression bug that was found in production in release 12.9.1 label Dec 17, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 17, 2024
<!--
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**

- Migrates
`test/e2e/tests/request-queuing/sendTx-revokePermissions.spec.js` spec
to POM and ts
- Updates method classes to accommodate new functions needed in this
spec
- [A new
bug](#29272) has
been discovered thanks to this migration, and a new TODO has been added,
to add a new spec to cover that flow, once the bug is fixed

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/29273?quickstart=1)

## **Related issues**

Fixes: #29276

## **Manual testing steps**

1. Check ci
2. Run test ` yarn test:e2e:single
test/e2e/tests/request-queuing/sendTx-revokePermissions.spec.ts
--browser=chrome --leave-running=true`

## **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**

- [ ] 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).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] 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.
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-prod-12.9.1 Regression bug that was found in production in release 12.9.1 Sev2-normal Normal severity; minor loss of service or inconvenience. team-api-platform team-wallet-api-platform type-bug
Projects
Status: To be fixed
Status: To be fixed
Development

No branches or pull requests

2 participants