mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 07:27:45 -04:00
First off, this patch removes the `RoomInfoNotableUpdate::trigger_room_list_update` field. It is replaced by a `reasons: RoomInfoNotableUpdateReasons` 8-bit unsigned integer. It addresses the following issues: 1. When a subscriber receives a `RoomInfoNotableUpdate`, they have no idea what has triggered this update. 2. In `matrix_sdk_base::sliding_sync::BaseClient::process_sliding_sync_e2ee`, we were triggering an update even if the latest event wasn't modified: it is a false-positive, it was a bug and a waste of resources. Now it's more refined, see the why below. Second, this patch removes the second `trigger_room_list_update` argument of `matrix_sdk_base::BaseClient::apply_changes`. This method now knows where to find the reasons for the room info notable updates, see next point. Third, this patch adds a new `matrix_sdk::StateChanges::room_info_notable_updates` field which is a B-tree map between an `OwnedRoomId` and a `RoomInfoNotableUpdateReasons`. The idea is that all places that receive a `StateChanges` can also create a room info notable update with a specific reason. This is a finer grained mechanism, and it avoids to pass new arguments everywhere. It's cleaner. Finally, it's easier than ever to add a new reason and to propagate it to subscribers.