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: cp-12.12.0 30060 lattice account import issue #30128

Merged
merged 5 commits into from
Feb 6, 2025

Conversation

dawnseeker8
Copy link
Contributor

@dawnseeker8 dawnseeker8 commented Feb 5, 2025

Description

This PR will fix the #30060 user unable to add more than one lattice issue.
The current patch fix is temperately fix, will need to upgrade eth-lattice-keyring library to provide proper fix.

Open in GitHub Codespaces

Related issues

Fixes:
#30060

Manual testing steps

  1. Install MM Extension
  2. Recover from SRP
  3. Add hardware device
  4. Add Lattice1 hardware wallet and import 3 accounts
  5. Verify all 3 accounts are added to the account list

Screenshots/Recordings

Before

Private Zenhub Video

After

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.

@dawnseeker8 dawnseeker8 added type-bug Something isn't working release-blocker This bug is blocking the next release team-hardware-wallets regression-RC-12.12.0 Regression bug that was found in release candidate (RC) for release 12.12.0 labels Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

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/30060 lattice account import issue fix: 30060 lattice account import issue Feb 5, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [a7df2af]
Page Load Metrics (1585 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1419177515889445
domContentLoaded1404175015628842
load1421177315858943
domInteractive227632147
backgroundConnect125729168
firstReactRender1574352512
getState45411147
initialActions01000
loadScripts986129011318440
setupStore75415168
uiStartup1583197318029546
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 26 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [433dce0]
Page Load Metrics (1660 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15391946166610551
domContentLoaded14991932164410551
load15331946166010651
domInteractive17169513618
backgroundConnect94718115
firstReactRender1680382512
getState55415178
initialActions01000
loadScripts1055138311828641
setupStore75820209
uiStartup17142246189312761
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 26 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@itsyoboieltr itsyoboieltr left a comment

Choose a reason for hiding this comment

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

LGTM!

@dawnseeker8 dawnseeker8 added needs-qa Label will automate into QA workspace and removed needs-qa Label will automate into QA workspace labels Feb 6, 2025
@vivek-consensys
Copy link

Tested locally and able to add 5x Lattice1 accounts with no errors.
https://github.com/user-attachments/assets/3a5dd7d6-3645-4fa7-8cd2-ca3d3c7caf8d

@mikesposito
Copy link
Member

It looks like the entire index.js was prettified, making changes a little hard to read through - is there a way we can patch the package without prettifying it?

@dawnseeker8
Copy link
Contributor Author

It looks like the entire index.js was prettified, making changes a little hard to read through - is there a way we can patch the package without prettifying it?

I think this is done by yarn commit patch command. actually the only change in that file is just below addAccounts() method.:

-    return this.accounts;
+    });
+
+    /** PATCH: Patch the account array to return the new account */
+    return [this.accounts[this.accounts.length - 1]];

The patch only change the return of addAccounts() from whole list of stored this.accounts to last added new account, since our metamask-controller code in unlockHardwareWalletAccount line 5023, without my change, the address value will always be the first account in the this.account list which cause Account name already exist

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.

I assume a lot of changes on this patch were due to the linter, which is not ideal. The fix itself looks good, we should revert all the linter changes after the release to keep the patch simple

@itsyoboieltr itsyoboieltr changed the title fix: 30060 lattice account import issue fix: cp-12.12.0 30060 lattice account import issue Feb 6, 2025
@dawnseeker8 dawnseeker8 added this pull request to the merge queue Feb 6, 2025
@dawnseeker8
Copy link
Contributor Author

I assume a lot of changes on this patch were due to the linter, which is not ideal. The fix itself looks good, we should revert all the linter changes after the release to keep the patch simple

yea, i think the best approach is ask lattice team to release a new version with my PR from my fork, i will contact them to ask them release as soon as possible so that we dont need to use patch anymore.

Merged via the queue into main with commit ba5f5b1 Feb 6, 2025
77 of 78 checks passed
@dawnseeker8 dawnseeker8 deleted the fix/30060-lattice-account-import-issue branch February 6, 2025 12:17
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
@metamaskbot metamaskbot added the release-12.13.0 Issue or pull request that will be included in release 12.13.0 label Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed regression-RC-12.12.0 Regression bug that was found in release candidate (RC) for release 12.12.0 release-12.13.0 Issue or pull request that will be included in release 12.13.0 release-blocker This bug is blocking the next release team-hardware-wallets type-bug Something isn't working
Projects
None yet
6 participants