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.
This commit is contained in:
Doug
2025-09-11 12:05:01 +01:00
committed by GitHub
parent e2bd3edee7
commit f135c0a622

View File

@@ -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: