metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

feat: add new authentication flow

Open matteoscurati opened this issue 1 year ago • 4 comments

Description

This PR relates to the integration of new Authentication and User Storage controllers within the extension.

Specifically, the PR implements:

  • Logic for integrating Redux with the created controllers
  • Necessary hooks to manage actions and their associated loading and error states
  • Integration with the onboarding process
  • Integration with settings pages where necessary

At the end of the onboarding process, the user will be able to:

  • Choose to use MetaMetrics
  • Use the Profile Syncing feature (enabling UserStorage) or, through the advanced settings page, choose not to use this feature

If the user chooses to use MetaMetrics or enable Profile Syncing, the user must be authenticated.

Only if the user chooses not to use MetaMetrics and not to enable Profile Syncing can they remain unauthenticated.

Currently, the authentication process continues to use the locally created MetaMetrics ID.

The PR also includes components that allow the user, if they wish, to disable MetaMetrics or Profile Syncing at any time.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Follow the onboarding process
  2. Check the settings page to turn on/off metametrics and profile syncing

After

This is the new onboarding flow:

https://www.figma.com/file/c7GgNw2kScGrVyRGAPhwEd/Notifications?type=design&node-id=1498-68094&mode=design&t=sFvZbmQXNQaBxs6M-4

Pre-merge author checklist

  • [x] I’ve followed MetaMask Coding Standards.
  • [x] I've completed the PR template to the best of my ability
  • [x] I’ve included tests if applicable
  • [x] I’ve documented my code using JSDoc format if applicable
  • [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [x] 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.

matteoscurati avatar Apr 15 '24 11:04 matteoscurati

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.

github-actions[bot] avatar Apr 15 '24 11:04 github-actions[bot]

Codecov Report

Attention: Patch coverage is 89.05263% with 52 lines in your changes are missing coverage. Please review.

Project coverage is 67.06%. Comparing base (d15001e) to head (851c7c7).

Files Patch % Lines
app/scripts/metamask-controller.js 31.82% 15 Missing :warning:
ui/store/actions.ts 86.67% 14 Missing :warning:
...s/metamask-notifications/useSwitchNotifications.ts 88.89% 7 Missing :warning:
.../hooks/metamask-notifications/useProfileSyncing.ts 89.13% 5 Missing :warning:
...i/hooks/metamask-notifications/useNotifications.ts 93.10% 4 Missing :warning:
...boarding-flow/privacy-settings/privacy-settings.js 78.57% 3 Missing :warning:
ui/hooks/metamask-notifications/useMetametrics.ts 94.74% 2 Missing :warning:
...ng-flow/creation-successful/creation-successful.js 83.33% 1 Missing :warning:
...selectors/metamask-notifications/authentication.ts 85.71% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24028      +/-   ##
===========================================
- Coverage    67.43%   67.06%   -0.37%     
===========================================
  Files         1286     1306      +20     
  Lines        50105    51137    +1032     
  Branches     12995    13134     +139     
===========================================
+ Hits         33787    34292     +505     
- Misses       16318    16845     +527     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 15 '24 12:04 codecov[bot]

Builds ready [ac4a516]
Page Load Metrics (775 ± 501 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint653711236230
domContentLoaded115926136
load5325317751043501
domInteractive115926136
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

metamaskbot avatar Apr 15 '24 12:04 metamaskbot

Builds ready [3d5a90c]
Page Load Metrics (504 ± 504 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint59163872411
domContentLoaded9361473
load4731235041051504
domInteractive9361473
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 38.44 KiB (1.17%)
  • ui: 26.82 KiB (0.41%)
  • common: 4.94 KiB (0.08%)

metamaskbot avatar May 09 '24 06:05 metamaskbot