Skip to content
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

Improve Data Reporting for Chromium Keychain User Actions #2469

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ final class ChromiumKeychainPrompt: ChromiumKeychainPrompting {
kSecMatchLimit as String: kSecMatchLimitOne] as [String: Any]

var dataFromKeychain: AnyObject?

// Fire Pixel to help measure rate of password prompt denied actions
Pixel.fire(.passwordImportKeychainPrompt)

let status: OSStatus = SecItemCopyMatching(query as CFDictionary, &dataFromKeychain)

if status == noErr, let passwordData = dataFromKeychain as? Data {
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/DataImport/Model/DataImportViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ struct DataImportViewModel {
switch error {
// chromium user denied keychain prompt error
case let error as ChromiumLoginReader.ImportError where error.type == .userDeniedKeychainPrompt:
Pixel.fire(.dataImportFailed(source: importSource, sourceVersion: importSource.installedAppsMajorVersionDescription(selectedProfile: selectedProfile), error: error))
Pixel.fire(.passwordImportKeychainPromptDenied)
// stay on the same screen
return true

Expand Down
8 changes: 8 additions & 0 deletions DuckDuckGo/Statistics/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ extension Pixel {
case toggleReportDoNotSend
case toggleReportDismiss

// Password Import Keychain Prompt
case passwordImportKeychainPrompt
case passwordImportKeychainPromptDenied

enum Debug {
/// This is a convenience pixel that allows us to fire `PixelKitEvents` using our
/// regular `Pixel.fire()` calls. This is a convenience intermediate step to help ensure
Expand Down Expand Up @@ -694,6 +698,10 @@ extension Pixel.Event {
case .toggleReportDoNotSend: return "m_mac_toggle-report-do-not-send"
case .toggleReportDismiss: return "m_mac_toggle-report-dismiss"

// Password Import Keychain Prompt
case .passwordImportKeychainPrompt: return "m_mac_password_import_keychain_prompt"
case .passwordImportKeychainPromptDenied: return "m_mac_password_import_keychain_prompt_denied"

}
}
}
Expand Down
4 changes: 3 additions & 1 deletion DuckDuckGo/Statistics/PixelParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ extension Pixel.Event {
.privacyProOfferMonthlyPriceClick,
.privacyProOfferYearlyPriceClick,
.privacyProAddEmailSuccess,
.privacyProWelcomeFAQClick:
.privacyProWelcomeFAQClick,
.passwordImportKeychainPrompt,
.passwordImportKeychainPromptDenied:
return nil
}
}
Expand Down
Loading