Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit d6f051a

Browse files
authored
Deprecate PixelKit daily pixel suffixes (#3509)
Task/Issue URL: https://app.asana.com/0/0/1208695427490034/f Tech Design URL: CC: Description: This PR updates the app to use the new legacyDailyAndCount PixelKit suffix type.
1 parent a8de1e0 commit d6f051a

29 files changed

+145
-145
lines changed

DuckDuckGo.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -14778,7 +14778,7 @@
1477814778
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
1477914779
requirement = {
1478014780
kind = exactVersion;
14781-
version = 203.3.0;
14781+
version = 204.0.0;
1478214782
};
1478314783
};
1478414784
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {

DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
3434
"state" : {
35-
"revision" : "64a5d8d1e19951fe397305a14e521713fb0eaa49",
36-
"version" : "203.3.0"
35+
"revision" : "14594b6f3f3ddbea65be2818298e2e79305d8a26",
36+
"version" : "204.0.0"
3737
}
3838
},
3939
{

DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
4040
.ipcServerImmediateScansFinishedWithError(error: let error),
4141
.ipcServerAppLaunchedXPCError(error: let error),
4242
.ipcServerAppLaunchedScheduledScansFinishedWithError(error: let error):
43-
PixelKit.fire(DebugEvent(event, error: error), frequency: .dailyAndCount, includeAppVersionParameter: true)
43+
PixelKit.fire(DebugEvent(event, error: error), frequency: .legacyDailyAndCount, includeAppVersionParameter: true)
4444
case .ipcServerProfileSavedCalledByApp,
4545
.ipcServerProfileSavedReceivedByAgent,
4646
.ipcServerImmediateScansInterrupted,
@@ -50,7 +50,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
5050
.ipcServerAppLaunchedScheduledScansBlocked,
5151
.ipcServerAppLaunchedScheduledScansInterrupted,
5252
.ipcServerAppLaunchedScheduledScansFinishedWithoutError:
53-
PixelKit.fire(event, frequency: .dailyAndCount, includeAppVersionParameter: true)
53+
PixelKit.fire(event, frequency: .legacyDailyAndCount, includeAppVersionParameter: true)
5454
case .parentChildMatches,
5555
.optOutStart,
5656
.optOutEmailGenerate,
@@ -122,7 +122,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
122122
.entitlementCheckValid,
123123
.entitlementCheckInvalid,
124124
.entitlementCheckError:
125-
PixelKit.fire(event, frequency: .dailyAndCount)
125+
PixelKit.fire(event, frequency: .legacyDailyAndCount)
126126
}
127127
}
128128
}

DuckDuckGo/LoginItems/LoginItemsManager.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ final class LoginItemsManager: LoginItemsManaging {
9595
action: "enable",
9696
buildType: AppVersion.shared.buildType,
9797
osVersion: AppVersion.shared.osVersion)
98-
PixelKit.fire(DebugEvent(event, error: error), frequency: .dailyAndCount)
98+
PixelKit.fire(DebugEvent(event, error: error), frequency: .legacyDailyAndCount)
9999
Logger.networkProtection.error("Could not enable \(item.debugDescription, privacy: .public): \(error.debugDescription, privacy: .public)")
100100
}
101101

DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/EventMapping+NetworkProtectionError.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ extension EventMapping where Event == NetworkProtectionError {
6262
frequency = .standard
6363
case .failedToFetchLocationList(let error):
6464
domainEvent = .networkProtectionClientFailedToFetchLocations(error)
65-
frequency = .dailyAndCount
65+
frequency = .legacyDailyAndCount
6666
case .failedToParseLocationListResponse(let error):
6767
domainEvent = .networkProtectionClientFailedToParseLocationsResponse(error)
68-
frequency = .dailyAndCount
68+
frequency = .legacyDailyAndCount
6969
case .noServerRegistrationInfo,
7070
.couldNotSelectClosestServer,
7171
.couldNotGetPeerPublicKey,

DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/NetworkProtectionTunnelController.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
537537
func start() async {
538538
VPNOperationErrorRecorder().beginRecordingControllerStart()
539539
PixelKit.fire(NetworkProtectionPixelEvent.networkProtectionControllerStartAttempt,
540-
frequency: .dailyAndCount)
540+
frequency: .legacyDailyAndCount)
541541
controllerErrorStore.lastErrorMessage = nil
542542

543543
do {
@@ -580,19 +580,19 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
580580
// in the packet tunnel provider side that can be used to debug additional logic.
581581
//
582582
PixelKit.fire(NetworkProtectionPixelEvent.networkProtectionControllerStartSuccess,
583-
frequency: .dailyAndCount)
583+
frequency: .legacyDailyAndCount)
584584
}
585585
} catch {
586586
VPNOperationErrorRecorder().recordControllerStartFailure(error)
587587
knownFailureStore.lastKnownFailure = KnownFailure(error)
588588

589589
if case StartError.cancelled = error {
590590
PixelKit.fire(
591-
NetworkProtectionPixelEvent.networkProtectionControllerStartCancelled, frequency: .dailyAndCount, includeAppVersionParameter: true
591+
NetworkProtectionPixelEvent.networkProtectionControllerStartCancelled, frequency: .legacyDailyAndCount, includeAppVersionParameter: true
592592
)
593593
} else {
594594
PixelKit.fire(
595-
NetworkProtectionPixelEvent.networkProtectionControllerStartFailure(error), frequency: .dailyAndCount, includeAppVersionParameter: true
595+
NetworkProtectionPixelEvent.networkProtectionControllerStartFailure(error), frequency: .legacyDailyAndCount, includeAppVersionParameter: true
596596
)
597597
}
598598

DuckDuckGo/NetworkProtection/AppTargets/BothAppTargets/VPNLocation/VPNLocationViewModel.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ final class VPNLocationViewModel: ObservableObject {
7474
}
7575

7676
func onNearestItemSelection() async {
77-
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetNearest, frequency: .dailyAndCount)
77+
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetNearest, frequency: .legacyDailyAndCount)
7878
selectedLocation = .nearest
7979
await reloadList()
8080
}
8181

8282
func onCountryItemSelection(id: String, cityId: String? = nil) async {
83-
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetCustom, frequency: .dailyAndCount)
83+
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetCustom, frequency: .legacyDailyAndCount)
8484
let city = cityId == VPNCityItemModel.nearest.id ? nil : cityId
8585
let location = NetworkProtectionSelectedLocation(country: id, city: city)
8686
selectedLocation = .location(location)
@@ -95,7 +95,7 @@ final class VPNLocationViewModel: ObservableObject {
9595
private func reloadList() async {
9696
guard let locations = try? await locationListRepository.fetchLocationList().sortedByName() else { return }
9797
if locations.isEmpty {
98-
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingNoLocations, frequency: .dailyAndCount)
98+
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingNoLocations, frequency: .legacyDailyAndCount)
9999
}
100100
let isNearestSelected = selectedLocation == .nearest
101101
self.isNearestSelected = isNearestSelected

DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionIPCTunnelController.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
9696
knownFailureStore.lastKnownFailure = KnownFailure(error)
9797
errorRecorder.recordIPCStartFailure(error)
9898
log(error)
99-
pixelKit?.fire(StartAttempt.failure(error), frequency: .dailyAndCount)
99+
pixelKit?.fire(StartAttempt.failure(error), frequency: .legacyDailyAndCount)
100100
}
101101

102102
do {
@@ -112,7 +112,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
112112
if let error {
113113
handleFailure(error)
114114
} else {
115-
pixelKit?.fire(StartAttempt.success, frequency: .dailyAndCount)
115+
pixelKit?.fire(StartAttempt.success, frequency: .legacyDailyAndCount)
116116
}
117117
}
118118
} catch {
@@ -126,7 +126,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
126126

127127
func handleFailure(_ error: Error) {
128128
log(error)
129-
pixelKit?.fire(StopAttempt.failure(error), frequency: .dailyAndCount)
129+
pixelKit?.fire(StopAttempt.failure(error), frequency: .legacyDailyAndCount)
130130
}
131131

132132
do {
@@ -136,7 +136,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
136136
if let error {
137137
handleFailure(error)
138138
} else {
139-
pixelKit?.fire(StopAttempt.success, frequency: .dailyAndCount)
139+
pixelKit?.fire(StopAttempt.success, frequency: .legacyDailyAndCount)
140140
}
141141
}
142142
} catch {

0 commit comments

Comments
 (0)