Skip to content

Commit

Permalink
Validate VPN errors before re-throwing them (#3513)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/414709148257752/1208225499545869/f
Tech Design URL:
CC:

Description:

This PR validates VPN errors before throwing them to the OS.
  • Loading branch information
samsymons authored Nov 4, 2024
1 parent 8c33793 commit 4390003
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ extension Pixel {
case networkProtectionConfigurationInvalidPayload(configuration: Configuration)
case networkProtectionConfigurationPixelTest

case networkProtectionMalformedErrorDetected

// MARK: remote messaging pixels

case remoteMessageShown
Expand Down Expand Up @@ -1263,6 +1265,8 @@ extension Pixel.Event {
case .networkProtectionConfigurationInvalidPayload(let config): return "m_netp_vpn_configuration_\(config.rawValue)_invalid_payload"
case .networkProtectionConfigurationPixelTest: return "m_netp_vpn_configuration_pixel_test"

case .networkProtectionMalformedErrorDetected: return "m_netp_vpn_malformed_error_detected"

// MARK: remote messaging pixels

case .remoteMessageShown: return "m_remote_message_shown"
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10970,7 +10970,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 202.4.0;
version = 203.0.0;
};
};
9F8FE9472BAE50E50071E372 /* 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" : "80894bf69fe789e41b13f3de6be97f1300ca56e5",
"version" : "202.4.0"
"revision" : "45261df2963fc89094e169f9f2d0d9aa098093f3",
"version" : "203.0.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider {
vpnLogger.logStartingWithoutAuthToken()
DailyPixel.fireDailyAndCount(pixel: .networkProtectionTunnelStartAttemptOnDemandWithoutAccessToken,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes)
case .malformedErrorDetected(let error):
DailyPixel.fireDailyAndCount(pixel: .networkProtectionMalformedErrorDetected,
pixelNameSuffixes: DailyPixel.Constant.legacyDailyPixelSuffixes,
error: error)
}
}

Expand Down

0 comments on commit 4390003

Please sign in to comment.