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

fix: error when re-using exising id on permissionController #9309

Merged
merged 5 commits into from
Apr 19, 2024

Conversation

abretonc7s
Copy link
Contributor

@abretonc7s abretonc7s commented Apr 18, 2024

Description

This PR fixes an issue with incorrect use of the permissionController which doesn't allow re-using similar ID to create a permission request.

If a connection sends multiple request accounts, it would endup rejecting the connection and all further requests until the app is restarted.

Because the permissionController doesn't allow passing metadata, the workaround was to use the id field to link back to metadata but it eventually created the issue described above.

Future version of the permissionController have been patched from MetaMask/core#4179

Related issues

Fixes: #9308

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@abretonc7s abretonc7s marked this pull request as ready for review April 18, 2024 13:43
@abretonc7s abretonc7s requested a review from a team as a code owner April 18, 2024 13:43
@abretonc7s abretonc7s added needs-qa Any New Features that needs a full manual QA prior to being added to a release. team-sdk SDK team WalletConnect WalletConnect related issue or bug labels Apr 18, 2024
andreahaku
andreahaku previously approved these changes Apr 18, 2024
Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abretonc7s abretonc7s changed the title fix: error when re-using exising id on permissionControlelr fix: error when re-using exising id on permissionController Apr 19, 2024
Copy link

sonarcloud bot commented Apr 19, 2024

@christopherferreira9 christopherferreira9 added QA in Progress QA has started on the feature. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Apr 19, 2024
Copy link
Member

@andreahaku andreahaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christopherferreira9
Copy link
Contributor

Main test case:

  • make a double connection from an SDK dapp on purpose
  • The wallet can present 2 connection requests for the same ID where only one of them is approved
  • The wallet is not blocked from further SDK connections

@christopherferreira9 christopherferreira9 added QA Passed A successful QA run through has been done Run Smoke E2E Triggers smoke e2e on Bitrise and removed QA in Progress QA has started on the feature. labels Apr 19, 2024
Copy link
Contributor

github-actions bot commented Apr 19, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e8d025c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1f7fb792-4b6b-4c58-9750-1df2a58213f7

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@christopherferreira9 christopherferreira9 merged commit 4f64f83 into main Apr 19, 2024
40 of 41 checks passed
@christopherferreira9 christopherferreira9 deleted the fix/permissions branch April 19, 2024 13:30
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2024
@metamaskbot metamaskbot added release-7.22.0 Issue or pull request that will be included in release 7.22.0 release-7.21.0 Issue or pull request that will be included in release 7.21.0 labels Apr 19, 2024
@metamaskbot metamaskbot removed the release-7.22.0 Issue or pull request that will be included in release 7.22.0 label Apr 22, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-7.21.0 on PR. Adding release label release-7.21.0 on PR and removing other release labels(release-7.22.0), as PR was cherry-picked in branch 7.21.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed A successful QA run through has been done release-7.21.0 Issue or pull request that will be included in release 7.21.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-sdk SDK team WalletConnect WalletConnect related issue or bug
Projects
None yet
4 participants