diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Managers/TunnelManager.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Managers/TunnelManager.swift index 248280310..b9c1bdb20 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Managers/TunnelManager.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Managers/TunnelManager.swift @@ -124,7 +124,7 @@ public class TunnelManager { private let bundleDescription = "Firezone" // Initialize and save a new VPN profile in system Preferences - func create() async throws -> Settings { + func create() async throws { let protocolConfiguration = NETunnelProviderProtocol() let manager = NETunnelProviderManager() let settings = Settings.defaultValue @@ -144,8 +144,6 @@ public class TunnelManager { await statusChangeHandler?(manager.connection.status) self.manager = manager - - return settings } func load(callback: @escaping (NEVPNStatus, Settings?, String?) -> Void) { diff --git a/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift b/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift index 2d2228ba4..97a812086 100644 --- a/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift +++ b/swift/apple/FirezoneKit/Sources/FirezoneKit/Stores/Store.swift @@ -40,7 +40,7 @@ public final class Store: ObservableObject { self.sessionNotification = SessionNotification() initNotifications() - initTunnelManager() + loadTunnelManager() } public func internetResourceEnabled() -> Bool { @@ -62,7 +62,7 @@ public final class Store: ObservableObject { .store(in: &cancellables) } - private func initTunnelManager() { + private func loadTunnelManager() { // Subscribe to status updates from the tunnel manager TunnelManager.shared.statusChangeHandler = handleVPNStatusChange @@ -94,9 +94,14 @@ public final class Store: ObservableObject { } func createVPNProfile() { - DispatchQueue.main.async { - Task { - self.settings = try await TunnelManager.shared.create() + Task { + try await TunnelManager.shared.create() + + DispatchQueue.main.async { [weak self] in + guard let self else { return } + + // Load the new settings and bind observers + self.loadTunnelManager() } } } diff --git a/website/src/components/Changelog/Apple.tsx b/website/src/components/Changelog/Apple.tsx index caef3da3e..d288d02b3 100644 --- a/website/src/components/Changelog/Apple.tsx +++ b/website/src/components/Changelog/Apple.tsx @@ -12,6 +12,10 @@ export default function Apple() { > {/* When you cut a release, remove any solved issues from the "known issues" lists over in `client-apps`. This must not be done when the issue's PR merges. */} + + Fixes a bug where the VPN status would not properly update upon the + first launch of the app. + Fixes an issue where symmetric NATs would generate unnecessary candidate for hole-punching.