fix(profile-metrics-controller): tag, canonicalize, and dedupe hardware, imported, and non-mnemonic snap accounts - #10107
Open
mathieuartu wants to merge 2 commits into
Open
fix(profile-metrics-controller): tag, canonicalize, and dedupe hardware, imported, and non-mnemonic snap accounts#10107mathieuartu wants to merge 2 commits into
mathieuartu wants to merge 2 commits into
Conversation
…re, imported, and non-mnemonic snap accounts
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
References
Related to: https://consensyssoftware.atlassian.net/browse/MUL-2216
⚠️ Blocked by: Backend accepting a new ⚠️
sourcefield in the submission payloadChecklist
Note
Medium Risk
Changes profile metrics sync state, enqueue/backfill behavior, and outbound account payloads; mistakes could mis-attribute accounts or skip/resubmit metrics incorrectly.
Overview
Profile metrics submissions now carry richer account metadata and avoid duplicate reporting for hardware, imported, and non-mnemonic Snap wallets.
Account
sourceand API payload: Non-mnemonic accounts are tagged with optionalsource(hardware|imported|snap) from keyring type when queued and sent viaProfileMetricsService; mnemonic-backed accounts stay attributed by entropy source only.Canonical addresses at enqueue: Addresses are normalized when added to the sync queue (not only during proof signing), so proof-less batches still reach the auth API in canonical form. Proof signing matches queued entries to live accounts by that canonical address.
Deduping and upgrade backfill: New persisted
reportedAccountsskips re-enqueueing addresses already submitted successfully. A one-timeaccountSourceBackfillEnqueuedpath (with existing bootstrap flags) re-queues all known accounts after upgrade so legacy syncs pick upsourceand canonical addresses; fresh installs set the flag on first sync.Reviewed by Cursor Bugbot for commit 13f68d5. Bugbot is set up for automated code reviews on this repo. Configure here.