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(26748): increment index label until get a label not duplicated #26959

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Akaryatrh
Copy link
Contributor

@Akaryatrh Akaryatrh commented Sep 6, 2024

Description

In the context of importing hardware wallet accounts, this PR prevents account name to be labelled the same as an already created account and will increment its index until getting a label that is not duplicated.

Also, I removed preferencesController.setAccountLabel call as it was also calling accountController.setAccountName under the hood (through messagingSystem). This was causing an uncaught error and it was duplicating the call to setAccountName anyway.

Open in GitHub Codespaces

Related issues

Fixes: #26748

Manual testing steps

  1. remove all existing ledger accounts
  2. add new MM accounts, named "Ledger 1" and "Ledger 2"
  3. add new hardware account, select Ledger and and select first account
  4. See that imported account is named "Ledger 3"

Screenshots/Recordings

Before

Enregistrement.de.l.ecran.2024-08-30.a.16.32.49.mp4

After

Enregistrement.de.l.ecran.2024-09-09.a.10.53.01.mp4

Pre-merge author checklist

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 Sep 6, 2024

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.

@Akaryatrh Akaryatrh marked this pull request as ready for review September 6, 2024 08:30
@Akaryatrh Akaryatrh requested a review from a team as a code owner September 6, 2024 08:30
@Akaryatrh Akaryatrh changed the title fix(26748): remove duplicated call to set account name and remove acc… fix(26748): remove duplicated call to set account name and remove account on error Sep 6, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [de58189]
Page Load Metrics (1897 ± 93 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15722412190620799
domContentLoaded15602193187217986
load15682316189719393
domInteractive1688422110
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -5 Bytes (-0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.17%. Comparing base (416d024) to head (4b90b44).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #26959   +/-   ##
========================================
  Coverage    70.17%   70.17%           
========================================
  Files         1425     1425           
  Lines        49659    49663    +4     
  Branches     13891    13891           
========================================
+ Hits         34846    34850    +4     
  Misses       14813    14813           

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

@Akaryatrh Akaryatrh marked this pull request as draft September 9, 2024 07:59
@Akaryatrh Akaryatrh force-pushed the fix/26748 branch 2 times, most recently from 5832e7b to 1b1f8b0 Compare September 9, 2024 08:44
@Akaryatrh Akaryatrh changed the title fix(26748): remove duplicated call to set account name and remove account on error fix(26748): increment index label until get a label not duplicated Sep 9, 2024
Copy link

sonarcloud bot commented Sep 9, 2024

@Akaryatrh Akaryatrh marked this pull request as ready for review September 9, 2024 09:04
@metamaskbot
Copy link
Collaborator

Builds ready [4b90b44]
Page Load Metrics (1719 ± 87 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint23223711578482231
domContentLoaded15322361170417885
load15422373171918087
domInteractive147434189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 61 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [6ae013c]
Page Load Metrics (1823 ± 72 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30921991665471226
domContentLoaded15042097179813866
load15132204182315072
domInteractive1785482311
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 61 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

sonarcloud bot commented Oct 10, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [10ed013]
Page Load Metrics (2452 ± 99 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32228861927896430
domContentLoaded204028602425212102
load20992866245220699
domInteractive20132602512
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 61 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

Error: Account name already exists
3 participants