MetaMask / MetaMask/metamask-mobile
Migrate and remove MIXPANEL_METAMETRICS_ID in app storage
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 1.7k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 669
Description
### What is this about?
In `app/constants/storage.ts` we have `MIXPANEL_METAMETRICS_ID` that is used for legacy compatibility. Some logic is implemented on `app/core/Analytics/MetaMetrics.ts` `#getMetaMetricsId` to test if one exists and copy it if needed. At some point we will be able to remove this value completely.
It will require to make sure we don't want to retrieve the legacy `MIXPANEL_METAMETRICS_ID` even if it's still there. But I think at some point it will not be used anymore and will be recorded in the `METAMETRICS_ID` directly. The way we test this value could be changed to first get the `METAMETRICS_ID` and fallback to `MIXPANEL_METAMETRICS_ID` and eventually to generating a new one.
Given the time will come where 100% of our users will have `METAMETRICS_ID`, looking at it first will be a time and process saver.
### Current processing (A)
| Step | Value storage | action |
|------|---------------------------|--------------------------------------|
| 1 | `MIXPANEL_METAMETRICS_ID` | use if defined, else go to next step |
| 2 | `METAMETRICS_ID` | use if defined, else go to next step |
| 3 | none | generate a new UUID |
### Refactored processing (B)
| Step | Value storage | action |
|------|---------------------------|--------------------------------------|
| 1 | `METAMETRICS_ID` | use if defined, else go to next step |
| 2 | none | generate a new UUID |
### Scenario
_No response_
### Design
_No response_
### Technical Details
- remove `MIXPANEL_METAMETRICS_ID` from `app/constants/storage.ts`
- modify `app/core/Analytics/MetaMetrics.ts` `#getMetaMetricsId` to implement refactored processing (B)
- update unit tests
### Threat Modeling Framework
_No response_
### Acceptance Criteria
- no use of `MIXPANEL_METAMETRICS_ID`
- directly use `METAMETRICS_ID`
- tests are updated
### Stakeholder review needed before the work gets merged
- [X] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)
### References
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in app/constants/storage.ts and app/core/Analytics/MetaMetrics.ts, focusing on #getMetaMetricsId. Remove the legacy storage reference, keep retrieval centered on METAMETRICS_ID, and update the relevant unit tests. Done means no uses of MIXPANEL_METAMETRICS_ID remain and the tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100