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

Remove identities associated to the hardware keyring when forgetting the device #21755

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

montelaidev
Copy link
Contributor

@montelaidev montelaidev commented Nov 8, 2023

Description

This pr fixes the issue where the identities of a hardware wallet were not removed when removing the device.

Related issues

Fixes: #21742

Manual testing steps

  1. Connect a ledger
  2. Add a ledger account
  3. Go to connect a ledger again
  4. Click on forget device
  5. Check to see the ledger account was removed from the UI

Screenshots/Recordings

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.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

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.

@montelaidev montelaidev marked this pull request as ready for review November 8, 2023 17:22
@montelaidev montelaidev requested a review from a team as a code owner November 8, 2023 17:22
@montelaidev montelaidev changed the title fix: remove identities when removing hardware keyring Remove identities associated to the hardware keyring when forgetting the device Nov 8, 2023
…ingControllerUpdate already removes the accounts
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8488e7a) 68.59% compared to head (70fdab5) 68.60%.
Report is 17 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #21755      +/-   ##
===========================================
+ Coverage    68.59%   68.60%   +0.01%     
===========================================
  Files         1046     1046              
  Lines        41613    41616       +3     
  Branches     11110    11112       +2     
===========================================
+ Hits         28543    28548       +5     
+ Misses       13070    13068       -2     
Files Coverage Δ
app/scripts/controllers/preferences.js 55.48% <ø> (-0.29%) ⬇️
app/scripts/metamask-controller.js 55.31% <66.67%> (+0.20%) ⬆️

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

@metamaskbot
Copy link
Collaborator

Builds ready [fb12a36]
Page Load Metrics (535 ± 266 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint8412398116
domContentLoaded6612085157
load791497535554266
domInteractive6612085157
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -102 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

gantunesr
gantunesr previously approved these changes Nov 9, 2023
Copy link
Member

@gantunesr gantunesr left a comment

Choose a reason for hiding this comment

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

LGTM. Just left a couple of comments

Edit: I also tested the branch and the functionality is correct

app/scripts/controllers/preferences.js Show resolved Hide resolved
app/scripts/metamask-controller.test.js Outdated Show resolved Hide resolved
@gantunesr gantunesr added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Nov 9, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [70fdab5]
Page Load Metrics (493 ± 326 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93137113136
domContentLoaded7012694168
load821786493678326
domInteractive7012694168
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -102 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@plasmacorral
Copy link
Contributor

Tested on Mac Sonoma 14 in Chrome 117.0.5938.92 with Ledger, Trezor and Keystone. Also tested Firefox version 118.0.2 with both Keystone and Trezor. Able to remove accounts, forget devices and re-add the hardware address. Did not have access to Lattice at the time of testing.

@plasmacorral plasmacorral added QA Passed and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Nov 9, 2023
@plasmacorral plasmacorral merged commit d39896f into develop Nov 9, 2023
69 checks passed
@plasmacorral plasmacorral deleted the fix/21742 branch November 9, 2023 19:20
@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 2023
@plasmacorral plasmacorral added the release-11.6.0 Issue or pull request that will be included in release 11.6.0 label Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed release-11.6.0 Issue or pull request that will be included in release 11.6.0 team-accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Forget this device removes account from keyring, but not the UI
4 participants