WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a836b72

Browse files
committed
change(notification_client): use cross process locking event and media stores instead of in-memory ones
This will allow the NSE process to populate the event cache store with even data after retrieving it from sync, as opposed to dropping after rendering the notification it as it did previously.
1 parent ce65317 commit a836b72

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

crates/matrix-sdk-base/src/client.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,16 @@ impl BaseClient {
221221
cross_process_store_locks_holder_name: &str,
222222
handle_verification_events: bool,
223223
) -> Result<Self> {
224-
let config = StoreConfig::new(cross_process_store_locks_holder_name.to_owned())
225-
.state_store(MemoryStore::new());
226-
let config = config.crypto_store(self.crypto_store.clone());
224+
let in_memory_store_config =
225+
StoreConfig::new(cross_process_store_locks_holder_name.to_owned())
226+
.state_store(MemoryStore::new())
227+
.crypto_store(self.crypto_store.clone());
227228

228229
let copy = Self {
229-
state_store: BaseStateStore::new(config.state_store),
230-
event_cache_store: config.event_cache_store,
231-
media_store: config.media_store,
230+
state_store: BaseStateStore::new(in_memory_store_config.state_store),
231+
// The event and media stores both have cross process locking support.
232+
event_cache_store: self.event_cache_store.clone(),
233+
media_store: self.media_store.clone(),
232234
// We copy the crypto store as well as the `OlmMachine` for two reasons:
233235
// 1. The `self.crypto_store` is the same as the one used inside the `OlmMachine`.
234236
// 2. We need to ensure that the parent and child use the same data and caches inside

0 commit comments

Comments
 (0)