Skip to content

Commit 6047d36

Browse files
committed
refactor(event cache): call clear() instead of doing it manually in clear_all_rooms
1 parent 961a893 commit 6047d36

File tree

1 file changed

+1
-9
lines changed
  • crates/matrix-sdk/src/event_cache

1 file changed

+1
-9
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,7 @@ impl EventCacheInner {
640640

641641
let rooms = self.by_room.write().await;
642642
for room in rooms.values() {
643-
// Clear all the room state.
644-
let updates_as_vector_diffs = room.inner.state.write().await.reset().await?;
645-
646-
// Notify all the observers that we've lost track of state. (We ignore the
647-
// error if there aren't any.)
648-
let _ = room.inner.sender.send(RoomEventCacheUpdate::UpdateTimelineEvents {
649-
diffs: updates_as_vector_diffs,
650-
origin: EventsOrigin::Sync,
651-
});
643+
room.clear().await?;
652644
}
653645

654646
Ok(())

0 commit comments

Comments
 (0)