From aa36bebd84181cf9ca0d349373e6d8aa5a7a69d0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 27 Apr 2026 19:04:46 +0300 Subject: [PATCH] Avoid logouts when resetting the caches The SDK is reporting a `Failed to run migrations: locking protocol` but in practice we tear down the session before using said session to access the `clearCaches` method on its client, which is obviously wrong. This patch removes that step and the delay as everything seems to work properly without them. --- ElementX/Sources/Application/AppCoordinator.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 3ca84db64..8ffa8b5b4 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -965,12 +965,9 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg stopSync(isBackgroundTask: false) userSessionFlowCoordinator?.stop() - - tearDownUserSession() // Allow for everything to deallocate properly Task { - try? await Task.sleep(for: .seconds(2)) await userSession.clientProxy.clearCaches() stateMachine.processEvent(.startWithExistingSession) hideLoadingIndicator()