15793 Commits

Author SHA1 Message Date
Stefan Ceriu
686318a6a5 fix(search): use a manual reload policy for the Tantivy IndexReader
Use `ReloadPolicy::Manual` for the Tantivy `IndexReader` of a `RoomIndex`.
Tantivy's default policy spawns a meta file watcher thread per index, i.e. one
per room, and panics if the thread cannot be spawned. Commits already reload the
reader explicitly, so the watcher is pure overhead.
2026-07-30 15:10:56 +03:00
Damir Jelić
e1717476d6 chore: Bump our MSRV
This is needed because the rusqlite crate uses the cfg_select macro
which got stabilized in Rust 1.95[1].

[1]: https://doc.rust-lang.org/stable/std/macro.cfg_select.html
2026-07-30 13:46:34 +02:00
Damir Jelić
25b1b96d21 chore: Bump rusqlite 2026-07-30 13:46:34 +02:00
Alexandros Lykesas
f448c4672a feat: allow attaching custom fields to outgoing messages and media
Signed-off-by: Alexandros Lykesas <alexookah@me.com>
2026-07-30 13:23:58 +03:00
Stefan Ceriu
ea5193f00b fix(common): keep RingBuffer's capacity across (de)serialization (#6815)
Fixes `RingBuffer` capacity being lost across serialization and
deserialization. The buffer previously relied on the backing
`VecDeque`’s allocation capacity as its logical capacity. Since serde
only serialized the items, deserialization recreated the `VecDeque` with
capacity equal to the number of stored items. A partially filled buffer
could therefore come back effectively full, causing every subsequent
push to evict an existing item.

`RoomReadReceipts::pending` uses a `RingBuffer` to retain read receipts
whose target events are not currently known by the timeline. This can
happen when a receipt arrives before the corresponding event, for
example with limited sync responses or federation delays. Those pending
receipts are persisted as part of `RoomInfo`. After restoring them, the
old implementation could shrink the ring buffer to the number of
currently stored receipts. Once that happened, newly received pending
receipts would evict older ones immediately. In particular, the receipt
needed to advance `latest_active` could be lost, leaving unread counts
incorrect even though the client had received the relevant receipt.

