Commit Graph

14365 Commits

Author SHA1 Message Date
Benjamin Bouvier 80920e9ff2 refactor(common): use ruma's RelationType in the extractor functions 2026-02-05 16:43:25 +01:00
Benjamin Bouvier 071f982eed fix(event cache): don't include thread responses in the pinned event cache
There were two issues:

- first, `load_or_fetch_event_with_relations()` allowed to pass a
filter, but the filter wasn't taken into account when fetching relations
from the network. This would cause the initial load of pinned events to
also include thread responses, which we don't want.
- similarly, when adding related events from sync, we'd only look if an
event had a `m.relates_to` field; but it could be a thread response
being added in live.

The two issues are fixed similarly, by using a new `extract_relation`
serde helper that gives both the related_to event and the relation type.
That way, we can apply a manual filter in
`load_or_fetch_event_with_relations` after fetching relations from
network, and we can filter out live events based on the relation type.
2026-02-05 16:43:25 +01:00
Benjamin Bouvier 4aff3b566f refactor(event cache): use the background job monitoring for the pinned events task 2026-02-05 16:43:25 +01:00
Benjamin Bouvier eb8bd2d0b1 refactor(event cache): address review comments from 6085 2026-02-05 16:43:25 +01:00
Benjamin Bouvier 59fd7530f9 test(event cache): declare victory \o/ 2026-02-05 16:43:25 +01:00
Benjamin Bouvier 5778685352 feat(event cache): reload the pinned event cache at startup \o/ 2026-02-05 16:43:25 +01:00
Benjamin Bouvier d3742d2b30 feat(event cache): add support for redecryption in the pinned event cache 2026-02-05 16:43:25 +01:00
Benjamin Bouvier fcf0b87489 chore: address typos and cosmetic changes in an integration test 2026-02-05 16:43:25 +01:00
Benjamin Bouvier d7ecbc3c83 refactor(event cache): use the Room::load_or_fetch_events_with_relations now that it's widely available 2026-02-05 16:43:25 +01:00
Benjamin Bouvier f2279cd737 refactor(timeline): move load_event_with_relations to the RoomDataProvider trait
And get rid of the `PinnedEventsRoom` trait, and the accompanying file.
2026-02-05 16:43:25 +01:00
Benjamin Bouvier da5ac9e3e6 refactor(event cache): using proper locking for the pinned event cache 2026-02-05 16:43:25 +01:00
Benjamin Bouvier ca027f7eb6 feat(event cache): add a global EventCacheConfig struct to globally configure the event cache 2026-02-05 16:43:25 +01:00
Benjamin Bouvier 17840e52f5 refactor(timeline): start removing unused stuff in the timeline code
Now that this logic has moved to the event cache, it's not required in
the timeline anymore.
2026-02-05 16:43:25 +01:00
Benjamin Bouvier 2904735786 feat(timeline): subscribe to the pinned event cache from the timeline 2026-02-05 16:43:25 +01:00
Benjamin Bouvier 790a410474 feat(event cache): add a cache for a room's pinned events 2026-02-05 16:43:25 +01:00
Benjamin Bouvier 01bd672d05 feat(linked chunk): add a new ID for the pinned events linked chunk 2026-02-05 16:43:25 +01:00
Kévin Commaille 9ad7cf9662 refactor(base): Use PossiblyRedactedStateEventContent bound in MinimalStateEvent
We usually don't care if the event was redacted or not, we usually want
to no whether a field is set or not, so we don't need `Original` and
`Redacted` variants.

This simplifies several parts of the code since we don't have to handle
the intermediate enum to access the content now. Due to new APIs in
Ruma we can also just convert original and redacted event contents to
possibly redacted event contents.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-02-05 11:46:05 +01:00
Ivan Enderlin 8f156cbba8 feat(xtask): Display timeout in the duration graph of log sync.
This patch displays the timeout in the duration graph of `log sync`:

```
xxxxxxxxxuuuuu
```

