Skip to content

Commit

Permalink
Make dbSaveBloomFilterError pixel daily and continuous (#2299)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1199230911884351/1205962557569232/f
iOS PR: duckduckgo/iOS#2526

## Description

We're making the `dbSaveBloomFilterError` pixel fire daily and
continuously to be able to better understand impact (ie: number of users
affected).
  • Loading branch information
diegoreymendez authored Mar 6, 2024
1 parent 774adaa commit cd5a498
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DuckDuckGo/SmarterEncryption/PrivacyFeatures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,22 @@ final class AppPrivacyFeatures: PrivacyFeaturesProtocol {

private static let httpsUpgradeDebugEvents = EventMapping<AppHTTPSUpgradeStore.ErrorEvents> { event, error, parameters, onComplete in
let domainEvent: Pixel.Event.Debug
let dailyAndCount: Bool

switch event {
case .dbSaveBloomFilterError:
domainEvent = .dbSaveBloomFilterError
dailyAndCount = true
case .dbSaveExcludedHTTPSDomainsError:
domainEvent = .dbSaveExcludedHTTPSDomainsError
dailyAndCount = false
}

Pixel.fire(.debug(event: domainEvent, error: error), withAdditionalParameters: parameters, onComplete: onComplete)
if dailyAndCount {
DailyPixel.fire(pixel: .debug(event: domainEvent, error: error), frequency: .dailyAndCount, includeAppVersionParameter: true, withAdditionalParameters: parameters ?? [:], onComplete: onComplete)
} else {
Pixel.fire(.debug(event: domainEvent, error: error), withAdditionalParameters: parameters, onComplete: onComplete)
}
}
private static var embeddedBloomFilterResources: EmbeddedBloomFilterResources {
EmbeddedBloomFilterResources(bloomSpecification: Bundle.main.url(forResource: "httpsMobileV2BloomSpec", withExtension: "json")!,
Expand Down

0 comments on commit cd5a498

Please sign in to comment.