diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 54382a2539..34df2d094e 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1089,7 +1089,6 @@ 4B2D06292A11C0C900DE1F49 /* Bundle+VPN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D605E2A0B29FA00BCD287 /* Bundle+VPN.swift */; }; 4B2D062A2A11C0C900DE1F49 /* NetworkProtectionOptionKeyExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D605F2A0B29FA00BCD287 /* NetworkProtectionOptionKeyExtension.swift */; }; 4B2D062C2A11C0E100DE1F49 /* Networking in Frameworks */ = {isa = PBXBuildFile; productRef = 4B2D062B2A11C0E100DE1F49 /* Networking */; }; - 4B2D062D2A11C12300DE1F49 /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85799C1725DEBB3F0007EC87 /* Logging.swift */; }; 4B2D06322A11C1D300DE1F49 /* NSApplicationExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5C8F622591021700748EB7 /* NSApplicationExtension.swift */; }; 4B2D06332A11C1E300DE1F49 /* OptionalExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B637273C26CCF0C200C8CB02 /* OptionalExtension.swift */; }; 4B2D065B2A11D1FF00DE1F49 /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4BEC322A11B509001D9AC5 /* Logging.swift */; }; @@ -1494,7 +1493,6 @@ 7B97CD5D2B7E0BCE004FEF43 /* BundleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6106B9D26A565DA0013B453 /* BundleExtension.swift */; }; 7B97CD5E2B7E0BEA004FEF43 /* OptionalExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B637273C26CCF0C200C8CB02 /* OptionalExtension.swift */; }; 7B97CD5F2B7E0BF7004FEF43 /* NSApplicationExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA5C8F622591021700748EB7 /* NSApplicationExtension.swift */; }; - 7B97CD602B7E0C2E004FEF43 /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85799C1725DEBB3F0007EC87 /* Logging.swift */; }; 7BA076BB2B65D61400D7FB72 /* NetworkProtectionProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 7BA076BA2B65D61400D7FB72 /* NetworkProtectionProxy */; }; 7BA4727D26F01BC400EAA165 /* CoreDataTestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B9292C42667104B00AD2C21 /* CoreDataTestUtilities.swift */; }; 7BA59C9B2AE18B49009A97B1 /* SystemExtensionManager in Frameworks */ = {isa = PBXBuildFile; productRef = 7BA59C9A2AE18B49009A97B1 /* SystemExtensionManager */; }; @@ -3279,6 +3277,7 @@ 7B2DDCF72A93A8BB0039D884 /* NetworkProtectionAppEvents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionAppEvents.swift; sourceTree = ""; }; 7B2E52242A5FEC09000C6D39 /* NetworkProtectionAgentNotificationsPresenter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionAgentNotificationsPresenter.swift; sourceTree = ""; }; 7B3618C12ADE75C8000D6154 /* NetworkProtectionNavBarPopoverManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionNavBarPopoverManager.swift; sourceTree = ""; }; + 7B427BA82BD81D8C0014AE6C /* BrowserServicesKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = BrowserServicesKit; path = ../../BrowserServicesKit; sourceTree = ""; }; 7B430EA02A71411A00BAC4A1 /* NetworkProtectionSimulateFailureMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkProtectionSimulateFailureMenu.swift; sourceTree = ""; }; 7B4CE8DA26F02108009134B1 /* UI Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UI Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 7B4CE8E626F02134009134B1 /* TabBarTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarTests.swift; sourceTree = ""; }; @@ -4716,6 +4715,7 @@ 378E279C2970217400FCADA2 /* LocalPackages */ = { isa = PBXGroup; children = ( + 7B427BA82BD81D8C0014AE6C /* BrowserServicesKit */, 378E279D2970217400FCADA2 /* BuildToolPlugins */, 3192A2702A4C4E330084EA89 /* DataBrokerProtection */, 9DB6E7222AA0DA7A00A17F3C /* LoginItems */, @@ -10508,7 +10508,6 @@ 4B25377A2A11C01700610219 /* UserText+NetworkProtectionExtensions.swift in Sources */, B65DA5F42A77D3FA00CBEE8D /* BundleExtension.swift in Sources */, EE66418D2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift in Sources */, - 4B2D062D2A11C12300DE1F49 /* Logging.swift in Sources */, 7B2E52252A5FEC09000C6D39 /* NetworkProtectionAgentNotificationsPresenter.swift in Sources */, B602E8232A1E260E006D261F /* Bundle+NetworkProtectionExtensions.swift in Sources */, 4B2D062A2A11C0C900DE1F49 /* NetworkProtectionOptionKeyExtension.swift in Sources */, @@ -10670,7 +10669,6 @@ buildActionMask = 2147483647; files = ( 7B97CD5C2B7E0BBB004FEF43 /* UserDefaultsWrapper.swift in Sources */, - 7B97CD602B7E0C2E004FEF43 /* Logging.swift in Sources */, 7B97CD5E2B7E0BEA004FEF43 /* OptionalExtension.swift in Sources */, 7B97CD5F2B7E0BF7004FEF43 /* NSApplicationExtension.swift in Sources */, 7BDA36F52B7E055800AD5388 /* MacTransparentProxyProvider.swift in Sources */, @@ -12726,7 +12724,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = "138.0.0-1"; + version = 140.0.3; }; }; 4311906792B7676CE9535D76 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */ = { @@ -12742,7 +12740,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 140.0.2; + version = 140.0.3; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index d0e88eeb67..c903f1eed8 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -27,15 +27,6 @@ "version" : "3.0.0" } }, - { - "identity" : "browserserviceskit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/BrowserServicesKit", - "state" : { - "revision" : "4340e2840f6ca634e61caffd1ced913603ddf0eb", - "version" : "140.0.2" - } - }, { "identity" : "content-scope-scripts", "kind" : "remoteSourceControl", diff --git a/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift b/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift index 2446ab0ac5..0a29c23807 100644 --- a/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift +++ b/DuckDuckGo/NetworkProtection/AppAndExtensionAndAgentTargets/NetworkProtectionPixelEvent.swift @@ -34,10 +34,18 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 { case networkProtectionTunnelStartSuccess case networkProtectionTunnelStartFailure(_ error: Error) + case networkProtectionTunnelStopAttempt + case networkProtectionTunnelStopSuccess + case networkProtectionTunnelStopFailure(_ error: Error) + case networkProtectionTunnelUpdateAttempt case networkProtectionTunnelUpdateSuccess case networkProtectionTunnelUpdateFailure(_ error: Error) + case networkProtectionTunnelWakeAttempt + case networkProtectionTunnelWakeSuccess + case networkProtectionTunnelWakeFailure(_ error: Error) + case networkProtectionEnableAttemptConnecting case networkProtectionEnableAttemptSuccess case networkProtectionEnableAttemptFailure @@ -119,6 +127,15 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 { case .networkProtectionTunnelStartFailure: return "netp_tunnel_start_failure" + case .networkProtectionTunnelStopAttempt: + return "netp_tunnel_stop_attempt" + + case .networkProtectionTunnelStopSuccess: + return "netp_tunnel_stop_success" + + case .networkProtectionTunnelStopFailure: + return "netp_tunnel_stop_failure" + case .networkProtectionTunnelUpdateAttempt: return "netp_tunnel_update_attempt" @@ -128,6 +145,15 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 { case .networkProtectionTunnelUpdateFailure: return "netp_tunnel_update_failure" + case .networkProtectionTunnelWakeAttempt: + return "netp_tunnel_wake_attempt" + + case .networkProtectionTunnelWakeSuccess: + return "netp_tunnel_wake_success" + + case .networkProtectionTunnelWakeFailure: + return "netp_tunnel_wake_failure" + case .networkProtectionEnableAttemptConnecting: return "netp_ev_enable_attempt" @@ -300,9 +326,15 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 { .networkProtectionTunnelStartAttempt, .networkProtectionTunnelStartSuccess, .networkProtectionTunnelStartFailure, + .networkProtectionTunnelStopAttempt, + .networkProtectionTunnelStopSuccess, + .networkProtectionTunnelStopFailure, .networkProtectionTunnelUpdateAttempt, .networkProtectionTunnelUpdateSuccess, .networkProtectionTunnelUpdateFailure, + .networkProtectionTunnelWakeAttempt, + .networkProtectionTunnelWakeSuccess, + .networkProtectionTunnelWakeFailure, .networkProtectionEnableAttemptConnecting, .networkProtectionEnableAttemptSuccess, .networkProtectionEnableAttemptFailure, @@ -343,7 +375,9 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 { return error case .networkProtectionControllerStartFailure(let error), .networkProtectionTunnelStartFailure(let error), + .networkProtectionTunnelStopFailure(let error), .networkProtectionTunnelUpdateFailure(let error), + .networkProtectionTunnelWakeFailure(let error), .networkProtectionClientFailedToParseRedeemResponse(let error), .networkProtectionWireguardErrorCannotSetNetworkSettings(let error), .networkProtectionRekeyFailure(let error), @@ -356,8 +390,12 @@ enum NetworkProtectionPixelEvent: PixelKitEventV2 { .networkProtectionControllerStartSuccess, .networkProtectionTunnelStartAttempt, .networkProtectionTunnelStartSuccess, + .networkProtectionTunnelStopAttempt, + .networkProtectionTunnelStopSuccess, .networkProtectionTunnelUpdateAttempt, .networkProtectionTunnelUpdateSuccess, + .networkProtectionTunnelWakeAttempt, + .networkProtectionTunnelWakeSuccess, .networkProtectionEnableAttemptConnecting, .networkProtectionEnableAttemptSuccess, .networkProtectionEnableAttemptFailure, diff --git a/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionSubscriptionEventHandler.swift b/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionSubscriptionEventHandler.swift index b1e4a36a7d..ecdc324254 100644 --- a/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionSubscriptionEventHandler.swift +++ b/DuckDuckGo/NetworkProtection/AppTargets/DeveloperIDTarget/NetworkProtectionSubscriptionEventHandler.swift @@ -17,11 +17,11 @@ // import Combine +import Common import Foundation import Subscription import NetworkProtection import NetworkProtectionUI -import Common final class NetworkProtectionSubscriptionEventHandler { diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift index 842ff33ad8..2451f4e44c 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacPacketTunnelProvider.swift @@ -233,6 +233,24 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { frequency: .dailyAndCount, includeAppVersionParameter: true) } + case .tunnelStopAttempt(let step): + switch step { + case .begin: + PixelKit.fire( + NetworkProtectionPixelEvent.networkProtectionTunnelStopAttempt, + frequency: .standard, + includeAppVersionParameter: true) + case .failure(let error): + PixelKit.fire( + NetworkProtectionPixelEvent.networkProtectionTunnelStopFailure(error), + frequency: .dailyAndCount, + includeAppVersionParameter: true) + case .success: + PixelKit.fire( + NetworkProtectionPixelEvent.networkProtectionTunnelStopSuccess, + frequency: .dailyAndCount, + includeAppVersionParameter: true) + } case .tunnelUpdateAttempt(let step): switch step { case .begin: @@ -251,6 +269,24 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { frequency: .dailyAndCount, includeAppVersionParameter: true) } + case .tunnelWakeAttempt(let step): + switch step { + case .begin: + PixelKit.fire( + NetworkProtectionPixelEvent.networkProtectionTunnelWakeAttempt, + frequency: .dailyAndCount, + includeAppVersionParameter: true) + case .failure(let error): + PixelKit.fire( + NetworkProtectionPixelEvent.networkProtectionTunnelWakeFailure(error), + frequency: .dailyAndCount, + includeAppVersionParameter: true) + case .success: + PixelKit.fire( + NetworkProtectionPixelEvent.networkProtectionTunnelWakeSuccess, + frequency: .dailyAndCount, + includeAppVersionParameter: true) + } } } @@ -421,30 +457,6 @@ final class MacPacketTunnelProvider: PacketTunnelProvider { try? loadDefaultPixelHeaders(from: options) } - // MARK: - Start/Stop Tunnel - - override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { - super.stopTunnel(with: reason) { - Task { - completionHandler() - - // From what I'm seeing in my tests the next call to start the tunnel is MUCH - // less likely to fail if we force this extension to exit when the tunnel is killed. - // - // Ref: https://app.asana.com/0/72649045549333/1204668639086684/f - // - exit(EXIT_SUCCESS) - } - } - } - - override func cancelTunnelWithError(_ error: Error?) { - Task { - super.cancelTunnelWithError(error) - exit(EXIT_SUCCESS) - } - } - // MARK: - Pixels private func setupPixels(defaultHeaders: [String: String] = [:]) { diff --git a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacTransparentProxyProvider.swift b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacTransparentProxyProvider.swift index 5d9b0c0fa4..1c4993210e 100644 --- a/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacTransparentProxyProvider.swift +++ b/DuckDuckGo/NetworkProtection/NetworkExtensionTargets/NetworkExtensionTargets/MacTransparentProxyProvider.swift @@ -27,7 +27,7 @@ import PixelKit final class MacTransparentProxyProvider: TransparentProxyProvider { - static var vpnProxyLogger = Logger(subsystem: OSLog.subsystem, category: "VPN Proxy") + static var vpnProxyLogger = Logger(subsystem: Bundle.main.bundleIdentifier ?? "DuckDuckGo", category: "VPN Proxy") private var cancellables = Set() diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 8c8bea9c39..f493ccd18a 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "140.0.2"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "140.0.3"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), ], diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 81a9dca9a3..71c4ddae58 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -31,7 +31,7 @@ let package = Package( .library(name: "NetworkProtectionUI", targets: ["NetworkProtectionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "140.0.2"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "140.0.3"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.1"), .package(path: "../XPCHelper"), .package(path: "../SwiftUIExtensions"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 32884eef9d..dad997f561 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "140.0.2"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "140.0.3"), .package(path: "../SwiftUIExtensions") ], targets: [