Commit Graph

9556 Commits

Author SHA1 Message Date
Valere 3d3f93a33d crypto: Verified identity changes TDD 2024-08-07 13:29:57 +02:00
Valere b4fe3059c3 crypto: Remember and detect verified identity changes for #1129 2024-08-07 13:29:57 +02:00
Jorge Martín 57963dcf36 ffi: add method for the ClientBuilder to provide a RequestConfig for the client 2024-08-07 11:48:34 +02:00
Jorge Martín 7d9fdc4f05 sdk-ui: add fn Room::event_with_config
This method works the same as `Room::event` but you can provide a custom `RequestConfig` to it.

It's especially useful for the pinned events timeline, since we need a max number of retries and a max number of concurrent requests. With this we can remove some unnecessary complexity.
2024-08-07 11:48:15 +02:00
Jorge Martín 1c4f035c99 sdk-ui: reverse (again) the order in the pinned events timeline
This way it matches the rest of timelines in the SDK, I reversed it here because I didn't realise most clients just do this reversal of ordering themselves. As they do, they need the same order for this timeline too to be able to reuse their existing logic.
2024-08-06 19:33:00 +02:00
Doug 71e4f60fa5 chore: Update the human readable description for the SentInClear shield. 2024-08-06 17:22:38 +03:00
Damir Jelić c3848ca016 crypto: Update the changelog 2024-08-06 15:10:13 +02:00
Damir Jelić a74f6bcc3f Add the Olm Session cache back in the CryptoStoreWrapper 2024-08-06 15:10:13 +02:00
Damir Jelić ba7fb7fc36 Convert all SessionStore locks to be async locks 2024-08-06 15:10:13 +02:00
Damir Jelić 96b615ba8e Remove Olm Session cache from the individual crypto store implementations 2024-08-06 15:10:13 +02:00
Jorge Martín c83fa3a532 sdk-ui: move conversion between Content::RoomPinnedEvents from ffi to sdk-ui 2024-08-06 10:37:18 +02:00
Jorge Martín d509d79472 ffi: add RoomPinnedEventsChange and a diffing step to know what happened in the last pinning/unpinning events action 2024-08-06 10:37:18 +02:00
Andy Balaam ffba842919 crypto: Don't recalculate SenderData if the sender is known but not verified 2024-08-06 09:34:21 +01:00
Jorge Martín 91c10ae213 sdk-ui: add PinnedEventsLoaderError::TimelineReloadFailed.
This error will be returned when the room has pinned event ids but the timeline couldn't load any of them.

Also fix tests.
2024-08-05 16:56:49 +02:00
Andy Balaam efdd6d2693 crypto: Use most-trusted SenderData available when decrypting 2024-08-05 15:46:08 +01:00
Andy Balaam 08bc563e9e crypto: Methods on SenderData for comparing trust level 2024-08-05 15:46:08 +01:00
Jorge Martín 71b5ab4d07 sdk-ui: fix pinned_events tests 2024-08-05 14:31:03 +02:00
Jorge Martín 4569b25d98 bench: fix benchmark by adding encryption event and clearing the cache in each iteration 2024-08-05 14:31:03 +02:00
Jorge Martín 9f7f1a98fb ffi: base the ffi::Room::clear_pinned_events method in sdk::Room::clear_pinned_events 2024-08-05 14:31:03 +02:00
Jorge Martín 4432b332fa sdk: add Room::clear_pinned_events 2024-08-05 14:31:03 +02:00
Jorge Martín d846563df3 sdk-ui: use reversed chronological order for TimelineFocus::PinnedEvents 2024-08-05 14:31:03 +02:00
Doug b453a0204e sdk-ui: Make the SentInClear shield red. 2024-08-05 10:48:06 +02:00
Doug 4c220ed030 shields: Put the Code inside the Colour instead of the Colour inside the Code. 2024-08-05 10:48:06 +02:00
Doug 037badf7a4 chore: Strongly typed ShieldStates. 2024-08-05 10:48:06 +02:00
Jorge Martín fba61751d5 sdk-ui: extract MAX_CONCURRENT_REQUESTS const for PinnedEventsLoader 2024-08-02 18:54:28 +02:00
Jorge Martín 2bd4db8a23 sdk-ui: use PinnedEventsLoader::update_if_needed when new timeline events are received. Using PinnedEventsLoader::load_events here was a mistake. 2024-08-02 18:54:28 +02:00
Jorge Martín 4de1375a76 ffi: add bindings for Room::clear_pinned_events_cache 2024-08-02 18:54:28 +02:00
Jorge Martín 1353406b80 sdk-ui: add Room::clear_pinned_events_cache to remove any cached pinned events from a room 2024-08-02 18:54:28 +02:00
Jorge Martín e1bffaee21 sdk: add PinnedEventCache::remove_bulk to be able to remove events from the cache 2024-08-02 18:54:28 +02:00
Jorge Martín 0496ef4313 sdk-ui: add test checking the pinned event cache is kept for different room instances 2024-08-02 18:54:28 +02:00
Jorge Martín 674605aeab sdk-ui: use the moved PinnedEventCache instead of the one encapsulated in PinnedEventsLoader 2024-08-02 18:54:28 +02:00
Jorge Martín f1b20a8ea5 sdk: add PinnedEventCache to Client.
This ensures the cache keeps the events even when the associated `Room` is dropped, which is what we want when using it to cache the pinned events for rooms in the client.

