diff --git a/firefox-ios/Client/Application/SceneDelegate.swift b/firefox-ios/Client/Application/SceneDelegate.swift index c3777056600d..ec4653db4d4c 100644 --- a/firefox-ios/Client/Application/SceneDelegate.swift +++ b/firefox-ios/Client/Application/SceneDelegate.swift @@ -227,7 +227,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { logger.log("Scene coordinator will handle a route", level: .info, category: .coordinator) sessionManager.launchSessionProvider.openedFromExternalSource = true - AppEventQueue.wait(for: [.startupFlowComplete, .tabRestoration(sceneCoordinator.windowUUID)]) { + AppEventQueue.wait(for: [.startupFlowComplete, .tabRestoration(sceneCoordinator.windowUUID)]) { [weak self] in + self?.logger.log("Start up flow and restoration done, will handle route", + level: .info, + category: .coordinator) sceneCoordinator.findAndHandle(route: route) } } diff --git a/firefox-ios/Client/Coordinators/BaseCoordinator.swift b/firefox-ios/Client/Coordinators/BaseCoordinator.swift index 2287fab4e085..813423d47c35 100644 --- a/firefox-ios/Client/Coordinators/BaseCoordinator.swift +++ b/firefox-ios/Client/Coordinators/BaseCoordinator.swift @@ -52,6 +52,7 @@ open class BaseCoordinator: NSObject, Coordinator { for child in matchingCoordinator.childCoordinators { guard child.isDismissable else { continue } + logger.log("Dismissing child of the matching coordinator", level: .debug, category: .coordinator) matchingCoordinator.router.dismiss() matchingCoordinator.remove(child: child) } @@ -64,6 +65,7 @@ open class BaseCoordinator: NSObject, Coordinator { func find(route: Route) -> Coordinator? { // Check if the current coordinator can handle the route. if canHandle(route: route) { + logger.log("Can handle the route with \(self)", level: .debug, category: .coordinator) savedRoute = nil return self } @@ -73,13 +75,16 @@ open class BaseCoordinator: NSObject, Coordinator { if let matchingCoordinator = childCoordinator.find(route: route) { savedRoute = nil + logger.log("Can handle route with child coordinator \(matchingCoordinator)", + level: .debug, + category: .coordinator) return matchingCoordinator } } // If no matching coordinator is found, return nil and save the Route to be passed along when it next navigates savedRoute = route - logger.log("Saved a route", level: .info, category: .coordinator) + logger.log("No coordinator found, saved a route", level: .info, category: .coordinator) return nil } }