Skip to content

MMI-2119-env-name-as-key#22546

Merged
zone-live merged 34 commits intodevelopfrom
MMI-2119-env-name-as-key
Feb 14, 2024
Merged

MMI-2119-env-name-as-key#22546
zone-live merged 34 commits intodevelopfrom
MMI-2119-env-name-as-key

Conversation

@bergarces
Copy link
Copy Markdown
Contributor

@bergarces bergarces commented Jan 16, 2024

Description

Update MMI package dependencies and refactor code to handle the breaking changes.

The changes involve using environment name as the main key to identify a custodian, instead of the api url.

It should not change any existing feature

Related issues

Fixes: MMI-2119

Manual testing steps

Test MMI build with multiple custodians, including:

  • Updating an existing installation and verifying that existing custodian accounts have been migrated correctly
  • Adding accounts from a custodian
  • Refreshing tokens for custodian accounts

Screenshots/Recordings

Before

After

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.

@github-actions
Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 16, 2024
@bergarces bergarces added the mmi DEPRECATED: The product got sunset label Jan 16, 2024
@metamaskbot metamaskbot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 16, 2024
@bergarces bergarces force-pushed the MMI-2119-env-name-as-key branch from 3892021 to a1b75d6 Compare January 16, 2024 16:39
@socket-security
Copy link
Copy Markdown

socket-security bot commented Jan 16, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 18, 2024

Codecov Report

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

Comparison is base (391e9e7) 68.55% compared to head (44c5663) 68.54%.

Files Patch % Lines
app/scripts/controllers/mmi-controller.js 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22546      +/-   ##
===========================================
- Coverage    68.55%   68.54%   -0.00%     
===========================================
  Files         1088     1088              
  Lines        42907    42894      -13     
  Branches     11415    11414       -1     
===========================================
- Hits         29411    29400      -11     
+ Misses       13496    13494       -2     

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

@jacob121532
Copy link
Copy Markdown

Codecov Report

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

Comparison is base (2f0f141) 68.15% compared to head (5fbb8af) 68.15%.
Report is 16 commits behind head on develop.

Files Patch % Lines
app/scripts/controllers/mmi-controller.js 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22546      +/-   ##
===========================================
- Coverage    68.15%   68.15%   -0.00%     
===========================================
  Files         1083     1083              
  Lines        42495    42492       -3     
  Branches     11337    11336       -1     
===========================================
- Hits         28961    28958       -3     
  Misses       13534    13534              

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

@bergarces bergarces force-pushed the MMI-2119-env-name-as-key branch from fd8d835 to 3ff297d Compare January 18, 2024 20:58
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [ce84a43]
Page Load Metrics (820 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint82165116178
domContentLoaded94822115
load72210278208440
domInteractive94822115
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@shane-t shane-t self-requested a review January 31, 2024 12:21
shane-t
shane-t previously approved these changes Jan 31, 2024
zone-live
zone-live previously approved these changes Feb 2, 2024
Copy link
Copy Markdown
Contributor

@zone-live zone-live left a comment

Choose a reason for hiding this comment

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

Looks good code wise, I'll create some follow up tickets for the @todos you found, and run the extension with this branch to do some manual testing as well.
Awesome work! 🥇

const { token, apiUrl } = req.params;
const { token, envName } = req.params;
// TODO (Bernardo) - Check if this is the case
const custodyType = 'Custody - JSONRPC'; // Only JSONRPC is supported for now
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be yes, this will need to be updated and a ticket created for it. Ty! 👍🏼

version: number;
};

// TODO (Bernardo) - There can be multiple custodian with the same name, envName should be used instead
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

True! Will create a ticket for it as well 👍🏼

const connectRequests = useSelector(
(state) => state.metamask.institutionalFeatures?.connectRequests,
);
const connectRequests = useSelector(getInstitutionalConnectRequests);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ty! 💪🏼

@zone-live zone-live dismissed stale reviews from shane-t and themself via bc23ace February 5, 2024 16:54
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [b3a7935]
Page Load Metrics (808 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint97149111136
domContentLoaded9331573
load71510518088641
domInteractive9331573
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: -37 Bytes (-0.00%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [802f282]
Page Load Metrics (741 ± 12 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint83132107157
domContentLoaded9191442
load7128127412512
domInteractive9191432
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: -37 Bytes (-0.00%)

Copy link
Copy Markdown
Contributor

@zone-live zone-live left a comment

Choose a reason for hiding this comment

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

After some manual testing using Qredo, it seems we have a bug. This error happens when connecting MMI to Qredo and trying to import accounts.

Screenshot 2024-02-06 at 17 23 25

Should be related with: https://github.com/consensys-vertical-apps/metamask-institutional/blob/main/packages/custodyKeyring/src/CustodyKeyring.ts#L526

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [796f42a]
Page Load Metrics (799 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint93144111136
domContentLoaded9211542
load7439797995426
domInteractive9211542
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: -37 Bytes (-0.00%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [f5c77e9]
Page Load Metrics (933 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint961961312512
domContentLoaded1288312010
load78711109338943
domInteractive1288312010
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: -37 Bytes (-0.00%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [44c5663]
Page Load Metrics (1055 ± 55 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1182711973617
domContentLoaded990372713
load9061453105511555
domInteractive990372713
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: -37 Bytes (-0.00%)

@zone-live zone-live requested a review from shane-t February 14, 2024 10:50
@zone-live zone-live merged commit 38fcd39 into develop Feb 14, 2024
@zone-live zone-live deleted the MMI-2119-env-name-as-key branch February 14, 2024 13:58
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
@metamaskbot metamaskbot added the release-11.12.0 Issue or pull request that will be included in release 11.12.0 label Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

mmi DEPRECATED: The product got sunset release-11.12.0 Issue or pull request that will be included in release 11.12.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants