Skip to content

Commit

Permalink
Report macOS NetP connection attempts & tunnel failures (#2234)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1205948683470037/f and https://app.asana.com/0/0/1205948683470038/f

- Updates BSK to support macOS pixel firing.
  • Loading branch information
quanganhdo authored Dec 8, 2023
1 parent da640ad commit 8bbc638
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ extension Pixel {
// MARK: Network Protection

case networkProtectionActiveUser
case networkProtectionNewUser

case networkProtectionRekeyCompleted
case networkProtectionLatency
Expand Down Expand Up @@ -841,6 +842,7 @@ extension Pixel.Event {
// MARK: Network Protection pixels

case .networkProtectionActiveUser: return "m_netp_daily_active_d"
case .networkProtectionNewUser: return "m_netp_daily_active_u"
case .networkProtectionRekeyCompleted: return "m_netp_rekey_completed"
case .networkProtectionLatency: return "m_netp_latency"
case .networkProtectionTunnelConfigurationNoServerRegistrationInfo: return "m_netp_tunnel_config_error_no_server_registration_info"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9157,7 +9157,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 92.0.4;
version = 92.1.0;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/DuckDuckGo/BrowserServicesKit",
"state": {
"branch": null,
"revision": "33e55105acc9d6d69ae1326fd5c506cefb89d5cc",
"version": "92.0.4"
"revision": "6d67e41feb5d7d22fec40fcede6b82eb88673900",
"version": "92.1.0"
}
},
{
Expand Down Expand Up @@ -123,8 +123,8 @@
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version": "1.2.3"
"revision": "c8ed701b513cf5177118a175d85fbbbcd707ab41",
"version": "1.3.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider {
switch event {
case .userBecameActive:
DailyPixel.fire(pixel: .networkProtectionActiveUser)
case .reportLatency(ms: let ms, server: let server, networkType: let networkType):
let params = [
PixelParameters.latency: String(ms),
PixelParameters.server: server,
PixelParameters.networkType: networkType.rawValue
]
Pixel.fire(pixel: .networkProtectionLatency, withAdditionalParameters: params)
case .reportLatency, .reportTunnelFailure, .reportConnectionAttempt:
// TODO: Fire these pixels
break
case .rekeyCompleted:
Pixel.fire(pixel: .networkProtectionRekeyCompleted)
}
Expand Down

0 comments on commit 8bbc638

Please sign in to comment.