mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-24 08:36:10 -04:00
8e65099f3d112f6f153bb305cba9ad18ecc6f80e
test_delayed_decryption_latest_event.
This patch rewrites the `test_delayed_decryption_latest_event` test a little bit. It does exactly the same things, but in a simpler way: it removes multiple `sleep` and remove 2 sliding sync loops. First off, the `SyncService` already starts the `RoomListService and the `EncryptionSync` service. Both of them have their own sliding sync loop. The test doesn't need other sliding sync loops in their own tasks, this is not necessary at all: it's just pretty confusing and doesn't reflect the reality, i.e. how these API are supposed to be used. Second, it also tests the room for Bob is seen as encrypted. Third, the `VectorDiff::Reset` is tested before the event from Bob is sent. It's not only for clarity: it makes the test more robust for future modifications. Fourth, instead of waiting with a `sleep` for the event from Bob to be received by Alice, we instead wait on the room list's stream of Alice to receive an update. It's more robust this way and reflects the real usage of this API. It also helps to remove an intermediate `assert_pending!` that is no longer necessary because we are waiting on the stream just after. Finally, just like for the previous modification, this patch removes another `sleep` for the to-device event from Bob to be received by Alice, and instead wait on the room list's stream to receive an update. It's again more robust and reflects the real usage of this API. Plus, it makes the last `assert_pending!` macro to not be flaky.
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%