Skip to content

Commit

Permalink
task(event cache): ignore add_initial_events() when the event cache…
Browse files Browse the repository at this point in the history
… storage has been enabled

Not worth testing IMO, since this is about the "temporary" API we're
going to remove in subsequent patches.
  • Loading branch information
bnjbvr committed Dec 3, 2024
1 parent 637be82 commit 247f4bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/matrix-sdk/src/event_cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ impl EventCache {
events: Vec<SyncTimelineEvent>,
prev_batch: Option<String>,
) -> Result<()> {
// If the event cache's storage has been enabled, do nothing.
if self.inner.store.get().is_some() {
return Ok(());
}

let room_cache = self.inner.for_room(room_id).await?;

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

0 comments on commit 247f4bc

Please sign in to comment.