diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2023-09-22 15:56:06 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2023-09-25 15:12:18 +0200 |
| commit | c10006ebe4182ade8a7547bd64fc29dd921966d4 (patch) | |
| tree | ac351cbf0164a867bead59cfcad8f0f040c5b993 /ios | |
| parent | f0bb6f1052d0f4bdd60f087906b62e9e083f584c (diff) | |
| download | mullvadvpn-c10006ebe4182ade8a7547bd64fc29dd921966d4.tar.xz mullvadvpn-c10006ebe4182ade8a7547bd64fc29dd921966d4.zip | |
Update tunnel manager to not return error for configuration loading
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/AppDelegate.swift | 9 | ||||
| -rw-r--r-- | ios/MullvadVPN/TunnelManager/TunnelManager.swift | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/ios/MullvadVPN/AppDelegate.swift b/ios/MullvadVPN/AppDelegate.swift index 5bd73b1d52..4bbbff6657 100644 --- a/ios/MullvadVPN/AppDelegate.swift +++ b/ios/MullvadVPN/AppDelegate.swift @@ -434,12 +434,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } private func getInitTunnelManagerOperation() -> AsyncBlockOperation { + // This operation is always treated as successful no matter what the configuration load yields. + // If the tunnel settings or device state can't be read, we simply pretend they are not there + // and leave user in logged out state. VPN config will be removed as well. AsyncBlockOperation(dispatchQueue: .main) { finish in - self.tunnelManager.loadConfiguration { error in - if let error { - fatalError(error.localizedDescription) - } - + self.tunnelManager.loadConfiguration { self.logger.debug("Finished initialization.") NotificationManager.shared.updateNotifications() diff --git a/ios/MullvadVPN/TunnelManager/TunnelManager.swift b/ios/MullvadVPN/TunnelManager/TunnelManager.swift index 40ae1a1160..260a2edd7e 100644 --- a/ios/MullvadVPN/TunnelManager/TunnelManager.swift +++ b/ios/MullvadVPN/TunnelManager/TunnelManager.swift @@ -168,7 +168,7 @@ final class TunnelManager: StorePaymentObserver { // MARK: - Public methods - func loadConfiguration(completionHandler: @escaping (Error?) -> Void) { + func loadConfiguration(completionHandler: @escaping () -> Void) { let loadTunnelOperation = LoadTunnelConfigurationOperation( dispatchQueue: internalQueue, interactor: TunnelInteractorProxy(self) @@ -187,7 +187,7 @@ final class TunnelManager: StorePaymentObserver { self.updatePrivateKeyRotationTimer() self.startNetworkMonitor() - completionHandler(completion.error) + completionHandler() } loadTunnelOperation.addObserver( |
