Files
matrix-rust-sdk/crates/matrix-sdk-sqlite
Ivan Enderlin 2b3c40213b fix(base,sdk): Revisit how a room is forgotten within the Event Cache.
`matrix_sdk_base::Client::forget_room` calls
`EventCacheStore::remove_room` to forget a room. This is wrong for
multiple reasons:

- it hits the store directly without emptying the in-memory data in the
  Event Cache caches (like `RoomEventCache` or `ThreadEventCache`),
- it removes data related to `RoomEventCache` only: it misses
  `ThreadEventCache`s.

This patch removes the default implementation for
`EventCacheStore::remove_room`. It removes the method entirely from the
trait. Instead, it improves `EventCacheStore::clear_all_events` to add
an optional `RoomId`.

Then, this patch adds `EventCache::forget_room` which reuses the
`event_cache::states::StateLock::clear_and_reload` method, with the
addition of the optional `RoomId`.
2026-07-22 15:38:53 +02:00
..
2024-10-10 14:32:46 +02:00