Add `fn Client::pinned_event_cached()` to get a reference to it.
2024-08-02 18:54:28 +02:00
Jorge Martín d1fe27c969 sdk: move PinnedEventCache from sdk-ui 2024-08-02 18:54:28 +02:00
Jorge Martín 769a627496 ci: try fixing the kotlin bindings tests by using NDK 27 2024-08-02 17:28:36 +02:00
Timo aff7aefd28 WidgetDriver: don't specify the length of the serializer. Its not needed for the json serializer. 2024-08-02 15:14:09 +01:00
Timo d60b9d3da2 Changelog: Add delayed event to the widget driver.
Also mention the breaking change in the public widget capabilities interface.
2024-08-02 15:14:09 +01:00
Timo 8d5dc18dd3 IntegrationTests: Add integration tests for the WidgetDriver delayed events. 2024-08-02 15:14:09 +01:00
Timo 49790c9f91 WidgetDriver: wire up everything in the widget process action handler. 2024-08-02 15:14:09 +01:00
Timo 2e8b135859 WidgetDriver: Add interacting with delayed event to the matrix driver.
In `matrix.rs` we add methods to interact with the matrix homeserver. And in `machine/mod.rs` we implement the widgetMachine cases for handling (checking capabilities and using the matrixDriver) delayed events.
2024-08-02 15:14:09 +01:00
Timo 7614bfb716 WidgetDriver: Introduce new capabilities for sending and updating delayed events.
Those capabilities are also exposed to the FFI.
+ related tests
2024-08-02 15:14:09 +01:00
Timo 0407dd7eb1 WidgetDriver: Introduce new Delay Event update widget action types.
Also update the naming from `future` to `delay` in existing types.
2024-08-02 15:14:09 +01:00
Timo 16a638400c chore: Update ruma to a version supporting authenticated delayed events. 2024-08-02 15:14:09 +01:00
torrybr be6bc444f8 chore: fix formatting 2024-08-02 15:42:54 +03:00
torrybr 36091a9ef3 sdk: refactor beacon_info tests into their own folder 2024-08-02 15:42:54 +03:00
Stefan Ceriu 1160383d71 sdk: fix identity reset not actually disabling backups when not enabled locally, resulting in conflicts and failing to correctly setup the newly reset session 2024-08-02 15:25:42 +03:00
Stefan Ceriu d7f3914673 sdk: throw an error instead of silently failing when disabling backups if they weren't previously enabled locally
- also change back the state from `disabling` to `unknown`
2024-08-02 15:25:42 +03:00
Jorge Martín 1ca4377baf ffi: add FFI bindings for creating the new pinned events focused timeline 2024-08-02 13:11:24 +02:00
Jorge Martín ab12f2f7ca sdk-ui: add and fix tests 2024-08-02 13:11:24 +02:00
Jorge Martín 6889430474 benchmark: add a benchmark to measure how loading pinned events performs 2024-08-02 13:11:24 +02:00
Jorge Martín 382c573973 sdk-ui: add TimelineFocus::PinnedEvents and TimelineFocusData::PinnedEvents to load the live pinned events for a room.
Add `PinnedEventsLoader` to encapsulate this logic, being able to provide a max number of events to load and how many can be loaded at the same time. Also implement an event cache for it.

 Add `PinnedEventsRoom` trait to use it in the same way as `PaginableRoom`, only for pinned events.
2024-08-02 13:11:24 +02:00