14089 Commits

Author SHA1 Message Date
Jonas Platte
2c4a718c1a Rename local variable for edition 2024 compatibility
`gen` is a keyword starting in edition 2024.
2025-12-10 16:37:43 +00:00
Ivan Enderlin
b19377a96c fix(sdk): Better handling of redacted and redaction events in Latest Event (#5932)
This patch revisits the way redacted and redaction events are handled in
the Latest Event.

Previously, all redacted events were considered suitable candidate. It's
no longer the case.

Redaction and redacted events are no longer considered suitable.

This patch also revisits `rfind_map_event_in_memory_by` to return a
`&TimelineEvent` instead of an `OwnedEventId`, which could be more
performant in the future.

The tests have been updated accordingly.

---

* Fix https://github.com/matrix-org/matrix-rust-sdk/issues/5899
* Address https://github.com/matrix-org/matrix-rust-sdk/issues/4112

Signed-off-by: Stefan Ceriu <stefanc@matrix.org>
Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
matrix-sdk-ffi/20251210
2025-12-10 12:37:01 +00:00
Ivan Enderlin
76cae09f37 test(sdk): Test RoomEventCacheGenericUpdates are broadcasted. 2025-12-10 12:46:02 +01:00
Ivan Enderlin
81eb466555 fix(sdk): Broadcast a RoomEventCacheGenericUpdate when redecrypting events.
This patch sends a missing `RoomEventCacheGenericUpdate` when
redecrypting events.
2025-12-10 12:46:02 +01:00
Ivan Enderlin
0a24622ca2 fix(sdk): Broadcast a RoomEventCacheGenericUpdate when paginating from the network.
This patch sends a missing `RoomEventCacheGenericUpdate` when paginating
events from the network.
2025-12-10 12:46:02 +01:00
Ivan Enderlin
db0f4dd31c chore: Add logs in matrix_sdk::latest_events. 2025-12-10 12:46:02 +01:00
Ivan Enderlin
fbc69837e1 perf(sdk): Increase various channel capacities. 2025-12-10 12:46:02 +01:00
Ivan Enderlin
b9b5ead89e perf(sdk): Use an unbounded channel for room registration. 2025-12-10 12:46:02 +01:00
Ivan Enderlin
1c0f447632 perf(sdk): Increase the capacity of the room registration channel.
This patch increases the capacity of the room registration channel. The
hope is that it can reduce the need to wait on available permits under
heavy load.
2025-12-10 12:46:02 +01:00
Ivan Enderlin
e21a95f631 refactor(sdk): Do not use Fuse in listen_to_event_cache_and_send_queue_updates task.
This patch removes the use of `Fuse` in the
`listen_to_event_cache_and_send_queue_updates` task. `mpsc::Receiver`
and `broadcast::Received` are cancellation safe.
2025-12-10 12:46:02 +01:00
Ivan Enderlin
5a05bcb6b7 refactor(sdk): Hold write lock as few as possible.
This patch reduces the lifetime of the write locks in
`RegisteredRooms::room_latest_event` when the `RoomLatestEvents`
doesn't exists. If the `room_registration_sender` channel is full,
it has to wait. When waiting, the write lock is still alive, probably
blocking other operations. The idea is to create the `RoomLatestEvents`,
to downgrade the write lock to a read lock, and then to send the
registration message onto the `room_registration_sender`.
2025-12-10 12:46:02 +01:00
Hugh Nimmo-Smith
183116a4b1 Changelog 2025-12-09 19:18:06 +01:00
Hugh Nimmo-Smith
e916d9d374 fix(sdk): support device IDs that aren't Curve25519 public keys in GrantLoginWithGeneratedQrCode and GrantLoginWithScannedQrCode 2025-12-09 19:18:06 +01:00
Stefan Ceriu
604ce4acfd chore(sdk, crypto): add changelogs 2025-12-09 18:49:03 +01:00
Damir Jelić
cd57da59ec fix: Correctly construct the decrypted event in the send queue 2025-12-09 18:49:03 +01:00
Damir Jelić
9ff90a9b4d Add an integration test that the send queue can insert encrypted events 2025-12-09 18:49:03 +01:00
Stefan Ceriu
98f34f010c change(room::futures): Use a proper struct instead of a tuple for SendMessageLikeEvent results 2025-12-09 18:49:03 +01:00
Stefan Ceriu
d513807c9f change(send_queue): Use the Room:send_raw resulting EncryptionInfo to create a DecryptedRoomEvent and corresponding TimelineEvent and correctly populate the Event Cache. 2025-12-09 18:49:03 +01:00
Stefan Ceriu
8bd401b003 change(matrix_sdk::Room): Return the used EncryptionInfo when sending MessageLike and RawMessageLike events 2025-12-09 18:49:03 +01:00
Stefan Ceriu
b7d22da9f0 change(crypto): provide encryption information back directly from the Olm machine's raw encryption methods 2025-12-09 18:49:03 +01:00
Hugh Nimmo-Smith
b98a832c67 feat(ffi): Add QrCodeData::to_bytes() to allow generation of a QR code (#5939)
Signed-off-by: Hugh Nimmo-Smith <hughns@element.io>
2025-12-09 17:00:44 +00:00
Michael Goldenberg
acf3a7a04b doc(indexeddb): update changelog
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-12-09 15:24:15 +01:00
Michael Goldenberg
790136b9db fix(indexeddb): skip encoding event id when constructing bounds
In the implementation of EventCacheStore, there are a number of
places where the upper and lower bounds of an EventId are
constructed. It is important to bypass hashing and encryption
when constructing these bounds, otherwise the values will be
modified and will no longer represent the bounds.

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-12-09 15:24:15 +01:00
Michael Goldenberg
265cfc7710 test(indexeddb): initialize store cipher in encrypted tests for event cache and media store
Note that the encrypted tests were actually being run unencrypted.
Introducing a store cipher causes them to run encrypted, and
furthermore, reveals some bugs which are only visible when running
an encrypted event cache store.

Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2025-12-09 15:24:15 +01:00
Damir Jelić
29b693e625 chore: Update the changelog to include the CVE and GSA references 2025-12-08 12:45:42 +01:00
Johannes Marbach
8637bdce12 fixup! feat(room): make load_event_with_relations also load relations when falling back to the network
Try loading relations from the cache before falling back to the server

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-12-08 09:44:59 +00:00
Johannes Marbach
db4e1b2c00 fixup! feat(room): make load_event_with_relations also load relations when falling back to the network
Cache related events after loading them

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-12-08 09:44:59 +00:00
Johannes Marbach
c82e1b8ec3 fixup! feat(room): make load_event_with_relations also load relations when falling back to the network
Change limit to 256

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-12-08 09:44:59 +00:00
Johannes Marbach
9105db3d82 feat(room): make load_event_with_relations also load relations when falling back to the network
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-12-08 09:44:59 +00:00
Ivan Enderlin
238e4e8a87 doc: Mention #5624 in CHANGELOG.mds. 2025-12-05 09:40:47 +01:00
Ivan Enderlin
37c516f7f9 refactor: Rename new_latest_event to latest_event.
This patch removes the “new_” prefix to the latest event API.
2025-12-05 09:40:47 +01:00
Ivan Enderlin
81a8aa063b chore(base): Remove the old latest event API. 2025-12-05 09:40:47 +01:00
Ivan Enderlin
91091c7819 chore(ui): Remove the old latest event API.
So satisfying.
2025-12-05 09:40:47 +01:00
Ivan Enderlin
e4141b216a chore(ffi): Remove the old latest event API. 2025-12-05 09:40:47 +01:00
Kévin Commaille
b0574c1c2c feat(sdk): Add support for the stable m.oauth UIAA type
By replacing the custom implementation with the one in Ruma.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-12-05 09:20:48 +01:00
Jorge Martín
bfd8cfa1c8 refactor: Add uniffi-rs entries to deny.toml 2025-12-04 15:17:26 +01:00
Jorge Martín
67815e7787 refactor: Remove unused cargo_metadata dependency 2025-12-04 15:17:26 +01:00
Jorge Martín
031d8457b6 refactor: Upgrade uniffi to the latest upstream 2025-12-04 15:17:26 +01:00
Ivan Enderlin
c84f5965c3 test(ui): Fix tests according to last change.
This path adds events or state events to force the test to execute as
expected since a change in `bump_stamp` alone doesn't trigger a room
list update anymore.
2025-12-04 13:39:01 +01:00
Ivan Enderlin
638028ba7c fix(ui): Reduce number of updates in the room list.
This patch fixes a “bug” in the Room List. It's updated by
`RoomInfoNotableUpdateReasons`. However, 1 reason is creating
unnecessary updates: `RECENCY_STAMP`. The Room List is already updated
by the Latest Event. One usage of the Latest Event is to sort the Room
List by recency. Thus, since the Room List is updated by `LATEST_EVENT`,
we can ignore `RECENCY_STAMP`.
2025-12-04 13:39:01 +01:00
Ivan Enderlin
ae9600e872 doc(sdk): Remove mention of #3941.
This patch removes the mention of #3941 now it's closed.
2025-12-04 12:06:24 +01:00
Damir Jelić
b5d5a41453 Merge pull request #5926 from matrix-org/poljar/release-0.16.0
Release prep for 0.16.0
2025-12-04 10:32:26 +01:00
Damir Jelić
742a0db07b chore: Remove mentions of the 0.15 release
The 0.15.0 release was a misfire so we're skipping this version number.
matrix-sdk-ffi-0.16.0 matrix-sdk-test-utils-0.16.0 matrix-sdk-ui-0.16.0 matrix-sdk-0.16.0 matrix-sdk-sqlite-0.16.0 matrix-sdk-search-0.16.0 matrix-sdk-indexeddb-0.16.0 matrix-sdk-base-0.16.0 matrix-sdk-store-encryption-0.16.0 matrix-sdk-crypto-0.16.0 matrix-sdk-test-0.16.0 matrix-sdk-test-macros-0.16.0 matrix-sdk-qrcode-0.16.0 matrix-sdk-common-0.16.0
2025-12-04 09:59:04 +01:00
Damir Jelić
4701faf039 chore: Release matrix-sdk version 0.16.0 2025-12-04 09:59:04 +01:00
Doug
93f71ba977 ffi: Add support for checking login with QR code availability. 2025-12-03 18:35:29 +02:00
Damir Jelić
4ea0418abe fix: Don't attempt to serialize custom join rules (#5924)
This is not supported by Ruma. The join_rule field, despite being
defined as a pure string, can have associated data to it based on the
join rule variant.

This means that custom and unknown enum variants might lose data when
reserializing.

Let's just skip the serialization of custom join rules in the RoomInfo,
the concrete value is still available in the state store, it's just not
kept at hand in the RoomInfo.

Signed-off-by: Damir Jelić <poljar@termina.org.uk>
Co-authored-by: Ivan Enderlin <ivan@mnt.io>
2025-12-03 16:54:58 +01:00
Jorge Martín
2412403a1e doc: Add changelogs 2025-12-03 15:41:42 +01:00
Jorge Martín
ed72d3439a fix: avoid unwrap in Client::optimize_stores 2025-12-03 15:41:42 +01:00
Jorge Martín
9eee20b4f0 feat(ffi): add bindings for Client::get_store_sizes 2025-12-03 15:41:42 +01:00
Jorge Martín
bc45457d0e feat: add Client::get_store_sizes
This method will retrieve the database sizes if available and expose it in the client.

Note: the actual database size measuring is only implemented for the SQLite based stores
2025-12-03 15:41:42 +01:00