Commit Graph

13808 Commits

Author SHA1 Message Date
Jorge Martín
385f7aa86d doc: Fix docs for ffi::Timeline::latest_event_id 2025-11-18 12:26:30 +01:00
Jorge Martín
5f996f77c6 reafactor(ffi): Have ffi::Timeline::latest_event_id use ui::Timeline::latest_event_id, instead of ui::Timeline::latest_event
This is important because `latest_event` would also return local events, which won't have an event id.
2025-11-18 12:26:30 +01:00
Jorge Martín
02491fc6ec test: Add test for TimelineController::latest_event_id 2025-11-18 12:26:30 +01:00
Jorge Martín
0f62ff991d fix clippy 2025-11-18 12:26:30 +01:00
Jorge Martín
6b245264e1 fix(test): Fix broken test locally: it was using a previous cached value before 2025-11-18 12:26:30 +01:00
Jorge Martín
f7b92c84e7 fix(ui): Sending read receipt in live timeline when latest event is in a thread
Previously, this used the latest event in the thread as the event to mark as read, while this is not right if we're in a context that hides thread events
2025-11-18 12:26:30 +01:00
Jorge Martín
4eb3cc9812 refactor(ffi): Remove unused Session::homeserver_url value 2025-11-18 12:16:28 +01:00
Jorge Martín
95d8ba94e1 doc: Add warnings about overriding the server URL
This may be dangerous when done while restoring an existing session.
2025-11-18 12:16:28 +01:00
Andy Balaam
ca436016b4 base: Bump ruma to 91424b1fc
And update to reflect the new feature name unstable-msc4362, which
provides the new unstable prefix io.element.msc4362.encrypt_state_events
2025-11-18 11:10:55 +00:00
Andy Balaam
5b82550199 crypto: Wait for a stream in state encryption test
This was sometimes failing for me locally, so use a macro that expects a
value from a stream soon, rather than immediately.
2025-11-18 11:10:55 +00:00
Andy Balaam
5d396e4795 crypto: Refer to MSC4362 when we are talking about encrypted state 2025-11-17 09:40:47 +02:00
Richard van der Hoff
9ab886fa2b crypto: Merge inbound Megolm sessions [#5865]
When we receive two copies of the same inbound Megolm session from two sources, merge them together intelligently.

Fixes: #5108, #4698
2025-11-13 19:06:44 +00:00
Richard van der Hoff
60072b3456 Integ test for merging megolm sessions with history sharing
Add an integration test that checks that, when we receive a copy of a megolm
session directly after having previously received it via history sharing, we
get the best bits of both.
2025-11-13 18:37:18 +00:00
Richard van der Hoff
822b1c9787 crypto: replace uses of compare_group_session
... with `merge_received_group_session`.

`merge_received_group_session` expands the logic of `compare_group_session` to
handle the fact that there is more than one axis of "better" or "worse" and we
may need to take the best bits of two copies of the session.
2025-11-13 18:37:18 +00:00
Richard van der Hoff
52344fad77 crypto: Add new method Store::merge_received_group_session
Add a method which can be used to merge a received `InboundGroupSession` into
whatever we find in the store.
2025-11-13 18:37:18 +00:00
Richard van der Hoff
97ba0b1bbb crypto: factor out InboundGroupSession.compare_ratchet
In order to correctly merge sessions, we need more granular comparisons between
two sessions than just "Better" or "Worse", so factor out a method that *just*
looks at the ratchet states.
2025-11-13 13:51:25 +00:00
JoFrost
17df3f84d0 feat(ffi): expose join_rules in OtherState::RoomJoinRules (#5863)
Expose the room join rules in the `OtherState::RoomJoinRules` event 
for the FFI timeline.

It reuses the existing `JoinRules` type from the client module and
converts the event content accordingly. This allows clients to inspect
the room’s current join rule directly from the event. Like `m.federate`,
this field was previously unavailable in the FFI variant of the SDK.

---------

Signed-off-by: JoFrost <20685007+JoFrost@users.noreply.github.com>
2025-11-13 15:20:17 +02:00
Damir Jelić
4fbc83af44 Merge pull request #5746 from matrix-org/poljar/event-cache/redecryptor 2025-11-13 12:19:51 +01:00
Damir Jelić
9508675aca fix(redecryptor): Early return if we don't have any events to process 2025-11-13 11:59:21 +01:00
Damir Jelić
0d08ed0758 refactor(redecryptor): Add some type aliases for the event ID/event tuples 2025-11-13 11:59:21 +01:00
Damir Jelić
913ebe9fa9 docs(redecryptor): Clarify that we're talking about the UI timeline in the r2d2 docs 2025-11-13 11:59:05 +01:00
Jorge Martin Espinosa
f702364fe9 feat(sdk): Add a power level value field for StateEventType::SpaceChild (#5857)
Closes https://github.com/matrix-org/matrix-rust-sdk/issues/5839

Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
2025-11-13 07:17:57 +00:00
Jonas Platte
1db4a4cb9a Use MSRV-aware resolver 2025-11-12 14:58:30 +01:00
Damir Jelić
2e9e9aedd7 chore(redecryptor): Ensure the upgrade_event_cache method is inlined 2025-11-12 13:31:37 +01:00
Damir Jelić
38df621b8a chore(event-cache): Limit the visibility of post_process_new_events 2025-11-12 13:31:37 +01:00
Damir Jelić
f9c23b3612 refactor(redecryptor): Use an abort handle to manage the redecryption task 2025-11-12 13:31:37 +01:00
Damir Jelić
952c5af07c chore(redecryptor): Time how long it takes to replace UTDs 2025-11-12 12:56:21 +01:00
Damir Jelić
717f016f21 docs(redecryptor): Add some docs to the Redecryptor struct itself 2025-11-12 12:55:58 +01:00
Damir Jelić
3ad70623bb chore(redecryptor): Use relative imports more often 2025-11-12 12:55:19 +01:00
Damir Jelić
84a21a42d0 fix(event-cache): Don't hold on to the event cache locks as long when fetching events 2025-11-12 12:54:32 +01:00
Damir Jelić
d2eab603c1 fix(event-cache): Limit the visibility of room_linked_chunk_mut a bit better 2025-11-12 12:51:35 +01:00
Andy Balaam
8883b9db5a Improve the wording of error messages when redecryption fails
The previous message implied that we had received a session for this
message, but that is only one of the several reasons we might encounter
this situation. If redecryption failed, it is more likely we got here
because we'd been asked to attempt redecryption for all UTDs e.g. when
we build a new timeline.

Additionally, having similar wording for the error case and the unable
to decrypt case could also cause confusion, so I adjusted the wording to
make clear which situation is happening.
2025-11-12 11:47:55 +00:00
Ivan Enderlin
a3424a7c4a feat(base): Explicitly handle the CrossProcessLockKind::Dirty case in MediaStore.
This patch replaces the `into_guard()` call by a `match` over
`CrossProcessLockKind` so that the `Dirty` case is explicitly handled.

The mid-term idea is to remove the `into_guard()` method because it
is “dangerous” as it hides the `Dirty` case.
2025-11-11 15:12:27 +01:00
Ivan Enderlin
fa3ca980e9 doc(common): Explain how to clear a dirty cross-process lock. 2025-11-11 15:12:27 +01:00
Jorge Martín
cbd4722dcb doc: Add changelog entry 2025-11-11 14:50:00 +01:00
Jorge Martín
a22caa32c0 misc: Add better default target-feature values for Android in ARM64 devices 2025-11-11 14:50:00 +01:00
Damir Jelić
f61ba4f47c fix(ui): Don't do a authenticated /versions call when building the roomlist service 2025-11-11 14:37:10 +01:00
Damir Jelić
9a3857d3a7 feat(client): Add a method to only get the server versions from the cache 2025-11-11 14:37:10 +01:00
Ivan Enderlin
e79f832160 fix(ui): Undo an optimisation to start at SettingUp.
This patch undo an optimisation that was initialising the
`RoomListService` at the `SettingUp` state if a `pos` value was
recovered successfully (see bbf9bf2c0b).
The problem is that it starts with a range of 0..99 instead of 0..19,
which can slow things done in particular cases. Whilst a good idea on
paper, it's not in practise. So let's continue to recover the `pos`, but
let's keep starting at the `Init` state.
2025-11-11 13:12:02 +01:00
Ivan Enderlin
46d05d877b fix(base): Remove a panic in a log.
We must not panic if the event has no event ID.
2025-11-11 11:15:59 +01:00
Ivan Enderlin
610f82aeb2 chore(sqlite): Remove connection::Config.
This patch removes the `connection::Config` type. It was “inspired”
from `deadpool_sqlite`, but we can clearly remove it by using our own
`SqliteStoreConfig` type. It simplifies the way we open a database.
2025-11-11 11:09:18 +01:00
Ivan Enderlin
60490f4eff doc(sqlite): Add documentation to connection.
This patch explains why we create our own implementation of `deadpool`
for `rusqlite`.
2025-11-11 11:09:18 +01:00
Ivan Enderlin
6a828e31dd feat(sqlite): Replace deadpool-sqlite by our own implementation.
This patch replaces `deadpool-sqlite` by our own implementation in
`crate::connection`. It still uses `deadpool` but the object manager has
a different implementation.
2025-11-11 11:09:18 +01:00
dependabot[bot]
fff270d997 chore(deps): bump CodSpeedHQ/action from 4.3.1 to 4.3.3
Bumps [CodSpeedHQ/action](https://github.com/codspeedhq/action) from 4.3.1 to 4.3.3.
- [Release notes](https://github.com/codspeedhq/action/releases)
- [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md)
- [Commits](4348f634fa...bb005fe1c1)

---
updated-dependencies:
- dependency-name: CodSpeedHQ/action
  dependency-version: 4.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-11 09:19:04 +01:00
Johannes Marbach
a50ecb5b18 refactor(oauth): remove superfluous join in QR login tests
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-11-11 09:18:16 +01:00
Ivan Enderlin
18654444b6 doc(sdk): Remove a dead reference in the doc.
This patch removes the reference to `Update`, that is no longer required.
2025-11-11 09:17:34 +01:00
dependabot[bot]
10ff5d0cc6 chore(deps): bump bnjbvr/cargo-machete
Bumps [bnjbvr/cargo-machete](https://github.com/bnjbvr/cargo-machete) from e7d460faa33cbba452e69e8b1700e6a75e8a72b8 to 04b9adbd8c1c00963289b5628510dd907b27dc60.
- [Release notes](https://github.com/bnjbvr/cargo-machete/releases)
- [Changelog](https://github.com/bnjbvr/cargo-machete/blob/main/CHANGELOG.md)
- [Commits](e7d460faa3...04b9adbd8c)

---
updated-dependencies:
- dependency-name: bnjbvr/cargo-machete
  dependency-version: 04b9adbd8c1c00963289b5628510dd907b27dc60
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 18:26:12 +01:00
Johannes Marbach
f9584f5b2a feat(ffi): add sender and room information to sync notifications
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-11-08 09:30:11 +01:00
Damir Jelić
66619e9d1d test(oauth): Pass the rendezvous server to the bob task as well
This avoids the scenario where the mock server gets deallocated before
the rendezvous server and thus the rendezvous specific mock guards.

Dropping those in the wrong order will result in a panic.
2025-11-08 09:29:30 +01:00
Damir Jelić
2ea1c42a1a test(oauth): No need to use join in the qrcode login granting tests 2025-11-08 09:29:30 +01:00