395 Commits

Author SHA1 Message Date
Jason Volk
7ede2bebd8 refactor(sdk, ffi): polish the dehydrated-devices surface.
- Bump the event broadcast capacity to the crate-standard 100.
- Keep a scheduled rotation alive across a standalone rehydrate(): the
  post-drain cleanup now uses a private delete_device() helper while
  stop() stays in the public delete().
- Source the module example pickle key from the caller; a freshly
  generated key can never decrypt an existing device.
- Add the missing #[instrument] on is_key_stored().
- Spell out the sdk_dd import alias as dehydrated_devices.
- Give StartDehydratedDevicesSettings uniffi field defaults matching the
  builder initial state.
- Scope the FFI zeroize doc to the Rust-side copy of the recovery key.
- Complete the truncated license header and spell out abbreviated event
  flags in the live test.

Signed-off-by: Jason Volk <jason@zemos.net>
2026-07-31 14:17:26 +02:00
Jason Volk
9bb46ecf46 test(sdk): adapt the live dehydrated-device test to the new API.
The live MSC3814 round trip now subscribes via `state_stream()` and drives
`start()` through its builder, following the renamed method and the removed
`StartDehydrationOpts` struct.

Signed-off-by: Jason Volk <jason@zemos.net>
2026-07-31 14:17:26 +02:00
Jason Volk
ec34921ccc test(sdk): live MSC3814 round trip against a real homeserver.
Adds two integration tests under `matrix-sdk-integration-testing`
exercising the wire endpoints end to end: a direct
`create` → `rehydrate` round trip with a locally generated pickle key,
and a `start` lifecycle that resolves the pickle key out of Secret
Storage and asserts that two consecutive `start` calls upload
distinct device IDs.

Signed-off-by: Jason Volk <jason@zemos.net>
2026-07-31 14:17:26 +02:00
Ivan Enderlin
6025bb6609 test(integration): Use wait_until_some to make the test more robust. 2026-07-27 14:21:16 +02:00
Ivan Enderlin
122b182d13 chore: Use AsyncFnMut(…) instead of FnMut(…) -> Fut. 2026-07-27 14:21:16 +02:00
Ivan Enderlin
23a2786e36 test: Add test_invite_declined_and_later_accepted.
A user reported that when Alice invites Bob, Bob declines, Alice invites
Bob again, Bob accepts, then Bob wasn't able to use the Event Cache
correctly. I believe this bug has been fixed, so here is a test to
confirm that.
2026-07-27 14:21:16 +02:00
Andy Balaam
1eeb554831 Support compiling matrix-sdk-crpto to WASM by switching to ring crypto for X.509 stuff 2026-07-23 13:57:45 +01:00
Andy Balaam
d6e100d502 In integration tests, use the real server name to construct an email so they work locally too 2026-07-23 11:58:39 +01:00
Skye Elliot
440711bb03 test(x509): End-to-end X.509 identity verification tests
Co-Authored-By: Richard van der Hoff <richard@matrix.org>
Co-Authored-By: Andy Balaam <andy.balaam@matrix.org>
Co-Authored-By: Hubert Chathi <hubertc@matrix.org>
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-07-21 14:07:38 +01:00
Paul8711
97380ac0d6 refactor: simplify alice leaving logic 2026-06-29 16:25:27 +02:00
Paul8711
7d38dd7a5d fix: ensure bob received alice's invite 2026-06-29 16:25:27 +02:00
Paul8711
0f3de62388 test: add integration test for declining invite to empty room
Signed-off-by: Paul8711 <154304377+paul8711-code@users.noreply.github.com>
2026-06-29 16:25:27 +02:00
Ivan Enderlin
a0c9c39f63 chore: Update code according to the new TimelineEvent::event_id() signature. 2026-06-18 10:27:20 +02:00
Ivan Enderlin
0cf4a8bd67 fix(ui): In-thread encrypted events are no long part of the main timeline if filtered out.
This patch fixes an issue where an in-thread encrypted event was
**always** part of the `TimelineFocusKind::Live` timeline regardless of
the `hide_threaded_events` value. The Event Cache is able to know
whether an encrypted event is part of a thread, so the Timeline can do
the same!

