From f135c0a622f05b0eeb4b7ad1f5d28cc7715cba31 Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 11 Sep 2025 12:05:01 +0100 Subject: [PATCH] Await user session migrations rather than launching a task. (#4502) Fixes a bug where they would be run *after* startSync had been called, and expiring the sessions stopped the sync. --- ElementX/Sources/Application/AppCoordinator.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index e8173ad13..d2c5fe230 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -38,7 +38,6 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg configureNotificationManager() observeUserSessionChanges() startSync() - Task { await performUserSessionMigrations(userSession) } Task { await appHooks.configure(with: userSession) } } } @@ -568,6 +567,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg Task { switch await userSessionStore.restoreUserSession() { case .success(let userSession): + await self.performUserSessionMigrations(userSession) self.userSession = userSession stateMachine.processEvent(.createdUserSession) case .failure: