Skip to content

Commit

Permalink
Fix for missing client store (caused by: #2587) (#2591)
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 authored Aug 30, 2024
1 parent b79a405 commit a2dd538
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/utils/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a2dd538

Please sign in to comment.