Consequently, an in-thread encrypted event no longer appears in the
main timeline if `hide_threaded_events` is `true`, to then be removed
once decrypted.

It fixes/removes one `TODO` in a test.
2026-06-18 10:27:19 +02:00
Ivan Enderlin
d16f7fd5d1 test(sdk): Re-enable the test_latest_thread_event_is_redecrypted_and_updated test. 2026-06-18 10:27:19 +02:00
Ivan Enderlin
2bd8013ebe test(sdk): Disable test_latest_thread_event_is_redecrypted_and_updated for now.
This test is not working because of R2D2 not updating threads for now.
This is normal. This is going to be refactored in a later PR.
2026-06-18 10:27:13 +02:00
Ivan Enderlin
6b316d1406 test(sdk): Update tests to the new API. 2026-06-18 10:27:12 +02:00
Ivan Enderlin
7d31912f0d chore: Run rumdl check --fix. 2026-05-18 15:05:52 +02:00
Andy Balaam
efa28a1ffd Use stable identifiers for m.room_key_bundle and m.history_not_shared 2026-04-21 13:47:19 +01:00
Benjamin Bouvier
0487a143ed test(integration): workaround non-working subscription to make the test pass in CI 2026-04-21 14:43:55 +02:00
Benjamin Bouvier
7ab97d59b8 test(integration): add an integration test for computing latest events in a few rooms 2026-04-21 14:43:55 +02:00
Benjamin Bouvier
940862ebed chore: bump the integration testing synapse version to v1.151.0 2026-04-21 14:43:55 +02:00
Andy Balaam
d49736455b Discard room key if someone leaves a room for a non-leave reason e.g. ban 2026-04-17 09:15:58 +01:00
Andy Balaam
e278a99a20 Factor out parts of test_history_share_on_invite_room_key_rotation 2026-04-17 09:15:58 +01:00
Ivan Enderlin
e69bb96144 test(integration): Fix the test_local_echo_to_send_event_has_encryption_info test.
This test forgot to subscribe to the Event Cache, hence the result
was partially okay. It was working by luck before. With the previous
commits, it was not possible to work without the Event Cache being
listening to the sync.
2026-04-14 14:45:14 +02:00
Damir Jelić
34a35ad32a feat(ffi): Allow passing in a SecretsBundle after logging in (#6212)
This allows people to get a secrets bundle out of band or out of a database and import it
after logging in a new client.

Mainly targeted to support the Element Classic -> Element X migration.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
Co-authored-by: Benoit Marty <benoitm@matrix.org>
2026-04-08 14:07:57 +00:00
Benjamin Bouvier
1fc7b34016 test: add an integration test reflecting the "bouncing" behavior of the timeline after sending an event 2026-04-01 14:59:33 +02:00
Kévin Commaille
34d5e6da2a Upgrade Ruma to commit after UserIdentifier breaking changes
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-04-01 10:20:21 +01:00
Damir Jelić
16c1b9b57f chore: Bump rand 2026-03-31 16:57:50 +02:00
Skye Elliot
be47a6435b tests: Add extra sync to history sharing session merge test
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-03-25 12:57:53 +00:00
Skye Elliot
fd806a9c11 tests: Assert room key rotated on leave event after being offline
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-03-18 14:25:22 +00:00
Skye Elliot
7a26db66b5 tests: Assert room key is rotated when a member leaves the room
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-03-18 14:25:22 +00:00
Benjamin Bouvier
f00f6103c8 fix(test): bump the wait time between room-info diffs in integration testing
`test_room_notification_count` started to intermittently fail on main,
because the computation of unread counts has moved from the sliding sync
processing to the event cache. As a result, new irrelevant RoomInfo
updates (related to the unread counts) can happen, and they might happen
quickly enough that the server reponse for sending an event happens
after 2 seconds (remember, we need to factor in the time to do the e2ee
key exchange, and so on and so forth).

Bumping the time between two RoomInfo updates should be sufficient to
avoid the intermittent failure.
2026-03-16 15:50:34 +01:00
Skye Elliot
b6c4bca5a0 Merge pull request #6275 from matrix-org/kaylendog/history-sharing/respect-visibility
feat(sdk): Only share history if room history visibility is shared
2026-03-12 14:55:15 +00:00
Benjamin Bouvier
9a257a4ca3 test(unread count): check that the unread counts get updated after event decryption 2026-03-12 13:28:13 +01:00
Skye Elliot
f7d818a8ba tests(sdk): Ensure shared history respects current history visibility
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-03-11 14:37:42 +00:00
Skye Elliot
f62fbfc4ee tests(sdk): Create helper assert_utd_with_withheld code
This commit additionally flips the order of a few assertions to
meet developer expectations, i.e. errors are reported as diffs
from expected.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2026-03-11 14:33:55 +00:00
rasmus
999d612a33 feat(sdk): add add_mentions toggle to Reply
Signed-off-by: rasmus <mail@rasmusantons.de>
2026-03-11 14:20:40 +01:00
Benjamin Bouvier
b0aadd1574 refactor(test): use assert_let_timeout more often
Many of our tests make use of `assert_let` for checking that some value
comes out of a stream, while they could use `assert_let_timeout`, which
provides better ergonomics when the expected value doesn't arrive
immediately, by failing quickly.

This converts a few instances, making those tests easier to debug in the
future, would they fail again.
2026-03-05 15:36:41 +01:00
Benjamin Bouvier
21e8138805 chore: depersonalize some TODO code comments
Removed a few TODOs that were not applicable anymore, because they were
either very low value (in timeline test code) or already done (in event
cache, with respect to the cross-process locking).

Also removed my nick from some TODOs and comments, as code comments
aren't the best way to store assignees for issues.
2026-03-05 13:35:23 +01:00
Benjamin Bouvier
0b6d00cfad Merge branch 'main' into bnjbvr/permalink-linked-chunk-backup 2026-03-03 15:49:13 +01:00
Damir Jelić
73028a834e chore: Define the MSRV in all of our private crates 2026-02-27 17:40:08 +01:00
Kévin Commaille
1dbd2caeb2 testing: Remove once_cell dependency
Use the types that were stabilized in the standard library instead.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2026-02-23 10:10:14 +00:00
Jorge Martín
54e4cb2d10 refactor: Rename CrossProcessStoreConfig into CrossProcessLockConfig, move it into matrix_sdk_common::cross_process_lock and use it inside CrossProcessLock instead of the previous lock_holder: Option<String> 2026-02-19 17:04:57 +01:00
Jorge Martín
287049c719 refactor: Rename CrossProcessStoreMode to CrossProcessStoreConfig 2026-02-19 17:04:57 +01:00
Jorge Martín
50b1e3baf2 refactor: Use the new APIs everywhere 2026-02-19 17:04:57 +01:00
Jorge Martín
3169c65bf2 refactor(ui): Make NotificationClient use the new CrossProcessStoreMode internally 2026-02-19 17:04:57 +01:00
Benjamin Bouvier
19c22a1883 fix(event cache): have redecryption update the event-focused caches too 2026-02-18 11:35:11 +01:00
Michael Goldenberg
d7c6af9677 test(notification-client): replace integration test with unit test
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
Co-authored-by: Jorge Martín <jorgem@element.io>
2026-02-11 15:17:43 +01:00
Michael Goldenberg
b35bea6c2b test(notification-client): show room names wrong in sliding sync notifications
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2026-02-11 15:17:43 +01:00