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

VPN now recovers from WireGuard closing utun #3204

Merged
merged 9 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
1 change: 0 additions & 1 deletion Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public struct PixelParameters {
// Network Protection
public static let keychainFieldName = "fieldName"
public static let keychainErrorCode = errorCode
public static let wireguardErrorCode = errorCode
public static let latency = "latency"
public static let server = "server"
public static let networkType = "network_type"
Expand Down
4 changes: 3 additions & 1 deletion Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ extension Pixel {
case networkProtectionWireguardErrorFailedDNSResolution
case networkProtectionWireguardErrorCannotSetNetworkSettings
case networkProtectionWireguardErrorCannotStartWireguardBackend

case networkProtectionWireguardErrorCannotSetWireguardConfig

case networkProtectionFailedToLoadFromPreferences
case networkProtectionFailedToSaveToPreferences
case networkProtectionActivationRequestFailed
Expand Down Expand Up @@ -1143,6 +1144,7 @@ extension Pixel.Event {
case .networkProtectionWireguardErrorFailedDNSResolution: return "m_netp_wireguard_error_failed_dns_resolution"
case .networkProtectionWireguardErrorCannotSetNetworkSettings: return "m_netp_wireguard_error_cannot_set_network_settings"
case .networkProtectionWireguardErrorCannotStartWireguardBackend: return "m_netp_wireguard_error_cannot_start_wireguard_backend"
case .networkProtectionWireguardErrorCannotSetWireguardConfig: return "m_netp_wireguard_error_cannot_set_wireguard_config"
case .networkProtectionFailedToLoadFromPreferences: return "m_netp_network_extension_error_failed_to_load_from_preferences"
case .networkProtectionFailedToSaveToPreferences: return "m_netp_network_extension_error_failed_to_save_to_preferences"
case .networkProtectionActivationRequestFailed: return "m_netp_network_extension_error_activation_request_failed"
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10506,8 +10506,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 183.0.0;
kind = revision;
revision = c538181b02990b2862c80684f297c183bf74b934;
};
};
9F8FE9472BAE50E50071E372 /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "c3ae1865ba36ebbcb5451a836424213ea875d135",
"version" : "183.0.0"
"revision" : "c538181b02990b2862c80684f297c183bf74b934"
}
},
{
Expand Down
7 changes: 6 additions & 1 deletion DuckDuckGo/EventMapping+NetworkProtectionError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ extension EventMapping where Event == NetworkProtectionError {
.wireGuardInvalidState,
.wireGuardDnsResolution,
.wireGuardSetNetworkSettings,
.startWireGuardBackend,
.failedToRetrieveAuthToken,
.failedToFetchServerStatus,
.failedToParseServerStatusResponse:
Expand All @@ -95,6 +94,12 @@ extension EventMapping where Event == NetworkProtectionError {
// Should never be sent from from the app
case .unhandledError(function: let function, line: let line, error: let error):
pixelEvent = .networkProtectionUnhandledError
case .startWireGuardBackend(let error):
pixelEvent = .networkProtectionWireguardErrorCannotStartWireguardBackend
pixelError = error
case .setWireguardConfig(let error):
pixelEvent = .networkProtectionWireguardErrorCannotSetWireguardConfig
pixelError = error
}

DailyPixel.fireDailyAndCount(pixel: pixelEvent, error: pixelError, withAdditionalParameters: params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,12 @@ final class NetworkProtectionPacketTunnelProvider: PacketTunnelProvider {
case .wireGuardSetNetworkSettings(let error):
pixelEvent = .networkProtectionWireguardErrorCannotSetNetworkSettings
pixelError = error
case .startWireGuardBackend(let code):
case .startWireGuardBackend(let error):
pixelEvent = .networkProtectionWireguardErrorCannotStartWireguardBackend
params[PixelParameters.wireguardErrorCode] = String(code)
pixelError = error
case .setWireguardConfig(let error):
pixelEvent = .networkProtectionWireguardErrorCannotSetWireguardConfig
pixelError = error
case .noAuthTokenFound:
pixelEvent = .networkProtectionNoAccessTokenFoundError
case .vpnAccessRevoked:
Expand Down