feat: segment data deletion (4/4)#8090
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. |
and add comments
…ask/metamask-mobile into 1403_Segment_data_deletion_request
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feat/batch_1129_segment #8090 +/- ##
===========================================================
+ Coverage 40.33% 40.50% +0.16%
===========================================================
Files 1238 1239 +1
Lines 29985 30007 +22
Branches 2882 2890 +8
===========================================================
+ Hits 12095 12154 +59
+ Misses 17197 17157 -40
- Partials 693 696 +3 ☔ View full report in Codecov by Sentry. |
…n_request # Conflicts: # app/components/Views/Settings/SecuritySettings/Sections/DeleteMetaMetricsData.tsx
update IMetametrics to add new function update unit tests
478642d to
651fccf
Compare
651fccf to
2960af7
Compare
plus code cleanup
|
|
e2e smoke tests running on https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ed2be129-6fa5-4cad-b493-698b1405b64e Important The e2e test fails on tests that are absolutely not related to my changes (token import). |
cortisiko
left a comment
There was a problem hiding this comment.
I did some manual spot checks and noticed no issues with the overall functionality with the app. Furthermore, I went ahead and kicked off regression: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/64641e5f-8c13-4b58-9474-5cdced2d5730 and tests passed. ✅

Description
What is the reason for the change?
User has to be able to request deletion of their metrics data stored in new segment system.
What is the improvement/solution?
createDataDeletionTasktoMetaMetricsto call the deletion API in MetaMetrics class for method create source regulationcheckDataDeletionTaskStatustoMetaMetricsto call deletion API get regulation methodcreateDataDeletionTaskandcheckDataDeletionTaskStatusfromDeleteMetaMetricsData.tsxwhen user touches the delete button.Analytics.jsimplementation of these features and point only to the newMetaMetricsones.storage.js:METAMETRICS_SEGMENT_REGULATION_ID->METAMETRICS_DELETION_REGULATION_IDRelated issues
Fixes https://github.com/MetaMask/mobile-planning/issues/1403
Manual testing steps
Note
Testing is non regression testing as the feature should work exactly the same as before.
There's 3 cases here:
Screenshots/Recordings
Simulator.Screen.Recording.-.iPhone.13.Pro.-.2024-01-16.at.16.25.15.mp4
"Security and Privacy" settings "Delete Metametrics data" section BEFORE deletion request:

"Security and Privacy" settings "Delete Metametrics data" section AFTER deletion request:

"Delete MetaMetrics Data Request Submitted" event tracked on Segment and visible in the dashboard:
{ "context": { "library": { "name": "source-functions", "version": "1.0.0" }, "location": { "api_processing_time_ms": 520, "country_code": "FR", "region": "NOR", "timezone": "Europe/Paris" } }, "event": "Delete MetaMetrics Data Request Submitted", "integrations": {}, "messageId": "e09b2aac-dd78-44d5-8c48-9ee1464836b1", "originalTimestamp": "2023-12-13T23:50:58.790Z", "properties": { "device_model": "Apple iPhone14,2", "os": "ios", "os_version": "17.0.1" }, "receivedAt": "2023-12-13T23:51:31.609Z", "sentAt": "2023-12-13T23:51:31.609Z", "timestamp": "2023-12-13T23:50:58.790Z", "type": "track", "userId": "35a6b109-d2b4-4d1f-a3ee-7dd454bd8667", "writeKey": "REDACTED" }Deletion Request appears as "INITIALIZED" in the Segment Deletion Requests dashboard.

You can make sure this is your request by matching the ID with the ID that should have been sent to segment during the onboarding and by the date and time of the request.
Before
No change, this PR only makes this work with Segment, but UX should be the same
After
No change, this PR only makes this work with Segment, but UX should be the same
Pre-merge author checklist
Pre-merge reviewer checklist