Skip to content

Commit

Permalink
Remove test pixel.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Nov 5, 2024
1 parent 9051b72 commit 1c18910
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 35 deletions.
1 change: 0 additions & 1 deletion DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
.dataBrokerMetricsWeeklyStats,
.dataBrokerMetricsMonthlyStats,
.invalidPayload,
.pixelTest,
.customDataBrokerStatsOptoutSubmit,
.customGlobalStatsOptoutSubmit,
.weeklyChildBrokerOrphanedOptOuts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {

case networkProtectionConfigurationInvalidPayload(configuration: Configuration)
case networkProtectionConfigurationErrorLoadingCachedConfig(_ error: Error)
case networkProtectionConfigurationPixelTest
case networkProtectionConfigurationFailedToParse(_ error: Error)

case networkProtectionMalformedErrorDetected(_ error: Error)
Expand Down Expand Up @@ -344,9 +343,6 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {
case .networkProtectionConfigurationErrorLoadingCachedConfig:
return "netp_ev_configuration_error_loading_cached_config"

case .networkProtectionConfigurationPixelTest:
return "netp_ev_configuration_pixel_test"

case .networkProtectionConfigurationFailedToParse:
return "netp_ev_configuration_failed_to_parse"

Expand Down Expand Up @@ -471,7 +467,6 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {
.networkProtectionDNSUpdateCustom,
.networkProtectionDNSUpdateDefault,
.networkProtectionConfigurationInvalidPayload,
.networkProtectionConfigurationPixelTest,
.networkProtectionMalformedErrorDetected:
return nil
}
Expand Down Expand Up @@ -555,8 +550,7 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 {
.networkProtectionServerMigrationSuccess,
.networkProtectionDNSUpdateCustom,
.networkProtectionDNSUpdateDefault,
.networkProtectionConfigurationInvalidPayload,
.networkProtectionConfigurationPixelTest:
.networkProtectionConfigurationInvalidPayload:
return nil
}
}
Expand Down
14 changes: 0 additions & 14 deletions DuckDuckGoVPN/DuckDuckGoVPNAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ final class DuckDuckGoVPNAppDelegate: NSObject, NSApplicationDelegate {
private let configurationStore = ConfigurationStore()
private let configurationManager: ConfigurationManager
private let privacyConfigurationManager = VPNPrivacyConfigurationManager()
private var configurationSubscription: AnyCancellable?

public init(accountManager: AccountManager,
accessTokenStorage: SubscriptionTokenKeychainStorage,
Expand Down Expand Up @@ -386,11 +385,6 @@ final class DuckDuckGoVPNAppDelegate: NSObject, NSApplicationDelegate {

setUpSubscriptionMonitoring()

configurationSubscription = privacyConfigurationManager.updatesPublisher
.sink { [weak self] in
self?.firePrivacyConfigTestPixelIfNecessary()
}

if launchedOnStartup {
Task {
let isConnected = await tunnelController.isConnected
Expand Down Expand Up @@ -427,8 +421,6 @@ final class DuckDuckGoVPNAppDelegate: NSObject, NSApplicationDelegate {
private func setUpSubscriptionMonitoring() {
guard accountManager.isUserAuthenticated else { return }

self.firePrivacyConfigTestPixelIfNecessary()

let entitlementsCheck = {
await self.accountManager.hasEntitlement(forProductName: .networkProtection, cachePolicy: .reloadIgnoringLocalCacheData)
}
Expand Down Expand Up @@ -456,12 +448,6 @@ final class DuckDuckGoVPNAppDelegate: NSObject, NSApplicationDelegate {
}
}

private func firePrivacyConfigTestPixelIfNecessary() {
if privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(BackgroundAgentPixelTestSubfeature.pixelTest) {
PixelKit.fire(NetworkProtectionPixelEvent.networkProtectionConfigurationPixelTest, frequency: .daily)
}
}

}

extension DuckDuckGoVPNAppDelegate: AccountManagerKeychainAccessDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ public enum DataBrokerProtectionPixels {
// Configuration
case invalidPayload(Configuration)
case errorLoadingCachedConfig(Error)
case pixelTest
case failedToParsePrivacyConfig(Error)

// Measure success/failure rate of Personal Information Removal Pixels
Expand Down Expand Up @@ -337,7 +336,6 @@ extension DataBrokerProtectionPixels: PixelKitEvent {
// Configuration
case .invalidPayload(let configuration): return "m_mac_dbp_\(configuration.rawValue)_invalid_payload".lowercased()
case .errorLoadingCachedConfig: return "m_mac_dbp_configuration_error_loading_cached_config"
case .pixelTest: return "m_mac_dbp_configuration_pixel_test"
case .failedToParsePrivacyConfig: return "m_mac_dbp_configuration_failed_to_parse"

// Various monitoring pixels
Expand Down Expand Up @@ -453,7 +451,6 @@ extension DataBrokerProtectionPixels: PixelKitEvent {
.secureVaultKeyStoreUpdateError,
.secureVaultError,
.invalidPayload,
.pixelTest,
.failedToParsePrivacyConfig:
return [:]
case .ipcServerProfileSavedCalledByApp,
Expand Down Expand Up @@ -614,7 +611,6 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
.dataBrokerMetricsWeeklyStats,
.dataBrokerMetricsMonthlyStats,
.invalidPayload,
.pixelTest,
.customDataBrokerStatsOptoutSubmit,
.customGlobalStatsOptoutSubmit,
.weeklyChildBrokerOrphanedOptOuts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ public final class DataBrokerProtectionAgentManager {

private var didStartActivityScheduler = false

private var configurationSubscription: AnyCancellable?

init(userNotificationService: DataBrokerProtectionUserNotificationService,
activityScheduler: DataBrokerProtectionBackgroundActivityScheduler,
ipcServer: DataBrokerProtectionIPCServer,
Expand Down Expand Up @@ -187,13 +185,6 @@ public final class DataBrokerProtectionAgentManager {
/// Monitors entitlement changes every 60 minutes to optimize system performance and resource utilization by avoiding unnecessary operations when entitlement is invalid.
/// While keeping the agent active with invalid entitlement has no significant risk, setting the monitoring interval at 60 minutes is a good balance to minimize backend checks.
agentStopper.monitorEntitlementAndStopAgentIfEntitlementIsInvalidAndUserIsNotFreemium(interval: .minutes(60))

configurationSubscription = privacyConfigurationManager.updatesPublisher
.sink { [weak self] _ in
if self?.privacyConfigurationManager.privacyConfig.isSubfeatureEnabled(BackgroundAgentPixelTestSubfeature.pixelTest) ?? false {
PixelKit.fire(DataBrokerProtectionPixels.pixelTest, frequency: .daily)
}
}
}
}
}
Expand Down

0 comments on commit 1c18910

Please sign in to comment.