Skip to content

Commit

Permalink
Expand persistent pixel usage (#3596)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/72649045549333/1208802635345012/f
Tech Design URL:
CC:

Description:

This PR updates pixel persistence to cover server migration and tunnel updates.
  • Loading branch information
samsymons authored Nov 22, 2024
1 parent 7b3b63d commit 3525099
Showing 1 changed file with 36 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,15 +212,26 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider {

switch step {
case .begin:
DailyPixel.fireDailyAndCount(pixel: .networkProtectionTunnelUpdateAttempt,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes)
persistentPixel.fireDailyAndCount(
pixel: .networkProtectionTunnelUpdateAttempt,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: nil,
withAdditionalParameters: [:],
includedParameters: [.appVersion]) { _ in }
case .failure(let error):
DailyPixel.fireDailyAndCount(pixel: .networkProtectionTunnelUpdateFailure,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: error)
persistentPixel.fireDailyAndCount(
pixel: .networkProtectionTunnelUpdateFailure,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: error,
withAdditionalParameters: [:],
includedParameters: [.appVersion]) { _ in }
case .success:
DailyPixel.fireDailyAndCount(pixel: .networkProtectionTunnelUpdateSuccess,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes)
persistentPixel.fireDailyAndCount(
pixel: .networkProtectionTunnelUpdateSuccess,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: nil,
withAdditionalParameters: [:],
includedParameters: [.appVersion]) { _ in }
}
case .tunnelWakeAttempt(let step):
vpnLogger.log(step, named: "Tunnel Wake")
Expand Down Expand Up @@ -259,15 +270,26 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider {

switch step {
case .begin:
DailyPixel.fireDailyAndCount(pixel: .networkProtectionServerMigrationAttempt,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes)
persistentPixel.fireDailyAndCount(
pixel: .networkProtectionServerMigrationAttempt,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: nil,
withAdditionalParameters: [:],
includedParameters: [.appVersion]) { _ in }
case .failure(let error):
DailyPixel.fireDailyAndCount(pixel: .networkProtectionServerMigrationAttemptFailure,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: error)
persistentPixel.fireDailyAndCount(
pixel: .networkProtectionServerMigrationAttemptFailure,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: error,
withAdditionalParameters: [:],
includedParameters: [.appVersion]) { _ in }
case .success:
DailyPixel.fireDailyAndCount(pixel: .networkProtectionServerMigrationAttemptSuccess,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes)
persistentPixel.fireDailyAndCount(
pixel: .networkProtectionServerMigrationAttemptSuccess,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: nil,
withAdditionalParameters: [:],
includedParameters: [.appVersion]) { _ in }
}
case .tunnelStartOnDemandWithoutAccessToken:
vpnLogger.logStartingWithoutAuthToken()
Expand Down

0 comments on commit 3525099

Please sign in to comment.