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: fix/1723 broken sign verification on test dapp #9627

Closed
wants to merge 9 commits into from

Conversation

Cal-L
Copy link
Contributor

@Cal-L Cal-L commented May 14, 2024

Description

The PR that introduced permission controller middleware #9521, broke verifying personal sign on the test dapp. This PR resolves a few areas in the app that needed to use lowercased account addresses. Another note: Since permission middleware now handles eth_accounts, we migrated a condition to use the correct origin based on SDK, WC, or dapp in the BackgroundBridge. This code is a temporary fix and should be refactored in the future. To keep this PR smaller, we can follow up with removing eth_accounts from RPCMethodMiddleware in another PR.

Related issues

Fixes: #1723, https://app.zenhub.com/workspaces/mobile-release-testing-6249e5242464b70013315a98/issues/gh/metamask/metamask-mobile/9628

Manual testing steps

Before fix:

  1. Connect to the MM test dapp
  2. Trigger personal sign
  3. Trigger verify
  4. Results will not appear

After fix:

  1. Connect to the MM test dapp
  2. Trigger personal sign
  3. Trigger verify
  4. Results should show address used to sign
  5. Switch/connect another account
  6. Trigger personal sign
  7. Results should show address used to sign

Screenshots/Recordings

Before

broken-sign.mov

After

Signing verification works even after switching accounts
https://github.com/MetaMask/metamask-mobile/assets/10508597/5c43af3b-7c9f-456b-a870-a5345027642b

WC connects and is able to trigger a transaction

RPReplay_Final1715841769.MP4

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.

@Cal-L Cal-L requested review from a team as code owners May 14, 2024 19:58
@Cal-L Cal-L changed the base branch from main to release/7.23.0 May 14, 2024 19:58
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.

@Cal-L Cal-L added team-mobile-platform release-7.23.0 Issue or pull request that will be included in release 7.23.0 No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. labels May 14, 2024
@Cal-L
Copy link
Contributor Author

Cal-L commented May 14, 2024

Will run E2E on release branch

@Cal-L Cal-L added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label May 14, 2024
@Gudahtt
Copy link
Member

Gudahtt commented May 14, 2024

I have tried testing this PR locally, and it does not appear to work. However I did confirm that #9521 seems to introduce the problem.

@Cal-L Cal-L changed the title fix: Fix/lowercase eth accounts fix: fix/1723 broken sign verification on test dapp May 15, 2024
@Cal-L Cal-L added the Run Smoke E2E Triggers smoke e2e on Bitrise label May 15, 2024
Copy link
Contributor

github-actions bot commented May 15, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: bc38117
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fea3ed76-e815-4d0b-9018-1c8336ba2b24

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

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 61.53846% with 5 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (release/7.23.0@0df83c7). Click here to learn what that means.

Files Patch % Lines
...ts/Views/AccountPermissions/AccountPermissions.tsx 0.00% 2 Missing ⚠️
...nts/UI/AccountSelectorList/AccountSelectorList.tsx 66.66% 1 Missing ⚠️
...ountPermissionsRevoke/AccountPermissionsRevoke.tsx 0.00% 1 Missing ⚠️
app/core/Permissions/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             release/7.23.0    #9627   +/-   ##
=================================================
  Coverage                  ?   46.11%           
=================================================
  Files                     ?     1339           
  Lines                     ?    32665           
  Branches                  ?     3475           
=================================================
  Hits                      ?    15062           
  Misses                    ?    16679           
  Partials                  ?      924           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented May 15, 2024

@tommasini
Copy link
Contributor

Should we target main and then cherry pick it to the release?

@Cal-L Cal-L changed the base branch from release/7.23.0 to main May 16, 2024 19:02
@Cal-L Cal-L requested a review from a team as a code owner May 16, 2024 19:02
@Cal-L Cal-L changed the base branch from main to release/7.23.0 May 16, 2024 19:02
@Cal-L
Copy link
Contributor Author

Cal-L commented May 16, 2024

Closing in favor of #9656

@Cal-L Cal-L closed this May 16, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label May 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. release-7.23.0 Issue or pull request that will be included in release 7.23.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants