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

Prevents app updates from stopping the VPN. #3608

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15263,7 +15263,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 212.1.0;
version = 212.1.1;
};
};
9FF521422BAA8FF300B9819B /* 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" : "a3d5a2fc45ce000515b04666aa2fa7ad2d30e288",
"version" : "212.1.0"
"revision" : "db9c29a429896138fab29da987981a5f4a8d6712",
"version" : "212.1.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,16 +665,23 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
///
@MainActor
func stop() async {
await stop(disableOnDemand: true)
}

@MainActor
func stop(disableOnDemand: Bool) async {
guard let manager = await manager else {
return
}

await stop(tunnelManager: manager)
await stop(tunnelManager: manager, disableOnDemand: disableOnDemand)
}

@MainActor
private func stop(tunnelManager: NETunnelProviderManager) async {
try? await self.disableOnDemand(tunnelManager: tunnelManager)
private func stop(tunnelManager: NETunnelProviderManager, disableOnDemand: Bool) async {
if disableOnDemand {
try? await self.disableOnDemand(tunnelManager: tunnelManager)
}

switch tunnelManager.connection.status {
case .connected, .connecting, .reasserting:
Expand All @@ -692,15 +699,7 @@ final class NetworkProtectionTunnelController: TunnelController, TunnelSessionPr
///
@MainActor
func restart() async {
guard let manager = await manager else {
return
}

await stop(tunnelManager: manager)
await start()

// When restarting the tunnel we enable on-demand optimistically
try? await enableOnDemand(tunnelManager: manager)
await stop(disableOnDemand: false)
}

// MARK: - On Demand & Kill Switch
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: "212.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.1"),
.package(path: "../SwiftUIExtensions"),
.package(path: "../AppKitExtensions"),
.package(path: "../XPCHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/FeatureFlags/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
targets: ["FeatureFlags"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.1"),
],
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/NetworkProtectionMac/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let package = Package(
.library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.1"),
.package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"),
.package(path: "../AppLauncher"),
.package(path: "../UDSHelper"),
Expand Down
2 changes: 1 addition & 1 deletion LocalPackages/SubscriptionUI/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
targets: ["SubscriptionUI"]),
],
dependencies: [
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.0"),
.package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "212.1.1"),
.package(path: "../SwiftUIExtensions")
],
targets: [
Expand Down
Loading