where `x` represents the timeout, and `u` the duration.
2026-02-05 10:58:39 +01:00
Ivan Enderlin ae9fe44a7c feat(xtask): Add <time> in log sync reports.
This patch adds `<time>` around the values in the Time Column.
2026-02-05 10:58:39 +01:00
Ivan Enderlin edbddbdb55 feat(xtask): Display pos and timeout for sync report.
This patch updates the `cargo xtask log sync` command to extract the
`pos` and `timeout` fields so that we can display them. The `timeout`
is displayed in its own column, while the `pos` is displayed in the
line summary.
2026-02-05 10:58:39 +01:00
Ivan Enderlin 2ff33cd354 Merge pull request #6061 from mgoldenberg/consolidate-event-cache-store-tests
Consolidate integration tests for `EventCacheStore`
2026-02-05 09:20:04 +01:00
Ivan Enderlin 7675d22676 chore: Adjust uniffi features. 2026-02-05 09:02:29 +01:00
Ivan Enderlin af11c34399 chore: Adjust rand features. 2026-02-05 09:02:29 +01:00
Ivan Enderlin f51809d524 chore: Add default-features = false to more deps. 2026-02-05 09:02:29 +01:00
Ivan Enderlin 3ff9b55077 chore: Add more default-features = false to more deps. 2026-02-05 09:02:29 +01:00
Ivan Enderlin a35770b5d2 chore(crypto): Remove the indoc dep.
`indoc` is used once to declare a string, but it's easily doable with
pure Rust without too much boilerplate. Let's remove one macro dep.
2026-02-05 09:02:29 +01:00
Ivan Enderlin eb8b2c81f2 chore: Add more default-features to more deps. 2026-02-05 09:02:29 +01:00
Ivan Enderlin 034c1fcbcf chore: Disable default-features for decancer. 2026-02-05 09:02:29 +01:00
Ivan Enderlin f56f168b99 chore: Add more default-features = false to more deps. 2026-02-05 09:02:29 +01:00
Ivan Enderlin 386c5ee338 chore: Update camino to 1.2.2. 2026-02-05 09:02:29 +01:00
Ivan Enderlin 1b0b6a2f9a chore: Use the same version of quote, proc-macro2 and syn everywhere. 2026-02-05 09:02:29 +01:00
Ivan Enderlin d52d0d4a83 chore: xtask uses the workspace-defined clap.
Not only it uses the same version of `clap` everywhere, but it removes
7 dependencies.
2026-02-05 09:02:29 +01:00
Ivan Enderlin dc680b8594 chore: benchmarks uses the workspace-defined tokio. 2026-02-05 09:02:29 +01:00
Ivan Enderlin 44c2c01642 chore: Use default-features = false for all dependencies.
This patch adds `default-features = false` to all dependencies to avoid
fetching useless dependencies by default.

Numbers:

- `cargo check --workspace --tests` jumpbs from 725 to 715,
- `cargo tree --all-features --edges all --prefix none | rg -v '^$' |
  cut -d' ' -f 1 | sort | uniq | wc -l` jumps from 538 to 529.
2026-02-05 09:02:29 +01:00
Hugh Nimmo-Smith 7708087019 doc: clarify that IO_ELEMENT_MSC4388 is the unstable prefix 2026-02-04 20:45:00 +01:00
Ivan Enderlin 52014dc0bb chore(sdk): Log the pos and the timeout as part of the sync_once span.
This patch adds the `pos` and `timeout` value as new fields of the
`sync_once` span.

How to test it?

