Commit Graph

13223 Commits

Author SHA1 Message Date
Benjamin Bouvier dcfea138ea chore: tweak sliding sync tracing context
- include the conn_id at the stream level, not the sync_once level (that's a child scope of the stream)\
- also include whether e2ee is enabled at this level
- shorten most static logs
- remove duplicate "sending request" logs
2023-07-31 11:31:12 +02:00
Benjamin Bouvier eb7e01e8b1 chore: lower log-levels when processing sliding sync in sdk-base 2023-07-31 11:31:12 +02:00
Damir Jelić c22f6da909 Add a js feature to the qrcode crate 2023-07-31 10:08:53 +02:00
Damir Jelić 4eba72774f Bump vodozemac 2023-07-31 10:08:53 +02:00
Jonas Platte d149782e6a ui: Reuse ID when replacing UTD after retrying decryption 2023-07-31 09:53:58 +02:00
Jonas Platte 0c3d46eb1e ui: Move some functions into new timeline::util module 2023-07-31 09:53:58 +02:00
Jonas Platte 7dfe8cedbb ui: Move timeline item creation helpers into TimelineInnerState 2023-07-31 09:53:58 +02:00
Jonas Platte e5f021f5cf ui: Simplify definition of TimelineEventHandler
Take a mutable reference to TimelineInnerState, instead of individual
mutable references to its fields.
2023-07-31 09:53:58 +02:00
Jonas Platte 05c5fdd839 ui: Move Flow into EventHandlerContext 2023-07-31 09:53:58 +02:00
Jonas Platte c15ac3978e ui: Rename EventHandlerMetadata to EventHandlerContext 2023-07-31 09:53:58 +02:00
Jonas Platte 4b2cc20c6b ui: Move TimelineInner::*_internal to TimelineInnerState 2023-07-31 09:53:58 +02:00
Jonas Platte 18590c8813 ui: Move update_timeline_reaction to TimelineInnerState 2023-07-31 09:53:58 +02:00
Jonas Platte b78abd62c0 ui: Move TimelineInnerState into its own module 2023-07-31 09:53:58 +02:00
Jonas Platte b425812fd8 ui: Remove explicit default generic argument 2023-07-31 09:53:58 +02:00
Benjamin Bouvier f57b6f5491 chore(test): don't use the same database name in multiple independent tests
This should make the test less flaky.
2023-07-28 19:17:01 +02:00
Benjamin Bouvier 18e283fee9 chore: add TODO explaining that this field should be put back into the OlmMachine later 2023-07-28 15:21:12 +02:00
Benjamin Bouvier a3291a3627 fix: store the crypto store known generation in the Client, not the OlmMachine 2023-07-28 15:21:12 +02:00
Benjamin Bouvier deb8434ee9 test: add a regression test for the spurious crypto store regeneration 2023-07-28 15:21:12 +02:00
Damir Jelić 63ce957843 fix: don't rely on having sessions in cache priori to encrypting a message 2023-07-28 15:06:12 +02:00
Benjamin Bouvier 819b46f2fb test: add regression test for invalidating the OlmMachine while sending a message 2023-07-28 15:06:12 +02:00
Marco Romano 5c71087b9c Upgrade Ruma
This is to pave the way to the upcoming "polls" work.
2023-07-28 08:38:50 +00:00
Jonas Platte d865665420 ffi: Replace tracing-android by paranoid-android 2023-07-27 18:25:15 +02:00
Jonas Platte 5f5028ddd0 ffi: Remove redundant dependency specification 2023-07-27 18:25:15 +02:00
Jonas Platte 8703fea24f ffi: Simplify OTLP tracing initialization 2023-07-27 18:25:15 +02:00
Benjamin Bouvier ab363aa420 chore: slim down UpdateSummary 2023-07-27 17:21:36 +02:00
Jonas Platte b66cd58a60 ui: Reduce work for updating sender profiles
… we should not be fetching the profile if it's already set.
2023-07-27 16:45:57 +02:00
Ivan Enderlin 7892b8b74a feat(sdk+ui+ffi): Implement (SlidingSyncRoom|Room|RoomListItem)::avatar_url
feat(sdk+ui+ffi): Implement `(SlidingSyncRoom|Room|RoomListItem)::avatar_url`
2023-07-27 16:33:33 +02:00
Jonas Platte fc3883d08e ffi: Remove async from a few functions
… to hopefully work around current issues.
2023-07-27 12:37:02 +02:00
Ivan Enderlin c2a8fbd3c9 feat(ui): Implement the “fuzzy match room name” filter
feat(ui): Implement the “fuzzy match room name” filter
2023-07-27 12:32:47 +02:00
Andrew Ferrazzutti 53668d764c Return a KeysBackupRequest instead of the more generic OutgoingRequest 2023-07-27 12:12:08 +02:00
Ivan Enderlin 936a2ee25b chore(sdk): Remove one TODO in Sliding Sync
chore(sdk): Remove one `TODO` in Sliding Sync
2023-07-27 10:37:45 +02:00
Benjamin Bouvier 1f10af9fa9 chore(encryption): replace some AuthenticationRequired with NoOlmMachine
Even if the two issues are likely caused by the same root cause (the user not being
authenticated), they should be used in different contexts, in my understanding:

- the authentication required error should happen only during HTTP requests
- the absence of olm machine should be signalled when we try to get one and it's not been initialized yet

This has caused a bit of confusion when looking at debug traces today, so this patches fixes it.
2023-07-27 10:36:57 +02:00
Ivan Enderlin 38a8ad0a66 chore(ci): Make typos happy. 2023-07-27 10:10:45 +02:00
Ivan Enderlin d1d6bcdcab doc(ui): Add missing documentation. 2023-07-27 10:10:45 +02:00
Ivan Enderlin 3e93bdbc3f feat(ui): Normallize strings when doing fuzzy matching. 2023-07-27 09:20:43 +02:00
Ivan Enderlin 63ca82c66c feat(ui): Implement the “fuzzy match room name” filter.
WIP
2023-07-26 18:22:14 +02:00
Ivan Enderlin 0c16ff1ae7 chore(cargo): Update ruma. 2023-07-26 16:38:23 +02:00
Ivan Enderlin a8e5d3ab17 feat(ffi): Update RoomListItem::avatar_url.
This patch updates `RoomListItem::avatar_url` to use
`matrix_sdk_ui::room_list_service::Room::avatar_url` instead of
`matrix_sdk::Room::avatar_url`.

This patch also moves `avatar_url` before `is_direct` (so that it's the
same order as other places in the code).
2023-07-26 16:38:23 +02:00
Chris Smith af44ac6be4 ffi: Define API stub for m.poll.start and m.poll.end 2023-07-26 14:26:03 +00:00
Ivan Enderlin 38d28e9aa0 feat(ui): Implement Room::avatar_url.
This patch implements `Room::avatar_url`. It tries to calculate
the best avatar URL as much as possible. It's either the URL from
`SlidingSyncRoom::avatar_url` or from `Room::avatar_url`.
2023-07-26 16:06:11 +02:00
Ivan Enderlin 62a203f41e feat(sdk): Implement SlidingSyncRoom::avatar_url.
Based on https://github.com/ruma/ruma/pull/1607, this patch adds
support for `avatar` from a sliding sync response. This patch implements
`SlidingSyncRoom::avatar_url` to get the avatar URL of a sliding sync
room.
2023-07-26 16:06:11 +02:00
Ivan Enderlin 15a6861b8c chore(sdk): Remove one TODO.
The batch subscriber exists in `matrix_sdk_ui::RoomList` (https://
github.com/matrix-org/matrix-rust-sdk/pull/2322) instead of being added
here.

We must keep the observable capacity to 4096, but the `TODO` is no
longer relevant.

Why keeping the capacity to 4096? Because if the batch subscriber (in
`RoomList`) isn't “listened” quickly, we don't want to get a `Reset`.
2023-07-26 15:24:24 +02:00
Ivan Enderlin 163d8ca517 feat(ui): Batch the streams returned by RoomList::entries and RoomList::entries_filtered.
feat(ui): Batch the streams returned by `RoomList::entries` and `RoomList::entries_filtered`.
2023-07-26 15:18:43 +02:00
Ivan Enderlin efd1d1e9d2 chore(cargo): Use latest version of async-rx. 2023-07-26 14:25:50 +02:00
Ivan Enderlin 8a21a8a6da chore(ui): Address some feedbacks. 2023-07-26 14:19:17 +02:00
Ivan Enderlin 2302a7b377 feat(ui): Use Subscriber<State> to simply drain the batch subscriber for entries.
This patch brings a nice code simplification.

Instead of creating a new `Stream` with `tokio` based on
`Subscriber<State>`` to drain the batch subscriber for
`RoomList::entries` and `::filtered_entries`, we can _simply_ use
`Subscriber<State>` directly! It removes one dependency: `tokio-
stream`, and remove possible issues with the broadcast channel
`tokio::sync::broadcast`. The code is much simpler and straighforward.
2023-07-26 14:07:46 +02:00
Benjamin Bouvier 7469d1c7d8 chore: remove all experimental features on the UI crate
As discussed, we think the entire UI crate should be considered experimental. We've also
observed a proliferation of feature flags there (many of those are my wrong doings, sorry).
Since the one internal user (FFI) of that crate enabled all experimental features, it seems
fine to make them all default, while not providing any extra stability guarantee based on that
action.
2023-07-26 13:35:40 +02:00
Benjamin Bouvier 2cec3b0c45 feat: Run a SlidingSync when retrieving notifications to get more information (#2252)
* feat: run a room sliding sync upon receiving a notification, to get its full content

* test: add test for the new sliding-sync in notifications \o/

* fix: try to get the push rules *after* a possibly-successful event decryption

* feat: set `is_noisy` only if we could build a push context, and test it

* feat: expose the `legacy_get_notification` in the FFI layer

* feat: retrieve events with a `/context` query

* fix: also request the client's user id's member information to get their display name

* feat: include the list of invites in the notification sliding sync

* feat: repeat the query multiple times if the event hasn't been immediately found

* chore: simplify retrying decryption

* chore: fail the sliding sync when fetching a notification if not using a memory store

* chore: update test expectations + sort invites by recency

* chore: cargo fmt

* chore: simplify getting push actions

Either they were already available in the timeline event if we had to re-run decryption, or
we manually compute them. (Previous comment was incorrect, the `push_actions` are now optional
because of another PR of yours truly.)

* fixup! chore: fail the sliding sync when fetching a notification if not using a memory store

* feat: try to handle invites correctly

* chore: build a local client with an in-memory store instead of reusing the parent client

* fix: remove dubious annotation

* feat: allow cloning a Client and modify it on the fly, use that for the notification client

* feat: get rid of the with_memory_state_store public func on ClientBuilder

* feat: include sender_id in the notification invite event

* feat: put sender's id in the `NotificationSenderInfo`

* feat: inherit the parent session when creating a notification client

* chore: reformat comments

* TMP: add logs

* chore: regenerate the olm machine when inheriting a session too

* chore: keep the parent client around for legacy_get_notification/with_context
2023-07-25 17:23:01 +00:00
Benjamin Bouvier 483465e8a8 feat(sliding sync): include the connection id conn_id in the tracing context 2023-07-25 18:49:37 +02:00
Benjamin Bouvier bef9cbfacc feat: rename Protocol to Scheme + replace server_name_with_protocol by insecure_server_name_no_tls 2023-07-25 18:43:35 +02:00