Skip to content

Commit

Permalink
Rolls back BSK changes
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Mar 8, 2024
1 parent 025c9c9 commit 02dcaf7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 0 additions & 2 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3858,7 +3858,6 @@
7B8DB3192B504D7500EC16DA /* VPNAppEventsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNAppEventsHandler.swift; sourceTree = "<group>"; };
7B934C3D2A866CFF00FC8F9C /* NetworkProtectionOnboardingMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionOnboardingMenu.swift; sourceTree = "<group>"; };
7B934C402A866DD400FC8F9C /* UserDefaults+NetworkProtectionShared.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UserDefaults+NetworkProtectionShared.swift"; sourceTree = "<group>"; };
7B98CB8A2B9ADBCA000416E0 /* BrowserServicesKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = BrowserServicesKit; path = ../../BrowserServicesKit; sourceTree = "<group>"; };
7BA7CC0B2AD11D1E0042E5CE /* DuckDuckGoVPNAppStore.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DuckDuckGoVPNAppStore.xcconfig; sourceTree = "<group>"; };
7BA7CC0C2AD11D1E0042E5CE /* DuckDuckGoVPN.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DuckDuckGoVPN.xcconfig; sourceTree = "<group>"; };
7BA7CC0E2AD11DC80042E5CE /* DuckDuckGoVPNAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DuckDuckGoVPNAppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5204,7 +5203,6 @@
378E279C2970217400FCADA2 /* LocalPackages */ = {
isa = PBXGroup;
children = (
7B98CB8A2B9ADBCA000416E0 /* BrowserServicesKit */,
378E279D2970217400FCADA2 /* BuildToolPlugins */,
3192A2702A4C4E330084EA89 /* DataBrokerProtection */,
9DB6E7222AA0DA7A00A17F3C /* LoginItems */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
"version" : "3.0.0"
}
},
{
"identity" : "browserserviceskit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "a32ff4084e910354bdd948812793de6b04804a1b",
"version" : "119.0.1"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -156,7 +165,7 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"state" : {
"revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff",
"version" : "1.2.2"
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGoVPN/TunnelControllerIPCService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Foundation
import NetworkProtection
import NetworkProtectionIPC
import NetworkProtectionUI
import os.log // swiftlint:disable:next os_log

Check failure on line 25 in DuckDuckGoVPN/TunnelControllerIPCService.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

'os_log' is not a valid SwiftLint rule; remove it from the disable command (superfluous_disable_command)
/// Takes care of handling incoming IPC requests from clients that need to be relayed to the tunnel, and handling state
/// changes that need to be relayed back to IPC clients.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ public final class TunnelControllerIPCClient {
serverInterface: serverInterface)

xpc.delegate = xpcDelegate
xpc.onDisconnect = { [weak self] in
guard let self else { return }

// By calling register we make sure that XPC will connect as soon as it
// becomes available again, as requests are queued. This helps ensure
// that the client app will always be connected to XPC.
self.register()
}
}
}

Expand Down Expand Up @@ -116,7 +124,6 @@ private final class TunnelControllerXPCClientDelegate: XPCClientInterface {
connectionStatusObserver.publish(status)
clientDelegate?.statusChanged(status)
}

}

// MARK: - Outgoing communication to the server
Expand Down
2 changes: 2 additions & 0 deletions LocalPackages/XPCHelper/Sources/XPCHelper/XPCClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public final class XPCClient<ClientInterface: AnyObject, ServerInterface: AnyObj
private let machServiceName: String
private let clientInterface: NSXPCInterface
private let serverInterface: NSXPCInterface
public var onDisconnect: (() -> Void)?

/// The internal connection, which may still not have been created.
///
Expand Down Expand Up @@ -98,6 +99,7 @@ public final class XPCClient<ClientInterface: AnyObject, ServerInterface: AnyObj
Task { @XPCConnectionActor in
self.internalConnection?.invalidate()
self.internalConnection = nil
self.onDisconnect?()
}
}

Expand Down

0 comments on commit 02dcaf7

Please sign in to comment.