mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-15 19:45:34 -04:00
9bae0396294042573cec90cd72a1c4e3a9cae77c
SlidingSyncList::update_room_list handles updates for out of list rooms.
So. `SlidingSyncList::update_room_list()` does the following: 1. It adjust room list entries, 2. It updates the `maximum_number_of_rooms`, 3. It applies the sync operations on the `room_list` entries, 4. It updates the `room_list` entries for rooms outside the sync operations. SlidingSync answers with a `lists` and `rooms`. The `room_list` entries is updated as follows: either a sync operation from `lists` has been applied and the entries are updated, or `rooms` contains rooms that are not updated by `lists` but that receive new events, and thus must trigger an update in the `room_list` entries. This patch changes a little bit the last part of this. Initially, we were updating rooms that are part of `rooms` but absent of `lists` sync operations, only **for the current list's ranges**. But that's wrong! First, we have noticed a bug here: the correct code wasn't `skip(start).take(end.saturating_add(1))` but `skip(start).take(end.saturating_add(1) - start)`. Note a big deal, we were iterating on more entries like it was necessary, but everything was filtered later, so no bug, just useless computations. Second, this `skip` and `take` is actually… useless. A room to which we have subscribed can be out of any range, but we still want `room_list` entries to receive an update for that particular room. This patch fixes that once and for all. In practise, the bug wasn't happening because if someone subscribes to a room, its timeline is likely to be fetched, and updates will be received, but still, this is better now from a SlidingSync strict point of view.
matrix-rust-sdk
matrix-rust-sdk is an implementation of a Matrix client-server library in Rust.
Project structure
The rust-sdk consists of multiple crates that can be picked at your convenience:
- matrix-sdk - High level client library, with batteries included, you're most likely interested in this.
- matrix-sdk-base - No (network) IO client state machine that can be used to embed a Matrix client in your project or build a full fledged network enabled client lib on top of it.
- matrix-sdk-crypto - No (network) IO encryption state machine that can be used to add Matrix E2EE support to your client or client library.
Minimum Supported Rust Version (MSRV)
These crates are built with the Rust language version 2021 and require a minimum compiler version of 1.70.
Status
The library is in an alpha state, things that are implemented generally work but the API will change in breaking ways.
If you are interested in using the matrix-sdk now is the time to try it out and provide feedback.
Bindings
Some crates of the matrix-rust-sdk can be embedded inside other
environments, like Swift, Kotlin, JavaScript, Node.js etc. Please,
explore the bindings/ directory to learn more.
License
Description
Languages
Rust
99.7%
HTML
0.2%