Skip to content

feat(analytics-controller): persist analyticsId in controller state#8542

Open
gauthierpetetin wants to merge 3 commits intomainfrom
feat/analytics-controller-persist-analytics-id
Open

feat(analytics-controller): persist analyticsId in controller state#8542
gauthierpetetin wants to merge 3 commits intomainfrom
feat/analytics-controller-persist-analytics-id

Conversation

@gauthierpetetin
Copy link
Copy Markdown
Contributor

@gauthierpetetin gauthierpetetin commented Apr 21, 2026

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

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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 AnalyticsController state metadata to persist analyticsId (persist: true) so it is saved/restored when the controller is composed with a persisted store (previously only optedIn was persisted).

Refreshes docs to reflect that analyticsId is 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 (ensuring analyticsId is not exposed to UI).

Reviewed by Cursor Bugbot for commit ac45b0f. Bugbot is set up for automated code reviews on this repo. Configure here.

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
@gauthierpetetin gauthierpetetin self-assigned this Apr 21, 2026
@gauthierpetetin gauthierpetetin force-pushed the feat/analytics-controller-persist-analytics-id branch from e2f3513 to 022deaa Compare April 21, 2026 13:29
…8542

Required for check-changelog CI.

Made-with: Cursor
@gauthierpetetin gauthierpetetin marked this pull request as ready for review April 21, 2026 13:48
@gauthierpetetin gauthierpetetin requested review from a team as code owners April 21, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant