-
-
Notifications
You must be signed in to change notification settings - Fork 268
Feat: new analytics privacy controller #7643
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
base: main
Are you sure you want to change the base?
Conversation
…ad of dates - Changed `deleteRegulationDate` to `deleteRegulationTimestamp` in the state and related methods to store timestamps in milliseconds since epoch. - Updated relevant methods and tests to reflect the new timestamp format. - Removed date formatting logic and adjusted selectors accordingly. - Added new dependencies for testing and updated the test suite to ensure proper functionality with the new timestamp format. This change enhances consistency in handling date-related data within the analytics privacy controller.
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
…e PascalCase - Refactored enum values in `DataDeleteResponseStatus` and `DataDeleteStatus` to follow PascalCase naming convention. - Updated all references in the codebase and tests to ensure consistency with the new enum values. - This change enhances code readability and aligns with common TypeScript practices.
…st title - Rename Error to Failure (and Ok to Success) for clearer naming - Fix duplicate test title in AnalyticsPrivacyController.test.ts - Update all references across the codebase
…tead of type-only
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.
Pull request overview
This PR introduces a new @metamask/analytics-privacy-controller package that provides GDPR/CCPA data deletion functionality for analytics data, extracting logic from the mobile app for reuse across MetaMask clients.
Changes:
- New controller package with
AnalyticsPrivacyControllerfor managing data deletion state (tracksdataRecorded,deleteRegulationId, anddeleteRegulationTimestamp) AnalyticsPrivacyServicefor communicating with Segment's Regulations API via proxy endpoint with retry/circuit-breaker logic- Comprehensive test coverage (100% branch, function, line, and statement coverage) and selector utilities for state access
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/analytics-privacy-controller/src/AnalyticsPrivacyController.ts | Main controller implementation managing deletion request lifecycle and state |
| packages/analytics-privacy-controller/src/AnalyticsPrivacyService.ts | Service for HTTP communication with Segment Regulations API via proxy |
| packages/analytics-privacy-controller/src/types.ts | Type definitions for deletion statuses and API responses |
| packages/analytics-privacy-controller/src/selectors.ts | Reusable state selectors |
| packages/analytics-privacy-controller/src/constants.ts | Segment API constants |
| packages/analytics-privacy-controller/package.json | Package configuration with dependencies |
| packages/analytics-privacy-controller/*.test.ts | Comprehensive test suites for controller and service |
| yarn.lock | Lockfile updates for new package dependencies |
| tsconfig.json, tsconfig.build.json | TypeScript project references |
| teams.json, .github/CODEOWNERS | Team ownership configuration |
| README.md | Documentation updates including package in list and dependency graph |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Explanation
This PR introduces a new
@metamask/analytics-privacy-controllerpackage that provides GDPR/CCPA data deletion functionality for analytics data. The package allows to extract the logic from the mobile app (and will be compatible with extension too)Current state: MetaMask mobile app currently has a dedicated mechanism to handle user data deletion requests for analytics data in compliance with GDPR and CCPA regulations.
Solution: This package introduces:
dataRecordedflag,deleteRegulationId, anddeleteRegulationTimestampto support compliance workflowsImplementation details:
AnalyticsController:getStateto retrieve the user's analytics IDAnalyticsPrivacyServiceto make HTTP requests to Segment's Regulations APIcreateServicePolicyfrom@metamask/controller-utilsfor retry logic and error handlingReferences
see also MetaMask/metamask-mobile#22016
Fixes #7618
Checklist
Note
Adds a new package to centralize analytics privacy and data deletion workflows for use across clients.
@metamask/analytics-privacy-controllerwithAnalyticsPrivacyController(state:dataRecorded,deleteRegulationId,deleteRegulationTimestamp; methods/events for creating and tracking deletion tasks)AnalyticsPrivacyServiceto call a proxy for Segment Regulations API with retry/circuit-breaker viacreateServicePolicy; defines action types and constantsWritten by Cursor Bugbot for commit 282ec85. This will update automatically on new commits. Configure here.