mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-07-30 17:36:27 -04:00
`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`.
The file is empty.