-
Notifications
You must be signed in to change notification settings - Fork 5k
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: Ensure phishing stale list network request is not sent before onboarding and if basic functionality is off #25306
Conversation
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. |
…nboarding if basic functionality toggle is off
33d7499
to
05c04fd
Compare
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.
Worked as expected!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #25306 +/- ##
===========================================
- Coverage 65.69% 65.68% -0.00%
===========================================
Files 1377 1377
Lines 54624 54623 -1
Branches 14317 14320 +3
===========================================
- Hits 35882 35879 -3
- Misses 18742 18744 +2 ☔ View full report in Codecov by Sentry. |
Builds ready [7297b1b]
Page Load Metrics (132 ± 166 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This fix ensures that network requests for the phishing list are sent in two cases:
To ensure the first, a call to
this.phishingController.maybeUpdateState()
in the metamask controller constructor was moved to thepostOnboardingInitialization
function.To ensure #2, two fixes were needed:
usePhishDetect
preference property is falsesetUsePhishDetect
call that is made inhandleSubmit
ofonboarding-flow/privacy-settings/privacy-settings.js
submit false if the basic functionality toggle is off and the user has not independently set the phishing detection toggle to on. This requires, in the advanced section of the onboarding flow, to default the phishing detection toggle setting to the basic functionality toggle value (externalServicesOnboardingToggleState
), but then only using the phishing toggle value if the user sets that independently.the
basic-functionality.spec.js
e2e tests were updated to ensure that when the basic functionality toggle is off, no network request is sent to the phishing endpoint, and that a request is sent when the toggle is on.Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2625
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist