Commit Graph

1467 Commits

Author SHA1 Message Date
Damir Jelić
4c1f80faf7 chore: Release matrix-sdk version 0.14.0 2025-09-04 16:05:48 +02:00
Benjamin Bouvier
f9b419077d refactor(sdk): limit the quantity of data passed to the read receipt processor
This limits cloning.
2025-09-03 16:56:53 +02:00
Benjamin Bouvier
d46f934d57 perf: process read receipts concurrently
By slightly changing the shape of the function used to process read
receipts, we can make it so that it's trivial to run concurrently, which
gives some nice speedups locally.

Distribution of 6 worst case processing time, initial response:

Before:
0.172524963s
0.216173016s
0.252289760s
0.257619156s
0.275838632s
0.280295891s

After:
0.083094692s
0.117074046s
0.130246646s
0.132577343s
0.138685246s
0.170287945s
2025-09-03 16:56:53 +02:00
Benjamin Bouvier
0b3345f592 feat(sdk): add more timers to sync processing 2025-09-03 12:46:09 +02:00
Benjamin Bouvier
472b934816 refactor(sdk): remove a few useless async 2025-09-02 19:56:23 +02:00
Benjamin Bouvier
eab62ec0b5 feat(sdk): automatically catch up missing thread subscriptions 2025-09-02 14:57:49 +02:00
Benjamin Bouvier
4adbb4aa88 feat(sdk): add support for persisting the thread subscription catchup tokens 2025-09-02 14:57:49 +02:00
Damir Jelić
1e30916754 chore: Bump most of our deps 2025-09-01 16:33:10 +02:00
Damir Jelić
5cd3818841 chore: Fix a clippy warning about unused lifetimes 2025-09-01 10:46:10 +02:00
Damir Jelić
4c1e2d6d51 chore: Fix a warning about a type visibility 2025-09-01 10:46:10 +02:00
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
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
Benjamin Bouvier
bbf8f9f900 feat(sdk): add support for msc4308 accompanying endpoint (fetching thread subscriptions) 2025-08-29 11:28:29 +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
Damir Jelić
527d001010 fix: Only report duplicate one-time key errors once
Since the server will reject any duplicate one-time keys forever,
clients which encounter such an error will spam sentry with such
reports.

This patch ensures that we only send the sentry report once.
2025-08-28 12:48:30 +02:00
Stefan Ceriu
97d6f57aee feat(base): add SyncResponse::RoomUpdates::is_empty method to check if there were any room updates 2025-08-28 10:45:02 +03:00
Skye Elliot
8e5075569e feat: Add top-level support for decrypting state events (#5552)
Implements support for decryption of state events

- [ ] Introduce a case for `AnySyncStateEvent::RoomEncrypted` to the
`state_events` sync response processor.
- [ ] Introduce modified `Room::decrypt_event` and
`::try_decrypt_room_event`.
- [ ] Introduce testing macro
`assert_let_decrypted_state_event_content`.
- [ ] Add casts and explicit type hints where necessary.

---------

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-27 10:53:55 +01:00
Benjamin Bouvier
25a81876a0 tests: allow conversion from EventBuilder into Raw<AnyGlobalAccountDataEvent>
This avoids a few explicit `.into_raw()` calls here and there.
2025-08-21 15:21:14 +02:00
Benjamin Bouvier
ef20342ddf tests: use the new global account data methods a bit more 2025-08-21 15:21:14 +02:00
Benjamin Bouvier
e6b1ffba99 tests: add support for the global account PushRules event in the event factory 2025-08-21 15:21:14 +02:00
Skye Elliot
960162453c feat(base): Add EncryptionState::StateEncrypted
Signed-off-by: Skye Elliot <actuallyori@gmail.com>
2025-08-18 17:46:46 +02:00
Benjamin Bouvier
c019009d00 refactor(event cache): avoid deserializing the full event content to be sent, for extracting its thread root 2025-08-18 15:10:50 +02:00
Skye Elliot
ae7f0fe022 feat: Experimental encrypted state feature flag with CI support (#5537)
This PR makes some non-domain-specific changes across multiple crates
that are required for proper testing of features implemented for #5397.

* Adds a `experimental-encrypted-state-events` feature flag across the
SDK.
* Introduces a feature set into xtask to ensure feature-gated tests are
run during CI.
* Minor fix to a test that would otherwise fail with the newly
introduced CI.
2025-08-15 12:54:41 +00:00
Kévin Commaille
a3a239f999 Upgrade Ruma: revert StrippedState
Handle the previous breaking change that was reverted: `StrippedState`
was removed and `AnyStrippedStateEvent` is used again.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-14 08:57:52 +02:00
Skye Elliot
ca8b64e041 feat: Change type of DecryptedRoomEvent::event to Raw<AnyTimelineEvent> (#5512)
- [x] Change `DecryptedRoomEvent::event` to `Raw<AnyTimelineEvent>`
- [x] Update usages to pattern match on `AnyTimelineEvent::MessageLike`
where necessary

---------

Signed-off-by: kaylendog <actuallyori@gmail.com>
2025-08-14 08:53:56 +02:00
multisme
a66b2c5123 feat(test): add a test utils crate to make log initialization possible everywhere
This PR allows `init_tracing_for_test` to be called by any other crate in the sdk

Signed-off-by: multi [multiestunhappydev@gmail.com](mailto:multiestunhappydev@gmail.com)
2025-08-14 05:24:03 +00:00
Michael Goldenberg
c8bffa26a4 test(event-cache-store): make time-based integration tests compatible with wasm targets
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-08-13 16:00:48 +02:00
Benjamin Bouvier
53f02c9f2d chore: bump Ruma
So as to get some changes for Element Call:
https://github.com/ruma/ruma/pull/2176
2025-08-12 16:06:26 +02:00
Kévin Commaille
669ebf2408 refactor(base): Don't take room ID in Notification::push_notification_from_event_if
It is already in the `PushConditionRoomCtx`, so we don't need an extra
argument for it.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-07 16:02:56 +02:00
dragonfly1033
992774b8b5 Add the matrix-sdk-search crate
A new crate with a basic API for a creating, populating and searching a
room message index.

Signed-off-by: Shrey Patel shreyp@element.io
2025-08-07 16:01:41 +02:00
Kévin Commaille
9d90a92b4c doc(base): Use different Result type in doc example
`anyhow::Ok(())` doesn't work under WASM because it requires the error
types to be `Send + Sync`.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-07 15:11:30 +02:00
Benjamin Bouvier
8409e52654 doc(base): tweak some doc comment around notifications 2025-08-07 11:59:36 +02:00
Jonas Platte
42d2b93489 refactor: Introduce TestResult and use it in a couple random places 2025-08-06 22:21:39 +00:00
Benjamin Bouvier
5719fde701 feat(client): add a global toggle for enabling thread subscriptions support 2025-08-06 15:28:43 +02:00
Benjamin Bouvier
0cdec9d912 refactor(threads): flatten the ThreadStatus enum 2025-08-06 15:28:43 +02:00
Benjamin Bouvier
d180d49c07 refactor(threads): do not store the unsubscribed state in the DB 2025-08-06 15:28:43 +02:00
Benjamin Bouvier
bcee5badae refactor(threads): adapt to Ruma API changes related to async evaluation of push rules 2025-08-06 15:28:43 +02:00
Kévin Commaille
056e90db25 feat(sdk): Use state_after in sync v2 (#5488)
It is supposed to be an improvement over `state`, since it allows the
server to send updates to the state that might not be reflected in the
timeline.

This is also the same behavior as in Simplified Sliding Sync.

This is MSC4222 that was accepted and is about to get merged in the
spec.

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-06 13:42:49 +01:00
Kévin Commaille
787861eb35 fix: Upgrade Ruma
This brings 2 important bug fixes:

- Make deprecated fields of `m.room.encrypted` optional: it seems that there are events without these fields in the wild.
- Fix deserialization of `RedactedRoomJoinRulesEventContent`. This was found by a bug report in Fractal that caused the same error as #3557 when restoring the client. So maybe we could consider that this bug is fixed? It is still possible that there is another deserialization error. 

There is also a breaking change in the format of the `state` field in response to `GET /v3/sync`.
2025-08-05 16:04:34 +02:00
Kévin Commaille
3276bc87ad refactor(base): Don't drop whole m.room.create if predecessor is invalid
The `m.room.create` event contains at lot of important information for a
room, like its type (i.e. whether it is a space), its version and its
creator(s) (which are important in room version 12). So ignoring the
event completely might break a room.

Instead what we do here is simply ignore the `predecessor` field if it
is considered invalid, allowing us to access the other fields.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-04 10:09:52 +02:00
Kévin Commaille
033c6bd6a4 Add changelog
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-01 14:07:28 +02:00
Kévin Commaille
b02e1da471 Upgrade Ruma
This brings in a new breaking change from Ruma, because not all events
are stripped in a room's stripped state. For simplicity, this still
considers the events as stripped during deserialization for now, since
this format is compatible with the other possible formats.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-01 14:07:28 +02:00
Johannes Marbach
0edcdd33b2 chore(send_queue): Make parent_is_thumbnail_upload available outside of unstable-msc4274 to use it during media progress reporting later
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 11:16:48 +02:00