Skip to content

Commit

Permalink
Prevent VPN server list persistence failures (#1985)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1206201299599597/f
Tech Design URL:
CC:

Description:

This PR makes two changes:

1. The WireGuard invalid state error has been given a reason field, to allow insight into what state is invalid exactly
2. The server list store no longer prevents the file from being stored if the old one can't be removed; this appears to be a major source of unhandled errors
  • Loading branch information
samsymons authored Dec 19, 2023
1 parent 79647a6 commit d52d24a
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 35 deletions.
19 changes: 1 addition & 18 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3034,13 +3034,6 @@
remoteGlobalIDString = AA585D7D248FD31100E9A3E2;
remoteInfo = "DuckDuckGo Privacy Browser";
};
565E46E32B2725DD0013AC2A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AA585D76248FD31100E9A3E2 /* Project object */;
proxyType = 1;
remoteGlobalIDString = AA585D7D248FD31100E9A3E2;
remoteInfo = "DuckDuckGo Privacy Browser";
};
7B4CE8DF26F02108009134B1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AA585D76248FD31100E9A3E2 /* Project object */;
Expand Down Expand Up @@ -8267,7 +8260,6 @@
buildRules = (
);
dependencies = (
565E46E42B2725DD0013AC2A /* PBXTargetDependency */,
);
name = SyncE2EUITests;
productName = DuckDuckGoSyncUITests;
Expand Down Expand Up @@ -12018,10 +12010,6 @@
isa = PBXTargetDependency;
productRef = B6080BA42B20AF8800B418EF /* SwiftLintPlugin */;
};
B6080BA72B20AF8B00B418EF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = B6080BA62B20AF8B00B418EF /* SwiftLintPlugin */;
};
B6080BA92B20AF8F00B418EF /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = B6080BA82B20AF8F00B418EF /* SwiftLintPlugin */;
Expand Down Expand Up @@ -12942,7 +12930,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 94.0.3;
version = 95.0.0;
};
};
AA06B6B52672AF8100F541C5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
Expand Down Expand Up @@ -13427,11 +13415,6 @@
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = "plugin:SwiftLintPlugin";
};
B6080BA62B20AF8B00B418EF /* SwiftLintPlugin */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = "plugin:SwiftLintPlugin";
};
B6080BA82B20AF8F00B418EF /* SwiftLintPlugin */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "d07e18b3785d31c15364e56bdd2cb4b27edd35d0",
"version" : "94.0.3"
"revision" : "ae9e9180f74d92c83fc3cc1d2fc23f4855fb361c",
"version" : "95.0.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enum NetworkProtectionPixelEvent: PixelKitEvent {
case networkProtectionKeychainDeleteError(status: Int32)

case networkProtectionWireguardErrorCannotLocateTunnelFileDescriptor
case networkProtectionWireguardErrorInvalidState
case networkProtectionWireguardErrorInvalidState(reason: String)
case networkProtectionWireguardErrorFailedDNSResolution
case networkProtectionWireguardErrorCannotSetNetworkSettings(error: Error)
case networkProtectionWireguardErrorCannotStartWireguardBackend(code: Int32)
Expand Down Expand Up @@ -265,6 +265,11 @@ enum NetworkProtectionPixelEvent: PixelKitEvent {
PixelKit.Parameters.errorCode: String(code)
]

case .networkProtectionWireguardErrorInvalidState(reason: let reason):
return [
PixelKit.Parameters.reason: reason
]

case .networkProtectionTunnelConfigurationNoServerRegistrationInfo,
.networkProtectionTunnelConfigurationCouldNotSelectClosestServer,
.networkProtectionTunnelConfigurationCouldNotGetPeerPublicKey,
Expand All @@ -282,7 +287,6 @@ enum NetworkProtectionPixelEvent: PixelKitEvent {
.networkProtectionNoAuthTokenFoundError,
.networkProtectionRekeyCompleted,
.networkProtectionWireguardErrorCannotLocateTunnelFileDescriptor,
.networkProtectionWireguardErrorInvalidState,
.networkProtectionWireguardErrorFailedDNSResolution,
.networkProtectionSystemExtensionActivationFailure,
.networkProtectionActiveUser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ final class MacPacketTunnelProvider: PacketTunnelProvider {
domainEvent = .networkProtectionKeychainDeleteError(status: status)
case .wireGuardCannotLocateTunnelFileDescriptor:
domainEvent = .networkProtectionWireguardErrorCannotLocateTunnelFileDescriptor
case .wireGuardInvalidState:
domainEvent = .networkProtectionWireguardErrorInvalidState
case .wireGuardInvalidState(let reason):
domainEvent = .networkProtectionWireguardErrorInvalidState(reason: reason)
case .wireGuardDnsResolution:
domainEvent = .networkProtectionWireguardErrorFailedDNSResolution
case .wireGuardSetNetworkSettings(let error):
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/Account/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
targets: ["Account"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
.package(path: "../Purchase")
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/DataBrokerProtection/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let package = Package(
targets: ["DataBrokerProtection"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
.package(path: "../PixelKit"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../XPCHelper")
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/LoginItems/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
.library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"])
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
.package(path: "../XPCHelper"),
.package(path: "../SwiftUIExtensions")
],
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/PixelKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public extension PixelKit {
public static let vpnBreakageCategory = "breakageCategory"
public static let vpnBreakageDescription = "breakageDescription"
public static let vpnBreakageMetadata = "breakageMetadata"

public static let reason = "reason"
}

enum Values {
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/Purchase/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/Subscription/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let package = Package(
.package(path: "../Account"),
.package(path: "../Purchase"),
.package(path: "../SwiftUIExtensions"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SwiftUIExtensions/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SyncUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
],
dependencies: [
.package(path: "../SwiftUIExtensions"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SystemExtensionManager/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/XPCHelper/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
.library(name: "XPCHelper", targets: ["XPCHelper"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "94.0.3"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "95.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down

0 comments on commit d52d24a

Please sign in to comment.