Commit Graph

13415 Commits

Author SHA1 Message Date
multi prise
0dfecd78d6 Updated the store encryption to use a enum Secret instead of passphrase 2025-09-24 12:35:17 +02:00
multi prise
4754ac2cbf Updated changelog 2025-09-24 12:35:17 +02:00
multi prise
72bb452b5b Remove all passphrase mention 2025-09-24 12:35:17 +02:00
multi prise
c17dbf9ebe Replace the passphrase logic with a key logic in the implementation of encrypted store 2025-09-24 12:35:17 +02:00
multi prise
5fd7c9e179 Add the key logic to the SqliteStoreConfig struct 2025-09-24 12:35:17 +02:00
Hubert Chathi
840ce43fed Add function to check if the user has another device to verify against (#5699)
Part of the fix for
https://github.com/element-hq/element-x-android/issues/4864 and
https://github.com/element-hq/element-x-ios/issues/4190

Allows applications to determine whether the user can verify against
another device in order to cross-sign their new device.
2025-09-24 11:31:42 +01:00
Benjamin Bouvier
e71d565346 test: add a test for is_threaded when the focused timeline points to an in-thread event 2025-09-23 17:43:22 +02:00
Benjamin Bouvier
5a06f5f351 test: use a RoomContextResponseTemplate builder pattern to create responses to /context 2025-09-23 17:43:22 +02:00
Benjamin Bouvier
1e01e3fc62 refactor(timeline): don't allocate a vector for the in-thread events when initially loading a thread permalink 2025-09-23 17:43:22 +02:00
Jorge Martín
bcba5f4571 chore(doc): Add changelogs 2025-09-23 14:13:34 +02:00
Jorge Martín
7736b50c04 fix(ui): Fix tests again.
The wrong pair of 'from' tokens were used for the forward paginations in the unit test
2025-09-23 14:13:34 +02:00
Jorge Martín
6e1dc121a5 fix(sdk+ui): Expose TimelineController::focus so the right backwards pagination case is used for focused thread pagination
Before, the same pagination as for the live thread timeline was used by mistake.

Fix the tests and check the right tokens are used for `/relations`.
2025-09-23 14:13:34 +02:00
Jorge Martín
08f0200174 refactor(sdk): Use .expect to unwrap the AnyPaginator, remove PaginationError::NotInstantiated
Also, improve the legibility of some usages
2025-09-23 14:13:34 +02:00
Jorge Martín
eda561e00e refactor(ffi): Replace derefs and add doc comment to thread_root_event_id 2025-09-23 14:13:34 +02:00
Jorge Martín
578320cefc fix(sdk): Make sure we only include the events received from the /context request that are part of the thread in the case where the event focus is for a threaded event
Modify the tests and mocks so this filtering is checked.
2025-09-23 14:13:34 +02:00
Jorge Martín
59ed28d3f8 refactor(sdk): add several helper functions to the AnyPaginator wrapper, use them where needed
Move `hide_threaded_events` from `TimelineEventFocusKind::Event` to `AnyPaginator::Unthreaded`
2025-09-23 14:13:34 +02:00
Jorge Martín
a0eecac8e0 chore(doc): Fix ThreadedEventsLoader::paginate_forwards docs 2025-09-23 14:13:34 +02:00
Jorge Martín
27ba6d070b feat(ffi): Expose TimelineEvent::thread_root_event_id 2025-09-23 14:13:34 +02:00
Jorge Martín
14ca34b09b feat(ffi): Add Room::load_or_fetch_event to the FFI layer
This way we can retrieve random events in a room and check their properties - this is needed to decide whether a permalink for an event should open in a thread or not
2025-09-23 14:13:34 +02:00
Jorge Martín
2166de7b0d refactor(sdk+ui): Make TimelineFocus::Event { paginator } generic
This way we can have the same focus handling both the focused event pagination in the main timeline with the `Paginator` and the focused event pagination in a thread with `EventThreadsLoader`.

The actual paginator is populated in `TimelineController::init_focus` after we call `/context` and can check if the event is part of a thread.
2025-09-23 14:13:34 +02:00
Jorge Martín
fd66ae9226 feat(sdk): Add forwards pagination to ThreadEventsLoader
Make the existing `token` field a new `tokens` one with `PaginationTokens` type.

# Conflicts:
#	crates/matrix-sdk/src/paginators/thread.rs
2025-09-23 14:13:34 +02:00
Shrey Patel
56100dfa00 chore(search): Update README. 2025-09-23 11:27:55 +02:00
Benjamin Bouvier
2b567e18bc refactor(timeline): don't require an ExactSizeIterator on replace_with_initial_remote_events
This is only used to know if the new events list is empty or not, which
we can figure thanks to a peekable iterator.
2025-09-22 15:31:02 +02:00
Benjamin Bouvier
a5e84230c7 chore(ffi): rejigger recent emoji code around so as to work with default features disabled
For some reason, running `cargo xtask ci clippy` locally would now fail,
complaining that the recent emoji functions didn't exist, in the FFI
layer. I suspect it's because some of the uniffi derive macro to export
functions incorrectly propagates the `cfg` guards; so a solution is to
move all this code under a new mod, that's enabled if and only if the
feature's enabled.
2025-09-22 11:42:10 +02:00
Benjamin Bouvier
bf4a46e8de chore: rename a few badly named variables in the sql event cache store 2025-09-22 11:20:49 +02:00
Ivan Enderlin
659ae57218 fix(ui): room_list::sorters::recency is no longer based on 2 data.
This patch fixes an issue where the `recency` sorter is based on either
the latest event's timestamp, or the room recency stamp. This cannot
work with a sort algorithm as the position of a particular room can
be different based on what it is compared to (i.e. if the rooms have a
latest event value or not).

This patch updates the `recency` sorter to only use the recency stamp
for now, as the latest event is not yet computed for all rooms.
sdk-ffi/20250923
2025-09-19 17:39:05 +02:00
Shrey Patel
dff6cb4414 refactor(search): Move RoomIndexBuilder into a submodule of index. 2025-09-19 16:37:09 +02:00
Shrey Patel
76348977d4 feat(search): Add encrypted search index support. 2025-09-19 16:37:09 +02:00
Shrey Patel
a66e6822ed refactor(search): Add RoomIndexBuilder to create RoomIndex. 2025-09-19 16:37:09 +02:00
Shrey Patel
b494303c07 feat(search): Implement an encrypted wrapper for a tantivy::directory::MmapDirectory. 2025-09-19 16:37:09 +02:00
Ivan Enderlin
0f0e37b677 chore: Update eyeball-im, eyeball-im-util and imbl.
This patch updates `eyeball-im` to 0.8.0, `eyeball-im-util` to 0.10.0
and `imbl` to 6.1.0.

The idea is to fix this bug https://github.com/jplatte/eyeball/pull/80.
2025-09-19 16:17:31 +02:00
Ivan Enderlin
fc12a7340f chore(ui): Add a temporary entries_with_dynamic_adapters_with.
This patch adds a temporary
`RoomList::entries_with_dynamic_adapters_with` method to help debug an
issue in Element X.
2025-09-19 15:55:57 +02:00
Shrey Patel
80390346b1 feat(multiverse): Add search indexing at startup. 2025-09-19 14:25:02 +02:00
Shrey Patel
4b87dfea0b feat(sdk): Lazily create RoomIndex on search. 2025-09-19 14:25:02 +02:00
Shrey Patel
79aa0ab60d feat(search): Add bulk processing. 2025-09-19 14:25:02 +02:00
Shrey Patel
a8ef44306a refactor(sdk): Move search index related code into its own module. 2025-09-19 14:25:02 +02:00
Shrey Patel
b929f3e569 fix(search): Remove unused IndexError variants. 2025-09-19 14:25:02 +02:00
Ivan Enderlin
1c737e6569 bench: Run the room_list benchmark in the CI. 2025-09-19 11:06:45 +02:00
Benjamin Bouvier
8ae88e1e45 refactor(sdk): make the update_in_memory_caches method infallible 2025-09-18 18:00:27 +02:00
Benjamin Bouvier
768f9bfdb6 doc: fix a typo in a doc comment of invite_acceptance_details 2025-09-18 18:00:27 +02:00
Benjamin Bouvier
864d6c1a43 perf: avoid recomputing room notification modes on every sync
Some background knowledge: the room notification modes are functions of
the push rules events, and they will only change when the push rules
event changes. As a result, there are only two cases where we need to
recompute them:

- when the push rules event changed, we need to recompute all the room
notification modes, in case one has changed;
- when we run into a new room, we need to compute an initial value for
its room notification modes.

Based on these observations, this improves the code to avoid recomputing
the room notification mode on every single sync response. Instead,
they're computed if and only if the push rules event has changed, or for
new rooms only.

Also, this avoids reconstructing one `NotificationSettings` object per
room, since this would load from the database each time. Instead, a
single object is created (at most), and its `Rules` object is directly
accessed, to avoid repeatedly taking the lock on its internal `rules`
field.

This makes it so that the time spent under this method from tens of
milliseconds to less than 1 millisecond, in testing. See the pull
request initial post for more numbers.
2025-09-18 18:00:27 +02:00
Benjamin Bouvier
da70aea5b0 feat(multiverse): allow not sharing pos at start
This is helpful to reproduce an initial sync response, and observe how
long it takes to process.
2025-09-18 18:00:27 +02:00
Benjamin Bouvier
1a9c7d5e2f test: add regression test that even if a room isn't in a sync response, its notification mode may be updated 2025-09-18 18:00:27 +02:00
Doug
9cd7760858 ffi: Expose is_direct on SpaceRoom. 2025-09-18 18:56:03 +03:00
Benjamin Bouvier
8575ed3f64 chore: define FrozenSlidingSyncPos only if the e2e-encryption feature is enabled
This caused compilation errors in other PRs, since the introduction of
Rust 1.90, which was able to detect this was unused otherwise.
2025-09-18 17:27:25 +02:00
Ivan Enderlin
1834f36136 doc(ui): Update the CHANGELOG.md file. 2025-09-18 15:38:16 +02:00
Ivan Enderlin
0bbefa000b chore(ui): Rename room_list_service::Room to RoomListItem.
This patch renames the `Room` type in `room_list_service` to
`RoomListItem` to avoid confusion with `matrix_sdk::Room`.
2025-09-18 15:38:16 +02:00
Ivan Enderlin
a84c97b292 feat(ui): Introduce room_list_service::Room to cache data.
This patch improves throughput by +710% in `room_list_service` sorters
and filters. It introduces a new `room_list_service::Room` type that
derefs to `matrix_sdk::Room`. However, it **caches** some data from
`matrix_sdk::Room`. Why doing so? Because filters, but more specifically
sorters!, are calling methods on `matrix_sdk::Room`, so likely on
`matrix_sdk::RoomInfo`, quite intensively. `RoomInfo` is behind a
`SharedObservable`, which means it's behind a lock. Each time a sorter
sorts 2 rooms, the lock on `RoomInfo` can be called twice or more.

By caching the data, `RoomInfo` is reached once per refresh data, but
not during the filtering nor the sorting. It greatly reduces contention
on the `RoomInfo` lock, which improves the throughput by +710%, and the
time by -87%.

The cached data are refreshed in `merge_stream_and_receiver` when
(i) the stream of `Room` is updated, or when (ii) the stream of
`RoomInfoNotableUpdate` is updated. It's a central place it happens,
which isolates the behaviour.
2025-09-18 15:38:16 +02:00
Ivan Enderlin
94267d9597 chore(base): Rename Room::inner to Room::info.
This patch renames the `Room::inner` containing the `RoomInfo` to
`Room::info`.
2025-09-18 15:38:16 +02:00
Ivan Enderlin
62eb1996d9 feat(base): Add new_latest_event_timestamp and new_latest_event_is_local.
This patch adds 2 methods on `RoomInfo`: `new_latest_event_timestamp`
and `new_latest_event_is_local`, which respectively returns
`LatestEventValue::timestamp` and `LatestEventValue::is_local`. The goal
is to avoid cloning a `LatestEventValue` when it's useless. For example,
in the room list sorters!

This patch also updates the room list sorters `recency` and
`latest_event` to use these new methods. It improves the speed and
throughput by 18%.
2025-09-18 15:38:16 +02:00