From a2dd538237c3849fca5d70673d19415efee7f50d Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:28:00 +0200 Subject: [PATCH] Fix for missing client store (caused by: #2587) (#2591) --- src/utils/matrix.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/utils/matrix.ts b/src/utils/matrix.ts index c5fbe4d7..d5735e00 100644 --- a/src/utils/matrix.ts +++ b/src/utils/matrix.ts @@ -139,7 +139,25 @@ export async function initClient( client.clearStores(); } + // Start client store. + // Note: The `client.store` is used to store things like sync results. It's independent of + // the cryptostore, and uses a separate indexeddb database. + + // start the client store (totally independent to the crypto store) + try { + await client.store.startup(); + } catch (error) { + logger.error( + "Error starting matrix client indexDB store. Falling back to memory store.", + error, + ); + client.store = new MemoryStore({ localStorage }); + await client.store.startup(); + } + + // Also creates and starts any crypto related stores. await client.initRustCrypto(); + client.setGlobalErrorOnUnknownDevices(false); // Once startClient is called, syncs are run asynchronously. // Also, sync completion is communicated only via events.