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

Deprecate PixelKit daily pixel suffixes #3509

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14777,8 +14777,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 203.1.0;
branch = "sam/migrate-daily-and-count-type-to-legacy-status";
kind = branch;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "19f1e5c945aa92562ad2d087e8d6c99801edf656",
"version" : "203.1.0"
"branch" : "sam/migrate-daily-and-count-type-to-legacy-status",
"revision" : "1915671f92f95f7e06870852787d96da9809a93c"
}
},
{
Expand Down
6 changes: 3 additions & 3 deletions DuckDuckGo/DBP/DataBrokerProtectionPixelsHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
.ipcServerImmediateScansFinishedWithError(error: let error),
.ipcServerAppLaunchedXPCError(error: let error),
.ipcServerAppLaunchedScheduledScansFinishedWithError(error: let error):
PixelKit.fire(DebugEvent(event, error: error), frequency: .dailyAndCount, includeAppVersionParameter: true)
PixelKit.fire(DebugEvent(event, error: error), frequency: .legacyDailyAndCount, includeAppVersionParameter: true)
case .ipcServerProfileSavedCalledByApp,
.ipcServerProfileSavedReceivedByAgent,
.ipcServerImmediateScansInterrupted,
Expand All @@ -50,7 +50,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
.ipcServerAppLaunchedScheduledScansBlocked,
.ipcServerAppLaunchedScheduledScansInterrupted,
.ipcServerAppLaunchedScheduledScansFinishedWithoutError:
PixelKit.fire(event, frequency: .dailyAndCount, includeAppVersionParameter: true)
PixelKit.fire(event, frequency: .legacyDailyAndCount, includeAppVersionParameter: true)
case .parentChildMatches,
.optOutStart,
.optOutEmailGenerate,
Expand Down Expand Up @@ -122,7 +122,7 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
.entitlementCheckValid,
.entitlementCheckInvalid,
.entitlementCheckError:
PixelKit.fire(event, frequency: .dailyAndCount)
PixelKit.fire(event, frequency: .legacyDailyAndCount)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/LoginItems/LoginItemsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final class LoginItemsManager: LoginItemsManaging {
action: "enable",
buildType: AppVersion.shared.buildType,
osVersion: AppVersion.shared.osVersion)
PixelKit.fire(DebugEvent(event, error: error), frequency: .dailyAndCount)
PixelKit.fire(DebugEvent(event, error: error), frequency: .legacyDailyAndCount)
Logger.networkProtection.error("Could not enable \(item.debugDescription, privacy: .public): \(error.debugDescription, privacy: .public)")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ extension EventMapping where Event == NetworkProtectionError {
frequency = .standard
case .failedToFetchLocationList(let error):
domainEvent = .networkProtectionClientFailedToFetchLocations(error)
frequency = .dailyAndCount
frequency = .legacyDailyAndCount
case .failedToParseLocationListResponse(let error):
domainEvent = .networkProtectionClientFailedToParseLocationsResponse(error)
frequency = .dailyAndCount
frequency = .legacyDailyAndCount
case .noServerRegistrationInfo,
.couldNotSelectClosestServer,
.couldNotGetPeerPublicKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
func start() async {
VPNOperationErrorRecorder().beginRecordingControllerStart()
PixelKit.fire(NetworkProtectionPixelEvent.networkProtectionControllerStartAttempt,
frequency: .dailyAndCount)
frequency: .legacyDailyAndCount)
controllerErrorStore.lastErrorMessage = nil

do {
Expand Down Expand Up @@ -580,19 +580,19 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
// in the packet tunnel provider side that can be used to debug additional logic.
//
PixelKit.fire(NetworkProtectionPixelEvent.networkProtectionControllerStartSuccess,
frequency: .dailyAndCount)
frequency: .legacyDailyAndCount)
}
} catch {
VPNOperationErrorRecorder().recordControllerStartFailure(error)
knownFailureStore.lastKnownFailure = KnownFailure(error)

if case StartError.cancelled = error {
PixelKit.fire(
NetworkProtectionPixelEvent.networkProtectionControllerStartCancelled, frequency: .dailyAndCount, includeAppVersionParameter: true
NetworkProtectionPixelEvent.networkProtectionControllerStartCancelled, frequency: .legacyDailyAndCount, includeAppVersionParameter: true
)
} else {
PixelKit.fire(
NetworkProtectionPixelEvent.networkProtectionControllerStartFailure(error), frequency: .dailyAndCount, includeAppVersionParameter: true
NetworkProtectionPixelEvent.networkProtectionControllerStartFailure(error), frequency: .legacyDailyAndCount, includeAppVersionParameter: true
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ final class VPNLocationViewModel: ObservableObject {
}

func onNearestItemSelection() async {
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetNearest, frequency: .dailyAndCount)
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetNearest, frequency: .legacyDailyAndCount)
selectedLocation = .nearest
await reloadList()
}

func onCountryItemSelection(id: String, cityId: String? = nil) async {
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetCustom, frequency: .dailyAndCount)
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingSetCustom, frequency: .legacyDailyAndCount)
let city = cityId == VPNCityItemModel.nearest.id ? nil : cityId
let location = NetworkProtectionSelectedLocation(country: id, city: city)
selectedLocation = .location(location)
Expand All @@ -95,7 +95,7 @@ final class VPNLocationViewModel: ObservableObject {
private func reloadList() async {
guard let locations = try? await locationListRepository.fetchLocationList().sortedByName() else { return }
if locations.isEmpty {
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingNoLocations, frequency: .dailyAndCount)
PixelKit.fire(GeneralPixel.networkProtectionGeoswitchingNoLocations, frequency: .legacyDailyAndCount)
}
let isNearestSelected = selectedLocation == .nearest
self.isNearestSelected = isNearestSelected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
knownFailureStore.lastKnownFailure = KnownFailure(error)
errorRecorder.recordIPCStartFailure(error)
log(error)
pixelKit?.fire(StartAttempt.failure(error), frequency: .dailyAndCount)
pixelKit?.fire(StartAttempt.failure(error), frequency: .legacyDailyAndCount)
}

do {
Expand All @@ -112,7 +112,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
if let error {
handleFailure(error)
} else {
pixelKit?.fire(StartAttempt.success, frequency: .dailyAndCount)
pixelKit?.fire(StartAttempt.success, frequency: .legacyDailyAndCount)
}
}
} catch {
Expand All @@ -126,7 +126,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {

func handleFailure(_ error: Error) {
log(error)
pixelKit?.fire(StopAttempt.failure(error), frequency: .dailyAndCount)
pixelKit?.fire(StopAttempt.failure(error), frequency: .legacyDailyAndCount)
}

do {
Expand All @@ -136,7 +136,7 @@ extension NetworkProtectionIPCTunnelController: TunnelController {
if let error {
handleFailure(error)
} else {
pixelKit?.fire(StopAttempt.success, frequency: .dailyAndCount)
pixelKit?.fire(StopAttempt.success, frequency: .legacyDailyAndCount)
}
}
} catch {
Expand Down
Loading
Loading