```sh
$ cargo nextest run --retries 0 --no-fail-fast -E "not test(ensure_no_max_concurrent)" -p matrix-sdk-ui --nocapture -- test_sync_all_states | rg sync_once
2026-02-04T14:02:17.043301Z DEBUG sync_once{conn_id="room-list" pos="0" timeout=0}:send{request_id="REQ-3" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="647B" status=200 response_size="72B" request_duration=316.959µs}: matrix_sdk::http_client: Got response
2026-02-04T14:02:17.043783Z DEBUG sync_once{conn_id="room-list" pos="1" timeout=0}:send{request_id="REQ-4" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="648B"}: matrix_sdk::http_client::native: Sending request num_attempt=1
2026-02-04T14:02:17.044093Z DEBUG sync_once{conn_id="room-list" pos="1" timeout=0}:send{request_id="REQ-4" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="648B" status=200 response_size="72B" request_duration=283.75µs}: matrix_sdk::http_client: Got response
2026-02-04T14:02:17.044527Z DEBUG sync_once{conn_id="room-list" pos="2" timeout=0}:send{request_id="REQ-5" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="648B"}: matrix_sdk::http_client::native: Sending request num_attempt=1
2026-02-04T14:02:17.044808Z DEBUG sync_once{conn_id="room-list" pos="2" timeout=0}:send{request_id="REQ-5" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="648B" status=200 response_size="72B" request_duration=254.875µs}: matrix_sdk::http_client: Got response
2026-02-04T14:02:17.045245Z DEBUG sync_once{conn_id="room-list" pos="3" timeout=30000}:send{request_id="REQ-6" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="648B"}: matrix_sdk::http_client::native: Sending request num_attempt=1
2026-02-04T14:02:17.045517Z DEBUG sync_once{conn_id="room-list" pos="3" timeout=30000}:send{request_id="REQ-6" method=POST uri="http://127.0.0.1:49663/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="648B" status=200 response_size="72B" request_duration=247.417µs}: matrix_sdk::http_client: Got response
```
2026-02-04 16:24:37 +01:00
Benjamin Bouvier f3b9a01904 refactor(event cache): rename the read_lock_acquisition mutex 2026-02-04 16:24:23 +01:00
Benjamin Bouvier 2fb5a32db2 refactor(event cache): rename RoomEventCacheStateLockInner to RoomEventCacheState
There was nothing called `RoomEventCacheState` anymore, and the `Inner`
suffix is dubious, at best. Also, we can get rid of the `Lock`
component, since indeed it's locked, but it's a detail from the point of
view of the `RoomEventCacheState` itself. This makes for a shorter and
nicer name.
2026-02-04 16:24:23 +01:00
Benjamin Bouvier 9be5bc1977 feat(multiverse): render display names for messages and latest thread event 2026-02-04 14:27:10 +01:00
Jorge Martín 70dd02012b fix(ffi): Don't override the default package_name and cdylib_name values for Kotlin bindings
Otherwise, the bindings expect the generated JAR/AAR files to contain separate `.so` libraries for each crate
2026-02-04 10:53:29 +01:00
Jorge Martín f05e0b1b81 doc: Add missing changelog entry 2026-02-04 10:23:16 +01:00
Jorge Martín 7ffcf72483 fix(ffi): Remove UniFFI checksums in matrix-sdk crate
This was forgotten in a previous PR about removing the checksums for all crates exporting bindings.
2026-02-04 10:23:16 +01:00
Jorge Martín bb420360a4 Create reldev profile:
It allows having way smaller binaries while still being able to have proper backtraces: `reldbg` is great for iOS because it allows inline debugging using LLDB in Xcode, but it produces enormous binaries, while for Android we can't use that properly and we'd only be interested in having symbolicated backtraces, which this profile achieves with binaries an order of magnitude smaller.
2026-02-04 10:21:27 +01:00
Jorge Martín 9b6d54ef30 refactor: Enable debug-images feature for Sentry
This makes it possible to link a Sentry trace to the debug symbols so it can be symbolicated
2026-02-04 10:21:27 +01:00
Jorge Martín 9dc2901268 ci: Add dist profile
This is intended for reducing the binary size of the SDK distributed in Android/iOS bindings.

Its optimization level is 'binary size', it contains LTO optimizations and by default removes part of the debug info - the rest can be removed later if needed.
2026-02-04 10:21:27 +01:00
Benjamin Bouvier 50cc5f4102 refactor(pinned events): move pin_event/unpin_event from the Timeline to the Room
These make sense in general, and they will help getting rid of one of
the `PinnedEventsRoom` trait methods in a subsequent PR.
2026-02-04 09:59:47 +01:00
Benjamin Bouvier 1152eb6d37 refactor(room): move PinnedEventsRoom::load_event_with_relations to the Room object
The method is kept on the pinned loader trait at the moment, because
it's too inconvenient to remove it quite yet. This will happen in a
subsequent PR.
2026-02-04 09:39:18 +01:00
dependabot[bot] f270eda75d chore(deps): bump bytes from 1.11.0 to 1.11.1
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-version: 1.11.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-04 10:23:35 +02:00
Jorge Martín 2b298fbb85 fix(ffi): Remove checksums in all crates using UniFFI
Previously, this was only applied to the FFI bindings crate, but it's not the only one affected by the issue with 32bit ARM checksum validations.
2026-02-04 09:06:06 +01:00
Michael Goldenberg f2abc555e2 doc(event-cache): update relevant change logs
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2026-02-03 12:14:47 -05:00