From 22b00673a413c408e679a3100e358067419638b4 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Fri, 25 Jul 2025 15:36:10 +0100 Subject: [PATCH] `Lifecycle`: add a bit more logging ... to see what exactly it thinks is wrong with the session This may be useful in debugging https://github.com/element-hq/element-web/issues/30337 and https://github.com/element-hq/element-web/issues/29708. but will likely be useful in any case. --- src/Lifecycle.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 20e74355998..dcd4ae9c004 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -621,6 +621,9 @@ export async function restoreSessionFromStorage(opts?: { ignoreGuest?: boolean } await getStoredSessionVars(); if (hasAccessToken && !accessToken) { + logger.warn( + "restoreSessionFromStorage: storage indicates we should have an access token, but we do not. Displaying StorageEvictedDialog", + ); await abortLogin(); } @@ -823,6 +826,7 @@ async function doSetLoggedIn( // crypto store, we'll be generally confused when handling encrypted data. // Show a modal recommending a full reset of storage. if (results.dataInLocalStorage && results.cryptoInited && !results.dataInCryptoStore) { + logger.warn("doSetLoggedIn: StorageManager consistency check failed; displaying StorageEvictedDialog."); await abortLogin(); }