Skip to content

Commit

Permalink
Merge branch 'main' into brindy/autocomplete-swiftui
Browse files Browse the repository at this point in the history
# Conflicts:
#	Core/UserDefaultsPropertyWrapper.swift
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
#	DuckDuckGo/MainViewController.swift
#	DuckDuckGo/UserText.swift
  • Loading branch information
brindy committed May 15, 2024
2 parents da71e55 + e1761be commit b4d5ec8
Show file tree
Hide file tree
Showing 60 changed files with 1,494 additions and 286 deletions.
3 changes: 3 additions & 0 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ public struct PixelParameters {
public static let adAttributionCountryOrRegion = "country_or_region"
public static let adAttributionKeywordID = "keyword_id"
public static let adAttributionAdID = "ad_id"

// Autofill
public static let countBucket = "count_bucket"
}

public struct PixelValues {
Expand Down
52 changes: 37 additions & 15 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ extension Pixel {
case autofillLoginsImportSuccess
case autofillLoginsImportFailure

case autofillActiveUser
case autofillEnabledUser
case autofillOnboardedUser
case autofillLoginsStacked

case getDesktopCopy
case getDesktopShare

Expand Down Expand Up @@ -580,13 +585,18 @@ extension Pixel {
case toggleReportDoNotSend
case toggleReportDismiss

case userBehaviorReloadTwice
case userBehaviorReloadAndRestart
case userBehaviorReloadAndFireButton
case userBehaviorReloadAndOpenSettings
case userBehaviorReloadAndTogglePrivacyControls
case userBehaviorFireButtonAndRestart
case userBehaviorFireButtonAndTogglePrivacyControls
case userBehaviorReloadTwiceWithin12Seconds
case userBehaviorReloadTwiceWithin24Seconds
case userBehaviorReloadAndRestartWithin30Seconds
case userBehaviorReloadAndRestartWithin50Seconds
case userBehaviorReloadThreeTimesWithin20Seconds
case userBehaviorReloadThreeTimesWithin40Seconds

case siteNotWorkingShown
case siteNotWorkingDismiss
case siteNotWorkingDismissByNavigation
case siteNotWorkingDismissByRefresh
case siteNotWorkingWebsiteIsBroken

// MARK: History
case historyStoreLoadFailed
Expand Down Expand Up @@ -944,6 +954,11 @@ extension Pixel.Event {
case .autofillLoginsImportSuccess: return "m_autofill_logins_import_success"
case .autofillLoginsImportFailure: return "m_autofill_logins_import_failure"

case .autofillActiveUser: return "m_autofill_activeuser"
case .autofillEnabledUser: return "m_autofill_enableduser"
case .autofillOnboardedUser: return "m_autofill_onboardeduser"
case .autofillLoginsStacked: return "m_autofill_logins_stacked"

case .getDesktopCopy: return "m_get_desktop_copy"
case .getDesktopShare: return "m_get_desktop_share"

Expand Down Expand Up @@ -1244,14 +1259,21 @@ extension Pixel.Event {
// MARK: - Apple Ad Attribution
case .appleAdAttribution: return "m_apple-ad-attribution"

// MARK: - User behavior
case .userBehaviorReloadTwice: return "m_reload-twice"
case .userBehaviorReloadAndRestart: return "m_reload-and-restart"
case .userBehaviorReloadAndFireButton: return "m_reload-and-fire-button"
case .userBehaviorReloadAndOpenSettings: return "m_reload-and-open-settings"
case .userBehaviorReloadAndTogglePrivacyControls: return "m_reload-and-toggle-privacy-controls"
case .userBehaviorFireButtonAndRestart: return "m_fire-button-and-restart"
case .userBehaviorFireButtonAndTogglePrivacyControls: return "m_fire-button-and-toggle-privacy-controls"
// MARK: - User behavior
case .userBehaviorReloadTwiceWithin12Seconds: return "m_reload-twice-within-12-seconds"
case .userBehaviorReloadTwiceWithin24Seconds: return "m_reload-twice-within-24-seconds"

case .userBehaviorReloadAndRestartWithin30Seconds: return "m_reload-and-restart-within-30-seconds"
case .userBehaviorReloadAndRestartWithin50Seconds: return "m_reload-and-restart-within-50-seconds"

case .userBehaviorReloadThreeTimesWithin20Seconds: return "m_reload-three-times-within-20-seconds"
case .userBehaviorReloadThreeTimesWithin40Seconds: return "m_reload-three-times-within-40-seconds"

case .siteNotWorkingShown: return "m_site-not-working_shown"
case .siteNotWorkingDismiss: return "m_site-not-working_dismiss"
case .siteNotWorkingDismissByNavigation: return "m_site-not-working.dismiss-by-navigation"
case .siteNotWorkingDismissByRefresh: return "m_site-not-working.dismiss-by-refresh"
case .siteNotWorkingWebsiteIsBroken: return "m_site-not-working_website-is-broken"

// MARK: - History debug
case .historyStoreLoadFailed: return "m_debug_history-store-load-failed"
Expand Down
1 change: 1 addition & 0 deletions Core/PixelExperiment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public enum PixelExperiment: String, CaseIterable {

// Internal state for users not included in any variant
case noVariant

}

extension PixelExperiment {
Expand Down
6 changes: 6 additions & 0 deletions Core/StatisticsLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public class StatisticsLoader {
if let data = response?.data, let atb = try? self.parser.convert(fromJsonData: data) {
self.statisticsStore.searchRetentionAtb = atb.version
self.storeUpdateVersionIfPresent(atb)
NotificationCenter.default.post(name: .searchDAU,
object: nil, userInfo: nil)
}
completion()
}
Expand Down Expand Up @@ -139,3 +141,7 @@ public class StatisticsLoader {
}
}
}

extension NSNotification.Name {
public static let searchDAU: NSNotification.Name = Notification.Name(rawValue: "com.duckduckgo.notification.searchDAU")
}
9 changes: 8 additions & 1 deletion Core/UserDefaultsPropertyWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public struct UserDefaultsWrapper<T> {
"com.duckduckgo.ios.autofillCredentialsHasBeenEnabledAutomaticallyIfNecessary"
case autofillImportViaSyncStart = "com.duckduckgo.ios.autofillImportViaSyncStart"
case autofillSurveyEnabled = "com.duckduckgo.ios.autofillSurveyEnabled"
case autofillSearchDauDate = "com.duckduckgo.ios.autofillSearchDauDate"
case autofillFillDate = "com.duckduckgo.ios.autofillFillDate"
case autofillOnboardedUser = "com.duckduckgo.ios.autofillOnboardedUser"

// .v2 suffix added to fix https://app.asana.com/0/547792610048271/1206524375402369/f
case featureFlaggingDidVerifyInternalUser = "com.duckduckgo.app.featureFlaggingDidVerifyInternalUser.v2"
Expand Down Expand Up @@ -134,14 +137,18 @@ public struct UserDefaultsWrapper<T> {
case appleAdAttributionReportCompleted = "com.duckduckgo.ios.appleAdAttributionReport.completed"

case didRefreshTimestamp = "com.duckduckgo.ios.userBehavior.didRefreshTimestamp"
case didBurnTimestamp = "com.duckduckgo.ios.userBehavior.didBurnTimestamp"
case didDoubleRefreshTimestamp = "com.duckduckgo.ios.userBehavior.didDoubleRefreshTimestamp"
case didRefreshCounter = "com.duckduckgo.ios.userBehavior.didRefreshCounter"
case userDidInteractWithBrokenSitePrompt = "com.duckduckgo.ios.userBehavior.userDidInteractWithBrokenSitePrompt"

case pixelExperimentInstalled = "com.duckduckgo.ios.pixel.experiment.installed"
case pixelExperimentCohort = "com.duckduckgo.ios.pixel.experiment.cohort"
case pixelExperimentEnrollmentDate = "com.duckduckgo.ios.pixel.experiment.enrollment.date"

case historyMessageDisplayCount = "com.duckduckgo.ios.historyMessage.displayCount"
case historyMessageDismissed = "com.duckduckgo.ios.historyMessage.dismissed"
case pixelExperimentForBrokenSitesInstalled = "com.duckduckgo.ios.pixel.experiment.for.broken.sites.installed"
case pixelExperimentForBrokenSitesCohort = "com.duckduckgo.ios.pixel.experiment.for.broken.sites.cohort"
}

private let key: Key
Expand Down
Loading

0 comments on commit b4d5ec8

Please sign in to comment.