Commit Graph

7069 Commits

Author SHA1 Message Date
Benjamin Bouvier
7db45a4b23 chore: move the refresh_token_lock into the AuthCtx 2023-09-07 10:34:54 +02:00
Benjamin Bouvier
4802a50609 chore: put handle_refresh_tokens in the AuthCtx 2023-09-07 10:34:54 +02:00
Benjamin Bouvier
28ab8e9efc chore: remove Client::authentication_server_info as it's duplicated from Oidc::authentication_server_info 2023-09-07 10:34:54 +02:00
Benjamin Bouvier
44a13fac9f chore(client): introduce AuthCtx to contain all data relative to auth(entication|orization) 2023-09-07 10:34:54 +02:00
Ivan Enderlin
74c5c2825a test(ci): Exponential backoff when retrying flaky tests
test(ci): Exponential backoff when retrying flaky tests
2023-09-07 09:51:17 +02:00
Ivan Enderlin
f08524baa6 test(ci): Exponential backoff when retrying flaky tests.
This patch changes the backoff strategy from `fixed` to `exponential`
when a flaky test is retried. The `count` value is also updated to
3. Finally, we try to avoid the thundering herd problems with `jitter
= true`.
2023-09-07 09:12:29 +02:00
Ivan Enderlin
29fecf5109 test(ui): Adjust request_margin to avoid a flaky test
test(ui): Adjust `request_margin` to avoid a flaky test
2023-09-06 20:50:44 +02:00
Ivan Enderlin
c5e4ea4e3c test(ui): Adjust request_margin to avoid a flaky test. 2023-09-06 20:34:57 +02:00
Damir Jelić
9174f120b4 Expose the user identities and devices streams in the main crate 2023-09-06 19:00:37 +02:00
Damir Jelić
578c1a473a Broadcast new and updated devices 2023-09-06 19:00:37 +02:00
Damir Jelić
53c4735944 Broadcast new and updated user identities 2023-09-06 19:00:37 +02:00
Damir Jelić
7419b2c86b Add our user ID to the CryptoStoreWrapper
This will become useful once we start broadcasting user identity
updates, we'll need to know which user identity is our own.
2023-09-06 19:00:37 +02:00
Ivan Enderlin
64bdbdcbaa feat(ui): Implement RoomListService::sync_indicator
feat(ui): Implement `RoomListService::sync_indicator`
2023-09-06 17:56:11 +02:00
Ivan Enderlin
b8ed566d78 feat(ffi): Add bindings for RoomListService::sync_indicator.
This patch adds the `RoomListService::sync_indicator` method, along
with the `RoomListServiceSyncIndicatorListener` callback interface, and
`RoomListServiceSyncIndicator` enum.
2023-09-06 17:16:36 +02:00
Ivan Enderlin
8a1ff1967f feat(ui): Implement RoomListService::sync_indicator.
This patch implements a new method: `RoomListService::sync_indicator`.
It returns a `impl Stream<Item = SyncIndicator>` where `SyncIndicator`
is a new enum with 2 variants: `Show` and `Hide`.

`SyncIndicator` is the UI equivalent of a sync spinner/loader/toaster,
that the app might want to show to the user to indicate when a _first_
request is sent and might be slow, i.e. the first response is taking
a little bit of time to come. The term _first_ may be innapropriate as
it covers the actual first sync request, but also the recovering sync
request. It means that when a sync error happened, the sync indicator
will be shown too, which is a pretty useful information for the user.

It's not because a `SyncIndicator` should be shown that it must be send
immediately onto the `Stream`. In case of a normal network conditions,
without any delay, it can lead to a “blinking” visual effect. Some
constants configure how long it takes to consider that a request is
“slow”, and that the `SyncIndicator` is necessary to be shown (or
hidden).
2023-09-06 17:16:36 +02:00
Jonas Platte
2787d058de ui: Remove Option from return type
… of TimelineItemContent::from_suitable_latest_event_content.
It had no branches that returned None.
2023-09-06 12:59:08 +02:00
Jonas Platte
57ba63d432 base: Allow redacted events as latest event 2023-09-06 12:59:08 +02:00
Ivan Enderlin
acb731af2f fix: & without an explicit lifetime name cannot be used here
fix: `&` without an explicit lifetime name cannot be used here
2023-09-06 11:04:50 +02:00
Richard van der Hoff
3f3f599877 Add OlmMachine::get_room_event_encryption_info (#2510)
Since the verification status of an event can change, we need to be able to
refetch the verification status without doing the whole decryption dance.

Hence, we expose a new `get_room_event_encryption_info` method.
2023-09-06 10:03:15 +01:00
Richard van der Hoff
d116e31733 Implement new CryptoStoreWrapper (#2515)
... so that `VerificationStore` and `StoreInner` can share the same
`save_changes` impl which broadcasts updates to the broadcast channels.
2023-09-06 09:57:40 +01:00
Ivan Enderlin
f13282ea30 fix: & without an explicit lifetime name cannot be used here.
This was previously accepted by the compiler but is being phased out;
it will become a hard error in a future release! See https://github.com/
rust-lang/rust/issues/115010.
2023-09-06 09:37:51 +02:00
Benjamin Bouvier
896f62eb68 fix(tests): don't reuse the same store name in multiple tests 2023-09-05 18:45:51 +02:00
Benjamin Bouvier
cc469f6d4a chore: derive Default for the state MemoryStore 2023-09-05 15:44:31 +02:00
Jonas Platte
2d47aecd37 Remove the appservice feature from matrix-sdk, matrix-sdk-test 2023-09-05 15:40:38 +02:00
Jonas Platte
7d674b39aa Remove matrix-sdk-appservice
There is unfortunately no capacity for maintaining it as a first-party
component of the Rust SDK.
2023-09-05 15:40:38 +02:00
Benjamin Bouvier
11b3be1a03 feat(notification client): always retry decryption if it failed before
Now that we can decrypt on both of {single|multi} process setups (i.e. available for both android
and ios), we can enable retrying decrypting notifications by default.
2023-09-05 14:17:41 +02:00
Benjamin Bouvier
f13adb24dd feat(sync service): enable the encryption sync by default 2023-09-05 14:17:41 +02:00
Benjamin Bouvier
94cfa9fc12 chore(tests): move check_requests from encryption_sync_service to sliding_sync helper file 2023-09-05 14:17:41 +02:00
Benjamin Bouvier
3d89d750fb chore: rename EncryptionSync to EncryptionSyncService 2023-09-05 14:17:41 +02:00
Benjamin Bouvier
242c5bcb37 chore(ui): move xyz/mod.rs to xyz.rs for the encryption_sync and sync_service 2023-09-05 14:17:41 +02:00
Benjamin Bouvier
d6f0635023 chore: clippy + review feedback 2023-09-05 11:17:14 +02:00
Benjamin Bouvier
ea2826aac6 chore(FFI): update bindings for changes to the NotificationClient builder 2023-09-05 11:17:14 +02:00
Benjamin Bouvier
508091af80 feat: use the encryption sync permit from the SyncService in the NotificationClient
Also rejigger the parameters passed to the notification client builder, so that it's always required to pass
a process setup. With that, we're one step closer to removing the retry_decryption() function and enable it
by default.
2023-09-05 11:17:14 +02:00
Benjamin Bouvier
de9b6d25cd feat: have the SyncService own the EncryptionSyncPermit and add try_get_encryption_sync_permit 2023-09-05 11:17:14 +02:00
Benjamin Bouvier
9469b77741 feat: add an EncryptionSyncPermit object allowing to use an EncryptionSync
The comment above the type should help understanding what it is about.
2023-09-05 11:17:14 +02:00
Jonas Platte
06ec19b50b ui: Add test for transfering reply details 2023-09-05 10:39:48 +02:00
Jonas Platte
bd99c5e72b ui: Transfer reply details from old to new item when receiving dup event 2023-09-05 10:39:48 +02:00
Jonas Platte
bdddb0ce7a ui: Move reply test into a separate module 2023-09-05 10:39:48 +02:00
Jonas Platte
73a9cd40d3 sdk: Remove warning about event without txn ID
… it doesn't make sense to have as long as it's still very common to get
duplicate non-echo events from the SS proxy.
2023-09-05 10:39:48 +02:00
Ivan Enderlin
465c9bcbed test(ui): Test Timeline is reset when a user is ignored/unignored. 2023-09-04 17:39:02 +02:00
Jonas Platte
4f2477fbe8 ui: Reset the timeline when ignore user list changes 2023-09-04 17:39:02 +02:00
Ivan Enderlin
cf419566e8 feat(ui): TimelineInnerStateLock::lock is replaced by ::read and ::write
feat(ui): `TimelineInnerStateLock::lock` is replaced by `::read` and `::write`
2023-09-04 15:44:13 +02:00
Damir Jelić
e835d9a1cc The export_room_key method does not encrypt the room keys nor does it panic 2023-09-04 15:39:10 +02:00
Ivan Enderlin
91784ded72 feat(ui): TimelineInnerStateLock::lock is replaced by read and write.
The `Timeline` batches its updates to its subscribers (e.g. a client app,
like Element X). A batch is built every time the inner state lock of
the `Timeline` is released. On the paper, it's nice; in practise, even
a read operation on the `Timeline` leads to building a new batch. This
is inefficient and consumes resources (like CPU cycles, FFI boundary
crossings, memory allocations etc.) even if there is no update to put in
the batch: this will just batch empty updates.

To avoid that, one needs to make the difference between read or write
operations onto the inner state. Only the write operations will fire a
batch.

This patch splits the `TimelineInnerStateLock::lock` method into
`::read` and `::write`. The idea is that a read-only lock doesn't
hold a clone of the lock release observer (`lock_release_ob:
SharedObservable<()>`), it will not notify the observer. Then it's only
the write lock that holds a clone of the lock release observer, and will
notify it.

This patch updates the code accordingly as best as possible.
2023-09-04 15:05:52 +02:00
Benjamin Bouvier
e8e7738dfa chore: introduce fail! macro to avoid repetitive work 2023-09-01 16:06:46 +02:00
Benjamin Bouvier
2d5f5879ab chore: remove spurious clone 2023-09-01 16:06:46 +02:00
Benjamin Bouvier
0162e62feb fix: don't save the latest_id_token upon refresh (thanks @zecakeh!) 2023-09-01 16:06:46 +02:00
Benjamin Bouvier
d37656d9f0 chore: use a hash() function instead of hashing manually 2023-09-01 16:06:46 +02:00
Benjamin Bouvier
5451d39ba3 chore: move notification within the refresh_access_token_inner function 2023-09-01 15:15:02 +02:00
Benjamin Bouvier
a17a7608f3 chore: add more focused logs for OIDC 2023-09-01 15:15:02 +02:00