Commit Graph

2927 Commits

Author SHA1 Message Date
Andy Balaam
f6d707cce8 Merge main into andybalaam/sliding-sync-process-unify-invited (using imerge) 2023-06-12 13:40:07 +01:00
Jonas Platte
4541ef6b90 sdk: Add Timeline::cancel_send 2023-06-12 14:20:51 +02:00
Benjamin Bouvier
29ddeb45d9 feat(sdk): implement sticky parameters (#1948)
* chore: add comments explaining what the position markers are
* feat(sdk): add scaffolding for sticky parameters
* test(sdk): add tests for the sticky parameters API
* feat(sdk): include the bump_event_types in the sticky parameters
* WIP: add TODO comments for deeply nested sticky parameters
* test(sdk): add extra test for sticky parameters
* feat: add extensions in the sticky parameters + test request generation + test since token
* chore: fix merge + get rid of unused inner extensions
* feat: use sticky parameters for lists too
* chore: Introduce the StickyManager, a reusable way to manage per-data sticky parameters
* chore: move the sticky scaffolding to its own module
* chore: clippy + fmt
* chore: get rid of `update_to_device_token`
* review: append SlidingSync prefix to Stick* data structures
* address review comments
* Replace nbsp with regular space
* Get rid of a write-access to a lock (because thanks inner mutability!)
* Add an integration test when losing `pos` in sticky parameters, and avoid `block_on`

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-12 10:46:13 +00:00
Andy Balaam
f4aed74fb1 Fix formatting 2023-06-12 09:50:04 +01:00
Andy Balaam
11adcf425c In sliding sync, do all the same processing on an invited room as a joined one
The example in MSC3575 shows a room with invite_state property, but also
timeline, joined_count etc. properties. That may or may not be very
likely in practice, but I think it makes sense to check for all these
properties even when the room is an invite, and use them if they are
present.
2023-06-09 13:25:04 +01:00
Andy Balaam
7e197ec8d4 Simplify invited room sliding sync processing
Added some comments based on my understanding of MSC3575. Previously we
had a FIXME about how we were setting the room state to invite or join
based on the presence or absence of the invite_state property. I think
this behaviour is correct, so I added some comments explaining why.

The functional change here is to note that we call
store.get_or_create_stripped_room to find/create the stripped room, and
this actually deletes any room of this ID that is in the store, so our
later call to store.get_room would always fall back to getting the
stripped room, which we already have, so there was no need to do the
get_room call at all.
2023-06-09 13:14:58 +01:00
Andy Balaam
9d943e7c62 Clarify in tests that invite_state contains very minimal JSON 2023-06-09 13:14:58 +01:00
Andy Balaam
8c2cc522bc Test canonical aliases in invited rooms via sliding sync 2023-06-09 12:54:43 +01:00
Andy Balaam
4a04c70c45 Handle required state in invited rooms as well as normal 2023-06-09 12:54:43 +01:00
Andy Balaam
ee8f94cb95 Rename room_to_add->room_to_store 2023-06-09 12:54:43 +01:00
Andy Balaam
24ff62befc Refactor process_sliding_sync to extract a method for dealing with rooms 2023-06-09 12:54:43 +01:00
Andy Balaam
a85c481368 Test for adding an invited room to the client and invite list 2023-06-09 12:52:26 +01:00
Andy Balaam
5545c98a85 Test for finding avatars in invite rooms 2023-06-09 12:52:26 +01:00
Andy Balaam
ac7c6ba84c Test for finding an avatar in a room via sliding sync 2023-06-09 12:52:26 +01:00
Kévin Commaille
ae2f834345 sqlite: Return an error when DB version is invalid or missing (#2038)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-09 11:02:33 +00:00
Andy Balaam
0e30d85df4 Provide no event_id for the name state event when it comes via update_name
Also respond to a couple of minor review comments
2023-06-08 18:30:20 +02:00
Andy Balaam
02d03c55f2 Update the name of a room during sliding sync processing 2023-06-08 18:30:20 +02:00
Andy Balaam
0cff8f3697 Allow updating the name in a RoomInfo 2023-06-08 18:30:20 +02:00
Andy Balaam
0f5906a0fa Tests for processing sliding sync responses 2023-06-08 18:30:20 +02:00
Jonas Platte
a977b3a8d5 ui: Use stream_assert for timeline unit tests 2023-06-08 12:25:58 +02:00
Jonas Platte
6c6c43e709 ui: Filter virtual timeline items for some tests 2023-06-08 12:25:58 +02:00
Benjamin Bouvier
43bac4995f chore: rename homeserver to sliding_sync_proxy in sliding sync
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-08 11:13:40 +02:00
Jonas Platte
b5339ceaba ui: Activate sdk's testing feature for unit tests
Fixes running `cargo test` without any flags from the crate root.
2023-06-07 17:25:24 +02:00
Jonas Platte
0898c76bb7 crypto: Simplify is_cross_signing_trusted 2023-06-07 17:25:24 +02:00
Jonas Platte
c19d72f0f4 Use Option::is_some_and where applicable 2023-06-07 17:25:24 +02:00
Jonas Platte
aa3adbd53d ui: Don't wait on prev_batch token for more than 3s 2023-06-07 16:21:48 +02:00
Jonas Platte
af870fcff3 ui: Allow waiting for token before starting pagination 2023-06-07 16:21:48 +02:00
Jonas Platte
1e10a54d3d ui: Fix clippy lints 2023-06-07 16:21:48 +02:00
Jonas Platte
bfce4d1006 ui: Merge timeline::room_ext module into timeline::traits 2023-06-07 16:21:48 +02:00
Jonas Platte
2bcc70beb9 ui: Move timeline-internal traits into separate module 2023-06-07 16:21:48 +02:00
Jonas Platte
415c13fa90 ui: Add a test for retrying a failed send 2023-06-07 13:29:42 +02:00
Jonas Platte
0ca8369a76 ui: Fix clippy warnings 2023-06-07 13:29:42 +02:00
Jonas Platte
dc05d17330 Upgrade eyeball-im-util 2023-06-07 13:29:42 +02:00
Jonas Platte
9505ace8e2 ffi: Add Room::retry_send 2023-06-07 13:29:42 +02:00
Jonas Platte
df7beb4afd ui: Add Timeline::retry_send 2023-06-07 13:29:42 +02:00
Ivan Enderlin
4e29e6e347 feat(ui): Disable caching and make Timelines lazy
feat(ui): Disable caching and make `Timeline`s lazy
2023-06-07 11:29:22 +02:00
Ivan Enderlin
5c182a0d03 sliding sync: enable read-receipts in the common extensions
sliding sync: enable read-receipts in the common extensions
2023-06-07 09:58:27 +02:00
Ivan Enderlin
3acb56aa31 feat(ui): Make Room::timeline and ::sneaky_timeline lazy.
This patch uses a new `async-once-cell` crate to make `Room::timeline`
and `Room::sneaky_timeline` by making them lazy. Their values are
computed lazily, on-demand, when calling the `Room::timeline` method or
`Room::latest_event`.
2023-06-07 09:51:56 +02:00
Ivan Enderlin
a2cefedf73 RoomList API: enable account_data extension by default
`RoomList` API: enable `account_data` extension by default
2023-06-07 09:35:04 +02:00
Ivan Enderlin
169038504d fix(ui): Disable Sliding Sync caching in RoomList. 2023-06-07 09:31:52 +02:00
Benjamin Bouvier
d3ddfabaef sliding sync: enable read-receipts in the common extensions
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-06 20:09:03 +02:00
Benjamin Bouvier
027db88078 sliding sync: have the RoomApi use add_list instead of add_cached_list until the perf issue of reloading has been fixed
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-06 19:36:42 +02:00
Benjamin Bouvier
3b10c235ab sliding sync: enable account data extension in room list API
This extension was enabled by both ElementX apps by default, along with the e2ee / to-device extensions that will be handled
by the new Notification API. To maintain the current behavior, it's important to re-enable this extension before getting
RoomList in production.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-06 19:35:20 +02:00
Benjamin Bouvier
f84ff148da feat(sdk): add an optional temporary directory to get_media_file
By default, get_media_file will attempt to use a default directory
for temporary files and directories. Unfortunately, there might not be
such a thing on some older Android devices, which use per-application
directories.

For this specific case, an optional temporary directory parameter
is added to the `get_media_files` parameters, so one can provide their own
temporary directory path.

This new parameter is expected to be set at least on Android; other platforms
should work just fine without it.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-06 15:20:06 +02:00
Kévin Commaille
407375ad17 base: Move StateStore::get_member_event to StateStoreExt
It is a wrapper around get_state_event_static_for_key

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-06 11:56:11 +02:00
Kévin Commaille
b690bcfbaf sdk: Re-export store traits
The store is exposed with `Client::store()` but the traits are not.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-06 11:56:11 +02:00
Ivan Enderlin
e6fdcfdf52 chore: Make Clippy happy. 2023-06-05 20:05:46 +02:00
Ivan Enderlin
42df0d0e21 fix: Fix merge commit. 2023-06-05 19:43:32 +02:00
Ivan Enderlin
d1bccacef9 chore: Make CI happy. 2023-06-05 19:40:51 +02:00
Ivan Enderlin
08559b58b6 Merge branch 'main' into feat-ui-roomlist 2023-06-05 19:22:33 +02:00