Skip to content

feat: Adding a new controller for Metametrics Data Deletion#24503

Merged
NiranjanaBinoy merged 51 commits intodevelopfrom
delete-metametrics-data-controller
Sep 16, 2024
Merged

feat: Adding a new controller for Metametrics Data Deletion#24503
NiranjanaBinoy merged 51 commits intodevelopfrom
delete-metametrics-data-controller

Conversation

@NiranjanaBinoy
Copy link
Copy Markdown
Contributor

@NiranjanaBinoy NiranjanaBinoy commented May 13, 2024

Description

We are adding a new controller, MetaMetricsDataDeletionController, and a service class for MetaMetrics data deletion. The service class will have the API interaction for the data deletion, which will create the data deletion regulation and check the status of an existing relation. The controller handles the state update and service class interactions.
The PR also initiates the controller by updating the metamask-controller and updating actions.ts with the new functions.

Open in GitHub Codespaces

Related issues

Fixes:
fixes #24405

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • 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.

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.

@NiranjanaBinoy NiranjanaBinoy added the team-extension-platform Extension Platform team label May 13, 2024
@NiranjanaBinoy NiranjanaBinoy self-assigned this May 13, 2024
@NiranjanaBinoy NiranjanaBinoy requested a review from a team as a code owner May 13, 2024 20:16
@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.

@NiranjanaBinoy NiranjanaBinoy changed the title Adding a new controller for Metametrics Data Deletion feat : Adding a new controller for Metametrics Data Deletion May 13, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [614ccfd]
Page Load Metrics (880 ± 596 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6912288168
domContentLoaded95619126
load5729188801242596
domInteractive95619126
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@codecov
Copy link
Copy Markdown

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 92.47312% with 7 lines in your changes missing coverage. Please review.

Project coverage is 70.00%. Comparing base (aeb91c9) to head (886abe4).

Files with missing lines Patch % Lines
app/scripts/services/data-deletion-service.ts 90.91% 5 Missing ⚠️
...metrics-data-deletion/metametrics-data-deletion.ts 96.30% 1 Missing ⚠️
app/scripts/metamask-controller.js 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24503      +/-   ##
===========================================
+ Coverage    69.96%   70.00%   +0.04%     
===========================================
  Files         1441     1443       +2     
  Lines        50102    50194      +92     
  Branches     14012    14040      +28     
===========================================
+ Hits         35049    35134      +85     
- Misses       15053    15060       +7     

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

@NiranjanaBinoy NiranjanaBinoy changed the title feat : Adding a new controller for Metametrics Data Deletion feat: Adding a new controller for Metametrics Data Deletion May 14, 2024
@NiranjanaBinoy NiranjanaBinoy requested a review from kumavis as a code owner May 14, 2024 19:21
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [d1cdd73]
Page Load Metrics (786 ± 599 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint60143882411
domContentLoaded84515105
load4831237861247599
domInteractive84515105
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Copy Markdown
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

First review complete. I have left some comments

Gudahtt and others added 26 commits September 16, 2024 13:07
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

The `DataDeletionController` has been decoupled from the
`MetaMetricsController` by updating the constructor parameters to expect
just a function for getting the MetaMetrics ID, rather than the entire
`MetaMetricsController` state. This vastly simplifies the API surface,
making it easier to audit and test. It also prevents the
`DataDeletionController` from having the capability to make changes to
the `MetaMetricsController` state.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24870?quickstart=1)

## **Related issues**

This is an improvement for #24503

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [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](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

A single test has been added, along with a helper setup function that is
designed to be used for further unit tests as well.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24879?quickstart=1)

This is an improvement for the PR
#24503

N/A

N/A

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [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](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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.
Add unit tests for the `createDataDeletionRegulationTask` method of
`DataDeletionService`.

One of the two service methods is now fully tested. The remaining method
will be tested in a later PR.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24816?quickstart=1)

This is an improvement for the PR #24503

N/A

N/A

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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.

---------

Co-authored-by: Niranjana Binoy <43930900+NiranjanaBinoy@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [886abe4]
Page Load Metrics (1971 ± 113 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint22923491884446214
domContentLoaded148523351953228110
load149023491971234113
domInteractive147547189
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.77 KiB (0.22%)
  • ui: 0 Bytes (0.00%)
  • common: -87 Bytes (-0.00%)

Copy link
Copy Markdown
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

marketing-consent release-12.5.0 Issue or pull request that will be included in release 12.5.0 team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Add a new controller for MetaMetrics Data Deletion

8 participants