Skip to content
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

refactor: Decouple the data deletion controller #24870

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented May 29, 2024

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

Related issues

This is an improvement for #24503

Manual testing steps

N/A

Screenshots/Recordings

N/A

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.

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.

This is an improvement for #24503
@Gudahtt Gudahtt marked this pull request as ready for review May 29, 2024 15:05
@Gudahtt Gudahtt requested a review from a team as a code owner May 29, 2024 15:05
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.74%. Comparing base (d15ca11) to head (d15ca11).

Current head d15ca11 differs from pull request most recent head 3e61f0b

Please upload reports for the commit 3e61f0b to get more accurate results.

Additional details and impacted files
@@                         Coverage Diff                         @@
##           delete-metametrics-data-controller   #24870   +/-   ##
===================================================================
  Coverage                               65.74%   65.74%           
===================================================================
  Files                                    1368     1368           
  Lines                                   54335    54335           
  Branches                                14124    14124           
===================================================================
  Hits                                    35722    35722           
  Misses                                  18613    18613           

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

@metamaskbot
Copy link
Collaborator

Builds ready [c90863b]
Page Load Metrics (400 ± 370 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint671711002512
domContentLoaded8371484
load542411400770370
domInteractive8371484
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 7.26 KiB (0.21%)
  • ui: 0 Bytes (0.00%)
  • common: -388 Bytes (-0.01%)

@Gudahtt Gudahtt merged commit 32929cf into delete-metametrics-data-controller May 29, 2024
65 of 66 checks passed
@Gudahtt Gudahtt deleted the decouple-from-metametrics-controller branch May 29, 2024 19:04
@github-actions github-actions bot locked and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants