Skip to content

Commit

Permalink
Merge branch 'failed-tunnel-manager-init-should-show-problem-report-v…
Browse files Browse the repository at this point in the history
…iew-ios-297'
  • Loading branch information
buggmagnet committed Sep 25, 2023
2 parents f0bb6f1 + c10006e commit 77b7423
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions ios/MullvadVPN/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ios/MullvadVPN/TunnelManager/TunnelManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -187,7 +187,7 @@ final class TunnelManager: StorePaymentObserver {
self.updatePrivateKeyRotationTimer()
self.startNetworkMonitor()

completionHandler(completion.error)
completionHandler()
}

loadTunnelOperation.addObserver(
Expand Down

0 comments on commit 77b7423

Please sign in to comment.