Skip to content

Commit

Permalink
Remove an unnecessary step when stopping the tunnel (#1102)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1207603085593419/1208865941226621/f

iOS PR: duckduckgo/iOS#3639
macOS PR: duckduckgo/macos-browser#3608

What kind of version bump will this require?: Patch

## Description

Removes a duplicated step from the tunnel stop logic that was causing
some trouble in the logs.
  • Loading branch information
diegoreymendez authored Nov 28, 2024
1 parent a3d5a2f commit db9c29a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Sources/NetworkProtection/PacketTunnelProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
@MainActor
private func stopTunnel() async throws {
connectionStatus = .disconnecting

await stopMonitors()
try await stopAdapter()
}
Expand All @@ -895,10 +896,6 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
private func stopAdapter() async throws {
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, Error>) in
adapter.stop { [weak self] error in
if let self {
self.handleAdapterStopped()
}

if let error {
self?.debugEvents.fire(error.networkProtectionError)

Expand Down Expand Up @@ -1420,11 +1417,6 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
try await startMonitors(testImmediately: testImmediately)
}

@MainActor
public func handleAdapterStopped() {
connectionStatus = .disconnected
}

// MARK: - Monitors

private func startTunnelFailureMonitor() async {
Expand Down

0 comments on commit db9c29a

Please sign in to comment.