Commit Graph

13151 Commits

Author SHA1 Message Date
Benjamin Bouvier
9f22f550bf refactor(sdk): avoid duplicating the comparison of bumpstamps 2025-09-01 10:38:34 +02:00
Benjamin Bouvier
7a762035f1 feat(sdk): store the thread subscription bumpstamp and implement the correct upsert semantics 2025-09-01 10:38:34 +02:00
Benjamin Bouvier
8c0a918e6e refactor(sdk): introduce a lightweight ThreadSubscription for external consumers, and rename previous one to StoredThreadSubscription
External consumers are likely not interested about unsubscriptions and
the bump stamp values themselves, so let's not expose these to them.
2025-09-01 10:38:34 +02:00
Benjamin Bouvier
33c317e6d2 refactor(sdk): put the subscription status + bumpstamp back into the stored thread subscription 2025-09-01 10:38:34 +02:00
Eric Eastwood
371ed49670 Document --proxy option in the multiverse client
To be able to inspect network requests flying around as you interact

Spawning from https://github.com/matrix-org/matrix-rust-sdk/issues/5600#issuecomment-3238128112
2025-08-30 09:56:33 +02:00
Stefan Ceriu
f0c1c65308 fix(spaces): mitigate eventual race conditions when updating the pagination state (part #2) 2025-08-29 18:35:27 +03:00
Stefan Ceriu
ea5063ca84 fix(spaces): address potential race when setting up the room updates listener 2025-08-29 18:35:27 +03:00
Stefan Ceriu
dcc07e1049 chore(spaces): acquire and retain an async lock on the pagination token for the duration of the request to futher prevent inconsistencies 2025-08-29 18:35:27 +03:00
Stefan Ceriu
76a0eb1599 fix(spaces): mitigate eventual race conditions when updating the pagination state 2025-08-29 18:35:27 +03:00
Stefan Ceriu
a9c16c96e0 chore(spaces): cleanup clone names in room updates listener 2025-08-29 18:35:27 +03:00
Stefan Ceriu
93f8ebba27 chore(spaces): simplify the SpaceGraph interfaces
Fix graph reference crap
2025-08-29 18:35:27 +03:00
Stefan Ceriu
95bb153269 chore(spaces): improve how space graph edge additions work 2025-08-29 18:35:27 +03:00
Stefan Ceriu
ff72a09870 chore(spaces): fix typo 2025-08-29 18:35:27 +03:00
Stefan Ceriu
06de58dee9 chore(spaces): switch some flat_maps to filter_map 2025-08-29 18:35:27 +03:00
Stefan Ceriu
fbb49e9b65 chore(spaces): simplify the SpaceGraph interfaces 2025-08-29 18:35:27 +03:00
Stefan Ceriu
04728cc1a6 chore(spaces): various documentation fixes 2025-08-29 18:35:27 +03:00
Stefan Ceriu
d43d141dc8 chore(spaces): use Client::joined_space_rooms within the space service to reduce the number of iterations required 2025-08-29 18:35:27 +03:00
Stefan Ceriu
3c069f0c5c fix(spaces): compute the initial joined_spaces value when first setting up a subscription
- fixes values being reported only after the first sync update
2025-08-29 18:35:27 +03:00
Stefan Ceriu
a2200b6324 chore(spaces): switch from manually dropping JoinHandles to AbortOnDrop 2025-08-29 18:35:27 +03:00
Stefan Ceriu
9caa0817ae docs(spaces): add documentation, comments and examples 2025-08-29 18:35:27 +03:00
Stefan Ceriu
b3229041fb chore(spaces): ignore room list change updates if empty 2025-08-29 18:35:27 +03:00
Stefan Ceriu
50446377de change(spaces): publish VectorDiffs instead of a full vectors for joined spaces and space room list subscriptions 2025-08-29 18:35:27 +03:00
Stefan Ceriu
4f02a6d3be chore(spaces): add changelog 2025-08-29 18:35:27 +03:00
Stefan Ceriu
87fdd3c3bf chore(spaces): converge on single naming scheme for all spaces related components on both the UI and the FFI crates 2025-08-29 18:35:27 +03:00
Stefan Ceriu
990fe86fdc change(spaces): make the SpaceService constructor non-async and instead automatically setup a client subscription when requesting the joined services subscription 2025-08-29 18:35:27 +03:00
Stefan Ceriu
be2ba26974 fix(spaces): filter out the current parent space from the /hierarchy responses and SpaceServiceRoomList instances 2025-08-29 18:35:27 +03:00
Stefan Ceriu
1392a0e637 change(spaces): put a limit of 1 on the max depth of the /hierarchy calls so only the direct children are fetche 2025-08-29 18:35:27 +03:00
Stefan Ceriu
03ffa4c9a4 feat(spaces): expose the number of children each space room has 2025-08-29 18:35:27 +03:00
Stefan Ceriu
f8b5992101 fix(spaces): return the TaskHandle from the FFI space service subscription methods so it can be retained on the client side 2025-08-29 18:35:27 +03:00
Stefan Ceriu
97a5fbebfb feat(ffi): expose SpaceService::subscribe_to_joined_spaces and SpaceServiceRoomList::paginate 2025-08-29 18:35:27 +03:00
Stefan Ceriu
74c2032974 chore(spaces): build a graph from joined spaces parent and child relations to correctly detect all the edges and be able to remove any cycles.
- cycle removing is done through DFS and keeping a list of visited nodes
2025-08-29 18:35:27 +03:00
Stefan Ceriu
274aaf5ba3 change(room_list): request both m.space.parent and m.space.child state events in the sliding sync required state as they're both required to build a full view of the space room hierarchy 2025-08-29 18:35:27 +03:00
Stefan Ceriu
3e72cce7a0 fix(spaces): use wasm compatible executor spawn and JoinHandle 2025-08-29 18:35:27 +03:00
Stefan Ceriu
aa4b176ab3 fix(spaces): fix complement-crypto failures because of using an outdated uniffi version
- automatic Arc inference was introduced in 0.27 and complement is using 0.25
2025-08-29 18:35:27 +03:00
Stefan Ceriu
ad2f4c731a feat(spaces): have the SpaceRoomList publish updates as known room states change i.e. they get joined or left. 2025-08-29 18:35:27 +03:00
Stefan Ceriu
f78015fae1 change(spaces): return only top level joined rooms from SpaceService::joined_spaces and its reactive counterpart 2025-08-29 18:35:27 +03:00
Stefan Ceriu
211a1f5a40 feat(spaces): add a reactive version of the joined_spaces method 2025-08-29 18:35:27 +03:00
Stefan Ceriu
b8be1fdb26 feat(spaces): introduce a SpaceRoomList that allows pagination and provides reactive interfaces to its rooms and pagination state 2025-08-29 18:35:27 +03:00
Stefan Ceriu
a43e42c170 chore(spaces): introduce a SpaceServiceRoom 2025-08-29 18:35:27 +03:00
Stefan Ceriu
f031eaf96b chore(spaces): setup a simple space service and some unit tests 2025-08-29 18:35:27 +03:00
Benjamin Bouvier
3ba31d1e97 tests: clarify that the other thread subscription endpoints are grouped by room 2025-08-29 11:28:29 +02:00
Benjamin Bouvier
bbf8f9f900 feat(sdk): add support for msc4308 accompanying endpoint (fetching thread subscriptions) 2025-08-29 11:28:29 +02:00
Benjamin Bouvier
49dc2bb640 chore: bump Ruma
We get test fixes for free, thanks to the new push rules semantics
implemented in Ruma \o/
2025-08-29 11:28:29 +02:00
Skye Elliot
99af951d7a feat(crypto): Add EncryptionSettings::encrypt_state_events
This will be used inside the WASM SDK to introduce a similar field to
its EncryptionSettings struct.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-28 14:00:23 +02:00
Ivan Enderlin
a17bf18ff2 chore(sdk): Improve a log message. 2025-08-28 12:58:19 +02:00
Ivan Enderlin
5d87570a33 doc(sdk,base): Fix outdated documentation and typos. 2025-08-28 12:58:19 +02:00
Ivan Enderlin
80806303b5 feat(sdk): The LatestEventValue is stored in RoomInfo and persisted.
This patch updates `LatestEvent::update` to call the new
`LatestEvent::store` method, which will store the new `LatestEventValue`
in the `RoomInfo` struct, and will persist it in the `StateStore`.

This patch also adds the test for this new feature.
2025-08-28 12:58:19 +02:00
Ivan Enderlin
6155772bb1 feat(base): Add RoomInfo::new_latest_event.
This patch adds the new `new_latest_event: LatestEventValue` field in
`RoomInfo`. The `latest_event` is kept for the moment, but it will be
removed once the new API has landed entirely.
2025-08-28 12:58:19 +02:00
Ivan Enderlin
33db267a89 test(base): test_cached_latest_event_can_be_redacted runs only if e2e-encryption is enabled.
This patch puts `test_cached_latest_event_can_be_redacted` as it runs
only if `e2e-encryption` is turned on.
2025-08-28 12:58:19 +02:00
Ivan Enderlin
6fc68dac83 refactor(sdk,base): Move LatestEventValue into matrix_sdk_base.
This patch moves `LatestEventValue` into the
`matrix_sdk_base::latest_event` module. If we want to store this value
in `RoomInfo`, it must be in this crate.

Because it's not allowed to `impl T` where `T` lives in a different
crate, this patch changes the `impl LatestEventValue` to `struct
LatestEventValueBuilder` + `impl LatestEventValueBuilder`. Luckily, all
methods on `LatestEventValue` are only constructors, so the change is
super straightforward.
2025-08-28 12:58:19 +02:00