Skip to content

Commit 1a63d8f

Browse files
committed
task(event cache): ignore add_initial_events() when the event cache storage has been enabled
Not worth testing IMO, since this is about the "temporary" API we're going to remove in subsequent patches.
1 parent 5bf3b11 commit 1a63d8f

File tree

1 file changed

+5
-0
lines changed
  • crates/matrix-sdk/src/event_cache

1 file changed

+5
-0
lines changed

crates/matrix-sdk/src/event_cache/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ impl EventCache {
312312
events: Vec<SyncTimelineEvent>,
313313
prev_batch: Option<String>,
314314
) -> Result<()> {
315+
// If the event cache's storage has been enabled, do nothing.
316+
if self.inner.store.get().is_some() {
317+
return Ok(());
318+
}
319+
315320
let room_cache = self.inner.for_room(room_id).await?;
316321

317322
// We could have received events during a previous sync; remove them all, since

0 commit comments

Comments
 (0)