Benjamin Bouvier f3f37a33fd fix(event cache): override reached_start when there's a mismatch between network and disk
It could be that we have a mismatch between network and disk, after
running a back-pagination:

- network indicates start of the timeline, aka there's no previous-batch
token
- but in the persisted storage, we do have an initial empty events chunk

Because of this, we could have weird transitions from "I've reached the
start of the room" to "I haven't actually reached it", if calling the
`run_backwards()` method manually.

This patch rewrites the logic when returning `reached_start`, so that
it's more precise:

- when reloading an events chunk from disk, rely on the previous chunk
property to indicate whether we've reached the start of the timeline,
thus avoiding unnecessary calls to back-paginations.
- after resolving a gap via the network, override the result of
`reached_start` with a boolean that indicates 1. there are no more gaps
and 2. there's no previous chunk (actual previous or lazily-loaded).

In the future, we should consider NOT having empty events chunks, if we
can.
2025-02-24 14:47:21 +01:00
2024-08-21 09:41:54 +01:00
2024-10-10 14:32:46 +02:00
2025-02-21 09:36:50 +01:00
2022-08-01 14:33:05 +02:00
2023-09-05 15:40:38 +02:00
2025-01-24 11:20:20 +01: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.

Status

The library is considered production ready and backs multiple client implementations such as Element X [1] [2] and Fractal. Client developers should feel confident to build upon it.

Development of the SDK has been primarily sponsored by Element though accepts contributions from all.

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 147 MiB
Languages
Rust 99.7%
HTML 0.2%