-
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
feat: Adding delete metametrics data to security and privacy tab #24571
base: develop
Are you sure you want to change the base?
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. |
JustifyContent, | ||
TextVariant, | ||
} from '../../../helpers/constants/design-system'; | ||
import { createMetaMetricsDataDeletionTask } from '../../../store/actions'; |
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.
Perhaps this PR should stay in draft until the controller exists? As-is this is not mergable because this function does not exist.
cd7937d
to
7660d88
Compare
93ae0f6
to
1aa81db
Compare
586ac89
to
cd4aba8
Compare
1941496
to
6a4d150
Compare
cb4f42a
to
429a444
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## delete-metametrics-data-controller #24571 +/- ##
======================================================================
- Coverage 70.19% 70.19% -0.00%
======================================================================
Files 1427 1430 +3
Lines 49745 49829 +84
Branches 13921 13936 +15
======================================================================
+ Hits 34916 34974 +58
- Misses 14829 14855 +26 ☔ View full report in Codecov by Sentry. |
Builds ready [39130bb]
Page Load Metrics (158 ± 192 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
fc6b061
to
e2509b6
Compare
} else { | ||
await setHasMetaMetricsDataRecorded(false); | ||
} | ||
} catch (error: unknown) { |
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.
Should we also track an error event here? e.g. MetaMetricsEventName.MetricsDataDeletionRequestError
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.
Hi @danjm ,
In Mobile, we've started to track expected errors as Analytics in order to reduce the noise in Sentry (which shall be kept for unexpected errors).
To achieve that we've introduced a generic Error occured
event that we want to use for all our errors.
Do we have an equivalent generic event for errors in Extension?
- If yes we could use it
- If not, it might be a good occasion to introduce such an event in Extension as well, wdyt?
cc @worldlyjohn @Cal-L for visibility
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.
@NiranjanaBinoy Can you add an 'Error Occured' metrics event, and then track that event here?
27e64d1
to
f0083a1
Compare
Builds ready [f0083a1]
Page Load Metrics (1931 ± 114 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -6,6 +6,7 @@ | |||
"api.web3modal.com", | |||
"app.ens.domains", | |||
"arbitrum-mainnet.infura.io", | |||
"authentication.api.cx.metamask.io", |
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.
"authentication.api.cx.metamask.io", |
Duplicate (line 59)
"min-api.cryptocompare.com", | ||
"nft.api.cx.metamask.io", | ||
"oidc.api.cx.metamask.io", |
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.
"oidc.api.cx.metamask.io", |
Duplicate
Quality Gate passedIssues Measures |
Builds ready [ce675f0]
Page Load Metrics (1834 ± 110 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -1547,6 +1547,29 @@ | |||
"deleteContact": { |
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.
✔️
@@ -550,6 +550,7 @@ export enum MetaMetricsEventName { | |||
MarkAllNotificationsRead = 'Notifications Marked All as Read', |
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.
✔️
@@ -324,6 +324,13 @@ const SETTINGS_CONSTANTS = [ | |||
route: `${SECURITY_ROUTE}#dataCollectionForMarketing`, |
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.
✔️
@@ -170,7 +170,7 @@ describe('Settings Search Utils', () => { | |||
it('returns "Security & privacy" section count', () => { |
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.
✔️
selectors.deleteMetaMetricsDataButton, | ||
); | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
await (deleteMetaMetricsDataButton as any).waitForElementState( |
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.
Let's find a way to not use any
here. What is the type error that you saw that made it necessary to use any
?
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.
Same for the other cases
|
||
import ClearMetaMetricsData from './clear-metametrics-data'; | ||
|
||
describe('ClearMetaMetricsData', () => { |
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.
Can we also add a unit test that checks if there is a button and that createMetaMetricsDataDeletionTask
is called if the button is clicked?
@@ -0,0 +1,21 @@ | |||
import * as React from 'react'; |
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.
Can we also add a unit test that checks if there is a button and that hideDataDeletionErrorModal
is called if the button is clicked?
@@ -0,0 +1,99 @@ | |||
import React from 'react'; |
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.
✔️
@@ -98,6 +98,8 @@ type AppState = { | |||
customTokenAmount: string; |
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.
✔️
@@ -1818,6 +1818,59 @@ exports[`Security Tab should match snapshot 1`] = ` | |||
</label> |
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.
✔️
@@ -0,0 +1,207 @@ | |||
import * as React from 'react'; |
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.
✔️
const DeleteMetaMetricsDataButton = ({ | ||
wrapperRef, | ||
}: { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any |
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.
Let's find a way to remove the use of any
. What is the error you see that caused you use any
?
@@ -50,8 +50,10 @@ import { | |||
} from '../../../helpers/utils/settings-search'; |
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.
✔️
@@ -20,10 +20,12 @@ import { | |||
setUseExternalNameSources, |
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.
✔️
@@ -11,6 +11,8 @@ import { renderWithProvider } from '../../../../test/lib/render-helpers'; | |||
import { getIsSecurityAlertsEnabled } from '../../../selectors'; |
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.
✔️
ce675f0
to
5ba491b
Compare
5ba491b
to
ef54c5c
Compare
This PR is dependant on #24503
Description
Delete MetaMetrics Data
button.Clear
button in the modal will create a data deletion regulation, update the state, and close the modal, deactivating theDelete MetaMetrics Data
button.Clear
button click opens a new error modal.Scenarios to disable the DeleteMetaMetrics button:
Related issues
Fixes #24406, #24407, https://github.com/MetaMask/MetaMask-planning/issues/2523
Manual testing steps
Perquisite:
Provide the following details in the
.metamaskrc
file:yarn
,yarn dist
) against the code.wygFTooEUUtcckty9kaMc
.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist