feat(client): initialize all stores in indexeddb store config

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
This commit is contained in:
Michael Goldenberg
2025-12-10 22:18:35 -05:00
committed by Ivan Enderlin
parent 6bf121b58e
commit aa5497e385
2 changed files with 12 additions and 22 deletions

View File

@@ -41,7 +41,11 @@ sqlite = [
"matrix-sdk-sqlite?/event-cache",
]
bundled-sqlite = ["sqlite", "matrix-sdk-sqlite?/bundled"]
indexeddb = ["matrix-sdk-indexeddb/state-store"]
indexeddb = [
"matrix-sdk-indexeddb/state-store",
"matrix-sdk-indexeddb/event-cache-store",
"matrix-sdk-indexeddb/media-store"
]
qrcode = ["e2e-encryption", "matrix-sdk-base/qrcode"]
automatic-room-key-forwarding = ["e2e-encryption", "matrix-sdk-base/automatic-room-key-forwarding"]

View File

@@ -706,28 +706,14 @@ async fn build_indexeddb_store_config(
) -> Result<StoreConfig, ClientBuildError> {
let cross_process_store_locks_holder_name = cross_process_store_locks_holder_name.to_owned();
let stores = matrix_sdk_indexeddb::IndexeddbStores::open(name, passphrase).await?;
let store_config = StoreConfig::new(cross_process_store_locks_holder_name)
.state_store(stores.state)
.event_cache_store(stores.event_cache)
.media_store(stores.media);
#[cfg(feature = "e2e-encryption")]
let store_config = {
let (state_store, crypto_store) =
matrix_sdk_indexeddb::open_stores_with_name(name, passphrase).await?;
StoreConfig::new(cross_process_store_locks_holder_name)
.state_store(state_store)
.crypto_store(crypto_store)
};
#[cfg(not(feature = "e2e-encryption"))]
let store_config = {
let state_store = matrix_sdk_indexeddb::open_state_store(name, passphrase).await?;
StoreConfig::new(cross_process_store_locks_holder_name).state_store(state_store)
};
let store_config = {
tracing::warn!(
"The IndexedDB backend does not implement an event cache store, \
falling back to the in-memory event cache store…"
);
store_config.event_cache_store(matrix_sdk_base::event_cache::store::MemoryStore::new())
};
let store_config = store_config.crypto_store(stores.crypto);
Ok(store_config)
}