Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tunnel manager to not return error for configuration loading #5188

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading