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 99423bc437
commit 2ed5e3b16e
@@ -38,7 +38,6 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
configureNotificationManager() configureNotificationManager()
observeUserSessionChanges() observeUserSessionChanges()
startSync() startSync()
Task { await performUserSessionMigrations(userSession) }
Task { await appHooks.configure(with: userSession) } Task { await appHooks.configure(with: userSession) }
} }
} }
@@ -568,6 +567,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
Task { Task {
switch await userSessionStore.restoreUserSession() { switch await userSessionStore.restoreUserSession() {
case .success(let userSession): case .success(let userSession):
await self.performUserSessionMigrations(userSession)
self.userSession = userSession self.userSession = userSession
stateMachine.processEvent(.createdUserSession) stateMachine.processEvent(.createdUserSession)
case .failure: case .failure: