Commit Graph

11805 Commits

Author SHA1 Message Date
Benjamin Bouvier
ff89165836 fixup! feat(event cache): start implementing threads in the event cache 2025-04-24 17:48:01 +02:00
Benjamin Bouvier
6ebca8288c feat(multiverse): add a plain view of all the threads in a room 2025-04-24 17:46:28 +02:00
Benjamin Bouvier
3a97c61293 docs(common): add a comment explaining how to use the timer! macro 2025-04-24 17:32:38 +02:00
Benjamin Bouvier
5ddd23a3cc feat(event cache): start implementing threads in the event cache 2025-04-24 17:32:38 +02:00
Benjamin Bouvier
14c6dcc464 test(sdk): add a mocking endpoing for listing relations and test Room::relations 2025-04-24 16:50:50 +02:00
Benjamin Bouvier
ace0026b1d feat(sdk): add a room method to retrieve all related events 2025-04-24 16:50:50 +02:00
Benjamin Bouvier
9a5e9e8950 test(sdk): add a mocking endpoint for listing threads and test Room::list_threads() 2025-04-24 16:50:50 +02:00
Benjamin Bouvier
69a0b784dd feat(sdk): add a room method to retrieve a list of threads 2025-04-24 15:03:39 +02:00
Benjamin Kampmann
12e358a54f fix(sdk): Don't overwrite previously added state events in state_event processing
Fixes #4952 .

Signed-off-by: Benjamin Kampmann <ben@acter.global>
2025-04-24 13:49:22 +02:00
Richard van der Hoff
468e7c35f6 Merge pull request #4932 from matrix-org/rav/history_sharing/save_key_bundle_data
crypto: store received room key bundle data information

Add hooks to the memory store and sqlite store to stash the information about room key data.
2025-04-24 12:22:14 +01:00
Richard van der Hoff
a3cb1cd6b5 Merge branch 'main' into rav/history_sharing/save_key_bundle_data 2025-04-24 12:07:21 +01:00
Johannes Marbach
1554e05d8a refactor(send_queue): generalize SentRequestKey::Media and DependentQueuedRequestKind::UploadFileWithThumbnail to prepare for MSC4274 gallery uploads (#4897)
This was broken out of
https://github.com/matrix-org/matrix-rust-sdk/pull/4838 and is a
preliminary step towards implementing
[MSC4274](https://github.com/matrix-org/matrix-spec-proposals/pull/4274).
`SentRequestKey::Media` and
`DependentQueuedRequestKind::UploadFileWithThumbnail` are generalized to
allow chaining dependent media uploads and accumulating sent media
sources.

- [x] Public API changes documented in changelogs (optional)

---------

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Co-authored-by: Benjamin Bouvier <benjamin@bouvier.cc>
2025-04-24 09:52:33 +00:00
Richard van der Hoff
85e0626d5f indexeddb: fudge implementation of get_received_room_key_bundle_data 2025-04-23 19:59:24 +01:00
Richard van der Hoff
e89c45ba42 sqlite: store data on received room key bundles 2025-04-23 19:59:24 +01:00
Richard van der Hoff
6173aef064 memorystore: store received room key bundle data 2025-04-23 19:59:24 +01:00
Richard van der Hoff
00364d95af crypto: add methods for room key bundles to store traits 2025-04-23 19:59:24 +01:00
Richard van der Hoff
3aa0983a5c crypto: add received room key bundles to store changes list
After we receive a to-device message holding room key bundle info, add the data
to the store's Changes structure
2025-04-23 19:59:24 +01:00
Richard van der Hoff
4be4d39851 crypto: add types to support decryption of RoomKeyHistoryBundle to-device
events
2025-04-23 19:59:24 +01:00
Benjamin Bouvier
884775086a chore: add an intermittent test failure policy 2025-04-23 15:34:26 +02:00
Damir Jelić
a60e336f85 feat(crypto): Start using the stable identifier for the sender device keys
This patch updates the sending side of the `sender_device_keys` field
introduced in MSC4147.

Since the MSC got merged, we're switching from the unstable identifier
to the stable one.

A couple of snapshot tests were added modified to make this happen.
2025-04-23 15:25:11 +02:00
Benjamin Bouvier
426a4ff1bf chore(ci): make clippy happy on all configurations 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
9492614ea6 refactor(sdk): rename a few push_action_ctx variables back into push_ctx 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
234e0be337 refactor(timeline): reuse the same push context for all the events we're trying to re-decrypt 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
b6d71a3875 refactor(timeline): make use of PushContext in the RoomDataProvider trait 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
4c8e2fd4ae refactor(sdk): no need to recompute push actions from /messages, since try_decrypt_event does it for us 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
55342a84fa refactor(sdk): explicit the case where we can't compute the push actions 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
9950268164 refactor(sdk): rename Room::push_action_ctx to Room::push_context() (and associated type too) 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
f17c9fb2d5 refactor(sdk): rename Room::push_context() to Room::push_condition_room_ctx() 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
93c961d673 refactor(sdk): avoid recomputing the push context and ruleset for every single event when decrypting a batch 2025-04-23 14:49:49 +02:00
Benjamin Bouvier
6e786e0ede refactor(sdk): use Room::try_decrypt_event in an extra location
The previous code was wrong, in that it wouldn't properly compute push
actions for events that were not encrypted and received with /messages.
2025-04-23 14:49:49 +02:00
Timo
6c4a4382d7 WidgetDriver: Use matrix_sdk_common::executor::spawn instead of tokio::spawn to make it wasm compatible. (#4959)
This PR is a revived version of:
https://github.com/matrix-org/matrix-rust-sdk/pull/4707 since it is now
possible to easily add wasm support thanks to:
https://github.com/matrix-org/matrix-rust-sdk/pull/4572

Using the `executer::spawn` will select `tokio::spawn` or
`wasm_bindgen_futures::spawn_local` based on what platform we are on.

~~They behave differently in that `tokio` actually starts the async
block inside the spawn but the wasm `spawn` wrapper will only start the
part that is not inside the `async` block and the join handle needs to
be awaited for it to work.~~

This has now changed with:
https://github.com/matrix-org/matrix-rust-sdk/pull/4572.
Now they behave the same and this PR becomes a very simple change.
2025-04-23 14:39:34 +02:00
Richard van der Hoff
7272a347fa Merge pull request #4961 from matrix-org/rav/history_sharing/deflake_integ_test
test: attempt to deflake history-sharing integ test
2025-04-23 11:49:41 +01:00
Richard van der Hoff
6d1c24f6fb test: attempt to deflake history-sharing test
Rather than attempting to trigger Alice's encryption sync loop with an incoming
message from Bob, instead have Alice send a message once Bob has joined the
room.
2025-04-23 11:33:06 +01:00
Richard van der Hoff
4300148663 test: factour out new helper wait_until_some. 2025-04-23 11:33:06 +01:00
Richard van der Hoff
75cde02283 Merge pull request #4946 from matrix-org/rav/history_sharing/share_on_invite
sdk: share room history when we send an invite, subject to an experimental feature flag.
2025-04-23 11:15:57 +01:00
Damir Jelić
59ecb1edbd fix(multiverse): Add a shortcut to mark rooms as read back 2025-04-23 11:39:59 +02:00
Richard van der Hoff
6e963917d6 sdk: clean up imports 2025-04-23 09:51:01 +01:00
Valere
7adf60d2c6 fixup: Cleaner ProcessedToDevice snapshot serialization 2025-04-22 16:30:53 +02:00
Valere
bd576c22c0 fixup: test, redact snapshot value that is dependent of feature flag 2025-04-22 16:30:53 +02:00
Valere
35023ceb0b fixup: invalid tag in doc 2025-04-22 16:30:53 +02:00
Valere
f1e7894c01 fixup: insta use shorter names 2025-04-22 16:30:53 +02:00
Valere
ef44631fc6 review: remove outdated changelog line 2025-04-22 16:30:53 +02:00
Valere
541586f6cc review: add snapshot test with proper redaction 2025-04-22 16:30:53 +02:00
Valere
f89150d3ee review: quick doc improvements 2025-04-22 16:30:53 +02:00
Valere
b27770801c review: refactor, rename NotProcessed variant to Invalid 2025-04-22 16:30:53 +02:00
Valere
a49bffac4c review: refactors ProcessedToDeviceEvent to tuple variants
Simplifies the `ProcessedToDeviceEvent` enum by converting its variants to tuple variants.

This change improves code readability and conciseness by removing the need for named fields within the variants.
2025-04-22 16:30:53 +02:00
Valere
d4a0c2882d review: Move ProcessedToDeviceEvent to crypto types mod 2025-04-22 16:30:53 +02:00
Valere
031f4ec329 review: Remove encryption_info. Will be part of another PR 2025-04-22 16:30:53 +02:00
Valere
4bf103db38 test: Add more olm decryption encryption_info tests 2025-04-22 16:30:53 +02:00
Valere
4363105976 crypto: Add variants for plain text and encrypted to-device events
fixup: post rebase
2025-04-22 16:30:53 +02:00