-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: Address performance issues with 'Portfolio Dashboard' loading in test environment #26182
fix: Address performance issues with 'Portfolio Dashboard' loading in test environment #26182
Conversation
… test environment We have noticed significant performance issues when accessing the 'Settings' menu option due to delays in loading the 'Portfolio Dashboard'. This delay has caused flakiness in many of our automated tests. The issue appears to have started after changes were made in PR #25899. Root Cause: The performance issue is linked to an HTTP request to `https://configuration.dev.metamask-institutional.io/v2/configuration/default` to check if `portfolio.enabled` is true. This request is made in the `onSubmitPassword` method in the `mmi-controller` file, resulting in delays. Solution: To mitigate this issue, we have decided to set the `portfolio.enabled` variable to `true` by default in the test environment. This will ensure the 'Portfolio Dashboard' item always appears in the menu during tests, thereby preventing delays caused by the HTTP request and stabilizing our automated tests. Changes Made: - Updated the `getMmiPortfolioEnabled` function to return `true` if the `IN_TEST` environment variable is set. - This change applies only in the test environment, ensuring that the production environment remains unaffected. ```diff export function getMmiPortfolioEnabled(state) { if (process.env.IN_TEST) { return true; } return state.metamask.mmiConfiguration?.portfolio?.enabled; }
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. |
Quality Gate passedIssues Measures |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26182 +/- ##
========================================
Coverage 69.93% 69.93%
========================================
Files 1409 1409
Lines 49786 49788 +2
Branches 13769 13770 +1
========================================
+ Hits 34817 34819 +2
Misses 14969 14969 ☔ View full report in Codecov by Sentry. |
Builds ready [64ff164]
Page Load Metrics (433 ± 417 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @albertolive, I checked manually and 'Portfolio Dashboard' is always appearing in the menu for the test build and LGTM!!
Description
We have noticed significant performance issues when accessing the 'Settings' menu option due to delays in loading the 'Portfolio Dashboard'. This delay has caused flakiness in many of our automated tests. The issue appears to have started after changes were made in PR #25899.
Root Cause:
The performance issue is linked to an HTTP request to
https://configuration.dev.metamask-institutional.io/v2/configuration/default
to check ifportfolio.enabled
is true. This request is made in theonSubmitPassword
method in themmi-controller
file, resulting in delays.Solution:
To mitigate this issue, we have decided to set the
portfolio.enabled
variable totrue
by default in the test environment. This will ensure the 'Portfolio Dashboard' item always appears in the menu during tests, thereby preventing delays caused by the HTTP request and stabilizing our automated tests.Changes Made:
getMmiPortfolioEnabled
function to returntrue
if theIN_TEST
environment variable is set.Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist