Ivan Enderlin 9bae039629 fix(sdk): Change how 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.
2023-06-29 11:21:31 +02:00
2023-02-02 10:15:05 +01:00
2023-06-14 12:31:32 +02:00
2023-06-15 15:20:46 +02:00
2022-08-01 14:33:05 +02:00
2023-06-14 12:31:32 +02:00
2023-06-01 12:06:35 +02:00
2022-12-05 14:58:33 +01:00
2023-03-30 18:03:38 +02:00
2023-06-14 12:31:32 +02:00

Build Status codecov License #matrix-rust-sdk Docs - Main Docs - Stable

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

Apache-2.0

Description
No description provided
Readme 146 MiB
Languages
Rust 99.7%
HTML 0.2%