feat(analytics-controller): persist analyticsId in controller state#8542
Open
gauthierpetetin wants to merge 3 commits intomainfrom
Open
feat(analytics-controller): persist analyticsId in controller state#8542gauthierpetetin wants to merge 3 commits intomainfrom
gauthierpetetin wants to merge 3 commits intomainfrom
Conversation
Set analyticsId metadata persist flag to true so persisted stores include the identifier alongside optedIn. Update JSDoc to match. Made-with: Cursor
Add four deriveStateFromMetadata metadata tests (debug snapshot, state logs, persist, UI) aligned with other controllers. Update changelog for persisted analyticsId. Trim README client storage section and refresh state table. Made-with: Cursor
e2f3513 to
022deaa
Compare
…8542 Required for check-changelog CI. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Set analyticsId metadata persist flag to true so persisted stores include the identifier alongside optedIn.
This is needed by Extension, where we want to move the ID from MetaMetricsController to AnalyticsController.
References
None
Checklist
Note
Medium Risk
Changes persistence behavior for
analyticsId, which can affect how clients serialize/rehydrate controller state and may require coordination with existing storage/migration expectations.Overview
Updates
AnalyticsControllerstate metadata to persistanalyticsId(persist: true) so it is saved/restored when the controller is composed with a persisted store (previously onlyoptedInwas persisted).Refreshes docs to reflect that
analyticsIdis now persisted (removing the prior “platform-managed storage” guidance), and adds tests asserting metadata-driven behavior for persistence, debug snapshots/state logs, and UI exposure (ensuringanalyticsIdis not exposed to UI).Reviewed by Cursor Bugbot for commit ac45b0f. Bugbot is set up for automated code reviews on this repo. Configure here.