By preserving the logical capacity, pending read receipts survive
persistence and can continue to be matched when their corresponding
events become available.
2026-07-29 19:11:08 +03:00
Alexandros Lykesas
df1f15156b fix(ffi): delete the state store's actual -wal/-shm sidecars in clear_caches
Signed-off-by: Alexandros Lykesas <alexookah@me.com>
2026-07-28 18:34:06 +02:00
Ivan Enderlin
edd30e40dd chore(labs): Increase the recursion limit (for #[instrument]). 2026-07-28 18:04:26 +02:00
Ivan Enderlin
481ac77049 chore(benchmark): Increase the recursion limit (for #[instrument]). 2026-07-28 18:04:26 +02:00
Ivan Enderlin
f6fd03a82b chore(benchmark): Increase the recursion limit (for #[instrument]). 2026-07-28 18:04:26 +02:00
Ivan Enderlin
23603daa32 chore(ui): Increase the recursion limit (for #[instrument]). 2026-07-28 18:04:26 +02:00
Ivan Enderlin
40c84f0deb chore(sdk): Add TracingTimers in th StateLock.
This patch adds `TracingTimer`s in the `StateLock::read`, `write` and
`clear_and_reload` methods. The idea is to get a sense of how long it
takes to compute these locks.

This patch also adds regular logs to indicate when a lock is acquiring,
or acquired.
2026-07-28 18:04:26 +02:00
Ivan Enderlin
6e540bc6c1 chore(search): Use a const expression for MAX_MILLISECONDS. 2026-07-28 17:14:12 +02:00
Ivan Enderlin
58dbb91bec doc(search): Add the changelog file. 2026-07-28 17:14:12 +02:00
Ivan Enderlin
641c9802d7 fix(search): Cap the event's timestamp to avoid a panic from Tantivy.
Despite to the previous patches that prevent using malformed timestamp,
it is still to pass an invalid timestamp if the API is misused. This
patch caps the timestamp to prevent Tantivy to panic.

With this patch, it's impossible to panic with the timestamp.
2026-07-28 17:14:12 +02:00
Ivan Enderlin
edb43d02ef test(search): Ensure it doesn't panic when TimelineEvent::timestamp is used.
This patch adds a couple of tests:

- indexing a document with no timestamp works,
- indexing a document with a raw malformed timestamp panics (it's from
  Tantivy),
- indexing a document with a malformed timestamp coming from
  `TimelineEvent` doesn't panic.
2026-07-28 17:14:12 +02:00
Ivan Enderlin
df22b1cb75 feat(search): Build TantivyDocument by hand instead of using the doc! macro.
This patch replaces the `doc!` macro by building a `TantivyDocument`
by hand. It uses `add_text`, `add_date` etc., which uses
`add_leaf_field_value` under the hood, which is a bit faster than
`add_field_value` used by the `doc!` macro.

This patch also takes the small refactoring opportunity to ensure no
field is forgotten by destructing `self` and `event`. If a field is
added, the compiler will raise an error, focusing the attention to this
method. It's also a way to partially address [the warning from the
`doc!`'s documentation][doc]:

> The document hence created, is not yet validated against a schema.
> Nothing prevents its user from creating an invalid document missing a
> field, or associating a `String` to a `u64` field for instance.

Finally, this patch calls `TantivyDocument::shrink_to_fit` to shrink the
size of the document.

[doc]: https://docs.rs/tantivy/0.26.1/tantivy/macro.doc.html
2026-07-28 17:14:12 +02:00
Ivan Enderlin
6e9f696b24 fix(sdk): Use TimelineEvent::timestamp when building an IndexableEvent.
This patch prevents a bug when a malformed `origin_server_ts`
injected in an event can crash Tantivy if the value is too large, [it
overflows][1]:

```
tantivy-common-0.11.0/src/datetime.rs:65:30:
attempt to multiply with overflow
```

The fix consists of using the result of `TimelineEvent::timestamp` which
already deals with malformed `origin_server_ts`.

[1]: 31ca1a8ba2/common/src/datetime.rs (L62-L67)
2026-07-28 17:14:12 +02:00
Ivan Enderlin
4c5bac3ae1 refactor(search): Add IndexableEvent::new.
This patch adds the public constructor for `IndexableEvent` and makes
 all fields `pub(crate)` instead of `pub`. The idea is to use the `new`
 constructor to modify `timestamp` if needed.
2026-07-28 17:14:12 +02:00
Jorge Martín
63815eeda0 test(content-scanner): Add test to verify ContentScannerMediaFetcher decrypts encrypted media 2026-07-28 15:14:27 +02:00
Valere
ccd225e58e review: keep rtc_foci alias for compat and mark deprecated matrix-sdk-ffi/20260728 2026-07-28 14:43:52 +02:00
Valere
3ceee316cd add changelog 2026-07-28 14:43:52 +02:00
Valere
5257ba4d57 add short retry for fetch_rtc by default 2026-07-28 14:43:52 +02:00
Valere
87e138aec5 ffi: Use rtc transport discovery before well-known fallback 2026-07-28 14:43:52 +02:00
Valere
8e3c283cf3 fixup comment format 2026-07-28 14:43:52 +02:00
Valere
1814da55de refactor: rename rtc_foci to well_known_rtc_transports 2026-07-28 14:43:52 +02:00
Valere
d38809d6e0 feat(client): Support for RTC transports discovery 2026-07-28 14:43:52 +02:00
ganfra
f72a7ed66d doc(changelog): Add entry for call status FFI methods 2026-07-28 13:54:26 +02:00
ganfra
9d4be33e0c feat(ffi): Expose set/clear call status on Client 2026-07-28 13:54:26 +02:00
Alexandros Lykesas
ab701a360e feat(ffi): expose Room::send_single_receipt
Signed-off-by: Alexandros Lykesas <alexookah@me.com>
2026-07-28 13:20:33 +02:00
Damir Jelić
d2931eb561 Add changelogs for PR 6780 2026-07-28 11:22:10 +02:00
Damir Jelić
972ff26b0b docs(crypto): Document the decryption settings for the receive sync changes methods 2026-07-28 11:22:10 +02:00
Damir Jelić
a9ccb9e52a Use the correct msc number for the e2e-encyrption sync changes 2026-07-28 11:22:10 +02:00
Damir Jelić
3537c5050e test: Add tests to check that the one-time key count handling is correct 2026-07-28 11:22:10 +02:00
Damir Jelić
72730b6e1b fix(base): Use the appropriate sync changes method from the OlmMachine 2026-07-28 11:22:10 +02:00
Damir Jelić
c238d6cb7b feat(crypto): Add a specialized method to receive sync changes for sliding sync 2026-07-28 11:22:10 +02:00
Damir Jelić
290683a6d0 refactor(cyrpto): Move the body of the receive_sync_changes method into a helper
This is happening because we need different receive_sync_changes methods
based on the sync API we're using.
2026-07-28 11:22:10 +02:00
Damir Jelić
9763421baa refactor(crypto): Move the one-time key count handling logic to a more convenient place 2026-07-28 11:22:10 +02:00
Damir Jelić
e8b1bed777 doc(crypto): Improve the receive_sync_changes docs a bit 2026-07-28 11:22:10 +02:00
Jorge Martín
3e48e15af8 fix: Update the commit SHA for Ruma so it tracks the latest main plus our patch 2026-07-28 11:17:43 +02:00
Jorge Martín
d74020406c doc: Add changelog entry 2026-07-28 11:17:43 +02:00
Jorge Martín
0bd129f698 fix: Add the omit_checksums option to matrix-sdk-crypto-ffi too, since this crate is also affected. 2026-07-28 11:17:43 +02:00
Jorge Martín
5e2bf5ea61 fix: Use a custom UniFFI version with a patch to disable checksums
These checksums consistently fail on Android in ARM 32bit devices
2026-07-28 11:17:43 +02:00
Damir Jelić
5e7078edf3 chore: Remove the deny exception for proc-macro-error2 2026-07-28 09:28:19 +02:00
Yorusaka Miyabi
1960eb1f5c doc: Remove aquamarine usage
Signed-off-by: Yorusaka Miyabi <23130178+ShadowRZ@users.noreply.github.com>
2026-07-27 17:06:05 +02:00
dependabot[bot]
cd4b14d487 chore(deps): bump actions/setup-java from 5.4.0 to 5.6.0
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.4.0 to 5.6.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](1bcf9fb12c...03ad4de099)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-27 17:02:45 +02:00
dependabot[bot]
6f69f52674 chore(deps): bump zizmorcore/zizmor-action from 0.5.7 to 0.6.0
Bumps [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) from 0.5.7 to 0.6.0.
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](192e21d79a...6599ee8b7a)

---
updated-dependencies:
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-27 17:01:42 +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
Michael Goldenberg
6ceba03331 doc(indexeddb): add changelog file
Signed-off-by: Michael Goldenberg <m@mgoldenberg.net>
2026-07-27 11:19:06 +02:00