-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add diagnostics pixels for harmony and prevent corrupted states #7846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
CrisBarreiro
merged 45 commits into
develop
from
feature/cris/autofill-harmony-add-diagnostic-pixels
Mar 9, 2026
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
c148bd6
Add diagnostics pixels for harmony but keep legacy as source of truth
CrisBarreiro aba25a9
Improve pixel definitions
CrisBarreiro ca0737e
Document addHarmonyFixes
CrisBarreiro 57790a4
Fix migration by allowing different legacy and harmony file names
CrisBarreiro 42f21f3
Fix pixel being fired if harmony prefs are null
CrisBarreiro b419c86
Future proof getKey so that we can read easily from harmony later
CrisBarreiro 3638d99
Put write guard behind feature flag
CrisBarreiro 7fe9b7d
Handle secure storage exceptions
CrisBarreiro 115db76
Don't swallow exceptions
CrisBarreiro a8c20d1
Add initialUseHarmonyValue as a pixel param
CrisBarreiro c1e02f3
Remove addHarmonyFixes
CrisBarreiro fedebb0
Don't open legacy prefs twice
CrisBarreiro 5fe7303
Refactor SharedPreferencesProviderImpl to avoid duplicate code
CrisBarreiro 2a9f0bb
Also pixel key missing from legacy
CrisBarreiro d296cf7
Add readFromHarmony pixel param (+4 squashed commits)
CrisBarreiro 6e4c513
Pixel/send exception if necessary file is unavailable
CrisBarreiro ad9bb4d
Extract pixel params
CrisBarreiro 7bb9af5
Remove caching
CrisBarreiro 80f0303
Rollback write to legacy if harmony write failed
CrisBarreiro 94d5f99
Still fire AUTOFILL_STORE_KEY_ALREADY_EXISTS if addWriteGuard is disa…
CrisBarreiro 1dcd3a6
Only heal legacy after harmony failure if writeGuard is enabled
CrisBarreiro 67b1986
Fix null file check being too aggressive
CrisBarreiro 1f17bfa
Fire pixel before throwing exception
CrisBarreiro 74d9d1c
Fix too aggressive pixel and add AUTOFILL_HARMONY_UPDATE_KEY_ROLLBACK…
CrisBarreiro 32f4dcd
Guard rollback behind writeGuard and throw exception on legacy key mi…
CrisBarreiro b4beb88
Only enable readGuard, writeGuard and readFromHarmony if useHarmony i…
CrisBarreiro 66cf219
Simplify flags setup
CrisBarreiro 8b5a98b
Remove redundant check
CrisBarreiro e4977f4
Fix pixel definitions
CrisBarreiro cd183f2
Revert changes upstream
CrisBarreiro 7d29446
Fix FakeSharedPreferencesProvider
CrisBarreiro a7199a6
Remove atb on new pixels
CrisBarreiro d7c6fb5
Add tests
CrisBarreiro bfef26a
Fix test failures
CrisBarreiro 325e3fc
Don't swallow cancelation exceptions
CrisBarreiro a2a93b2
Fix harmony prefs being initialized even if useHarmony was null
CrisBarreiro fff312a
Wrap throwable as SecureStorageException when getKey failed
CrisBarreiro b0e388f
Only throw exception for AUTOFILL_PREFERENCES_UPDATE_KEY_FAILED if us…
CrisBarreiro 0155222
Also wrap AUTOFILL_HARMONY_PREFERENCES_UPDATE_KEY_FAILED
CrisBarreiro d0f306e
Avoid duplicated pixels when prefs are null on getKey
CrisBarreiro dbf064c
Remove testing changes
CrisBarreiro 244b223
Prevent corruption on updateKey even if harmony is null
CrisBarreiro 8fca375
Update tests after fixes
CrisBarreiro 8b5a0f9
Fix AUTOFILL_PREFERENCES_KEY_MISSING fired on null prefs
CrisBarreiro c7d3974
Fix lint issues
CrisBarreiro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Four null_file pixels missing from pixel definitions file
Medium Severity
Four new pixels —
AUTOFILL_PREFERENCES_UPDATE_KEY_NULL_FILE,AUTOFILL_HARMONY_PREFERENCES_UPDATE_KEY_NULL_FILE,AUTOFILL_PREFERENCES_GET_KEY_NULL_FILE, andAUTOFILL_HARMONY_PREFERENCES_GET_KEY_NULL_FILE— are defined inAutofillPixelNames.kt, registered inPixelParamRemovalInterceptor.kt, and actively fired fromSecureStorageKeyStore.kt, but have no corresponding entry inautofill.json5. All other new pixels added in this PR are properly defined there. The project has avalidate-ddg-pixel-defsCI script that validates definitions, so these omissions may block validation or result in undocumented anonymous measurements.Please tell me if this was useful or not with a 👍 or 👎.
Additional Locations (1)
autofill/autofill-impl/src/main/java/com/duckduckgo/autofill/impl/pixel/AutofillPixelNames.kt#L242-L246