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: remove call to private/internal methods from the @metamask/keyring-controller #8975

Merged

Conversation

dawnseeker8
Copy link
Contributor

@dawnseeker8 dawnseeker8 commented Mar 18, 2024

Description

Mark has reported that ledger has mis use keyringController method in this slack thread https://consensys.slack.com/archives/C026NDN79JB/p1710333124579809

This PR will investigate the any ledger existing code which misuse keyring controller methods and fix all areas contain the error.

Related issues

Fixes: #8931

Manual testing steps

The menual tests should including forget ledger devices, relauch app and change password to see whether ledger account still there.

Screenshots/Recordings

Before

After

Screen_Recording_20240227_184709_MetaMask.mp4

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@dawnseeker8 dawnseeker8 added Ledger Ledger hardware wallet related issue or development team-hardware-wallets labels Mar 18, 2024
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.

@dawnseeker8 dawnseeker8 changed the title Fix/8931 ledger code refactory for keyring controller Fix: to fix the areas which mis-use the new keyring controller methods. Mar 18, 2024
@dawnseeker8 dawnseeker8 marked this pull request as ready for review March 19, 2024 08:07
@dawnseeker8 dawnseeker8 requested a review from a team as a code owner March 19, 2024 08:07
@dawnseeker8 dawnseeker8 added the Run Smoke E2E Triggers smoke e2e on Bitrise label Mar 19, 2024
@dawnseeker8 dawnseeker8 requested review from plasmacorral and Gudahtt and removed request for plasmacorral March 19, 2024 08:08
Copy link
Contributor

github-actions bot commented Mar 19, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: f67ec9f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/33433ccd-c15d-438d-8a54-cbbf831e6446

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

Gudahtt
Gudahtt previously approved these changes Mar 19, 2024
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@gantunesr gantunesr changed the title Fix: to fix the areas which mis-use the new keyring controller methods. fix: remove call to private/internal methods from the @metamask/keyring-controller Mar 19, 2024
gantunesr
gantunesr previously approved these changes Mar 19, 2024
@vivek-consensys
Copy link
Contributor

@dawnseeker8 I have found an issue on Samsung S21 using Android 13, when forgetting ledger device, the account is still displayed even though the account should be removed. Please see screen recording:-

Screen_Recording_20240320_113049_MetaMask.mp4

@vivek-consensys
Copy link
Contributor

I have also found an issue on Samsung S21 using Android 13, when changing the password after connecting the ledger device, the account is not displayed. Please see screen recording:-

Screen_Recording_20240320_113908_MetaMask.mp4

@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.58%. Comparing base (3e1fd67) to head (d35deb9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8975      +/-   ##
==========================================
- Coverage   45.58%   45.58%   -0.01%     
==========================================
  Files        1276     1276              
  Lines       31310    31309       -1     
  Branches     3202     3202              
==========================================
- Hits        14274    14273       -1     
  Misses      16190    16190              
  Partials      846      846              

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

@vivek-consensys vivek-consensys added the QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed label Mar 21, 2024
@Gudahtt Gudahtt dismissed their stale review March 21, 2024 20:07

Re-reviewing

app/core/Ledger/Ledger.ts Outdated Show resolved Hide resolved
@dawnseeker8 dawnseeker8 added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Mar 22, 2024
Copy link

sonarcloud bot commented Mar 22, 2024

Copy link
Contributor

github-actions bot commented Mar 22, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: d35deb9
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ef99185a-85f2-43e8-ad5f-5b03a1f6a45e

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

@dawnseeker8 dawnseeker8 added needs-qa Any New Features that needs a full manual QA prior to being added to a release. and removed needs-qa Any New Features that needs a full manual QA prior to being added to a release. labels Mar 22, 2024
@vivek-consensys
Copy link
Contributor

@vivek-consensys
Copy link
Contributor

Tested flows and working as expected on Samsung S21 using Android 13.

Change password flow:-

Screen_Recording_20240326_102846_MetaMask-QA.mp4

Forget Ledger device flow:-

Screen_Recording_20240326_102707_MetaMask-QA.mp4

@vivek-consensys vivek-consensys added QA Passed A successful QA run through has been done and removed QA'd - Issues Found QA has been complete, however issues have been discovered that need to be addressed labels Mar 26, 2024
@dawnseeker8 dawnseeker8 merged commit f7eedbf into main Mar 26, 2024
43 checks passed
@dawnseeker8 dawnseeker8 deleted the fix/8931-ledger-code-refactory-for-keyring-controller branch March 26, 2024 10:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2024
@metamaskbot metamaskbot added the release-7.20.0 Issue or pull request that will be included in release 7.20.0 label Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ledger Ledger hardware wallet related issue or development QA Passed A successful QA run through has been done release-7.20.0 Issue or pull request that will be included in release 7.20.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-hardware-wallets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ledger] Investigate KeyringController methods used in Ledger mobile integration
6 participants