Commit Graph

197 Commits

Author SHA1 Message Date
Jonas Platte
fd17bce300 ui: Fix day divider logic
… for when a remote event is re-received while a local echo is pending.
Also simplify test_togglling_reaction integration test so it still passes.
2023-09-14 14:14:44 +02:00
Jonas Platte
2d47aecd37 Remove the appservice feature from matrix-sdk, matrix-sdk-test 2023-09-05 15:40:38 +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
Jonas Platte
e02676616f sdk: Make use of clonable FnOnce in event handlers 2023-09-01 10:42:22 +02:00
Nicolas Mauri
1cc11ae988 feat(ffi): Add a notification_mode property to room_info (#2460)
* feat(ffi): Add a notification_mode property to room_info
* feat(sdk): Add a notification_mode() function to Room
* Fix Rust syntax
2023-08-29 12:25:26 +00:00
Benjamin Bouvier
936b6980c9 chore: move SyncTokenAwareClient to the common test helpers 2023-08-21 19:36:33 +02:00
Benjamin Bouvier
e262db3505 test: write an integration test for missing keys during encryption 2023-08-21 19:36:33 +02:00
Benjamin Bouvier
5c74a597eb nit: prefer using assert_matches! in tests 2023-08-04 17:41:47 +02:00
Benjamin Bouvier
dd3cab9409 fix: don't try /context when a notification has been filtered out 2023-08-04 17:41:47 +02:00
Benjamin Bouvier
10f709450e tests(notification): add integration tests for notification events 2023-08-04 17:41:47 +02:00
Jonas Platte
1679669376 Remove the 'testing' feature from matrix-sdk-ui
At the expense of slightly increasing our public API, but we can always
deprecate things.
2023-08-03 21:39:56 +02:00
Nicolas Mauri
6961a7fb36 Fix is_user_mention_enabled and is_room_mention_enabled (#2357)
* Fix is_user_mention_enabled, is_room_mention_enabled

* Fix: XXX comments in UnitTests

* Update comments

* UnitTests: code refactoring
2023-08-01 14:43:32 +02:00
Jonas Platte
92df7b22ec Rename room::Common to Room
… and export it at the matrix_sdk crate root.
2023-07-18 15:12:03 +02:00
Jonas Platte
67ef9c3fa0 Remove Room enum 2023-07-18 15:12:03 +02:00
Jonas Platte
85f66b1f96 Remove room::Joined 2023-07-18 15:12:03 +02:00
Jonas Platte
0408bd5a98 Remove room::Left 2023-07-18 15:12:03 +02:00
Jonas Platte
05a817305e Remove room::Invited 2023-07-18 15:12:03 +02:00
Jonas Platte
8c3af12e47 test: Rename EventBuilder to SyncResponseBuilder
… because that's what it is.
2023-07-12 10:29:29 +02:00
aringenbach
89aa2916c7 ui/ffi: Add timestamp to reactions 2023-07-10 10:13:53 +00:00
Benjamin Bouvier
d72fd34325 Make pending local echoes sticky, take 2 (#2189)
* ui: Move EventSendState into timeline::event_item::local module

* [WIP] ui: Make pending local echoes stick to the bottom of the timeline

* test: update more test expectations

* chore: tweak comment to slightly better reflect reality

* nit: remove else after return

* fix: the item's insert position is insert_idx, not `items.len()` anymore

* fix: look for remote echo before local echo when processing send state

Previous code assumed that the latest timeline items would be the most recent, and that
if there was a remote echo, it would always be after the local echo, because of that.
That's not the case anymore, so we must look for possibly a remote echo first, and then
if we find it, apply the late update process.

Also, there might remain a day divider added by the local echo, if it were inserted last.
I'm not sure it covers all the cases, but I've now made it so that the day divider is removed
if it was the last element.

* feat: switch strategy; keep on pushing if there's nothing in the timeline yet

* Revert "test: update more test expectations"

This reverts commit 400cc93ba7c98042a28b5e8d5042899e854f6cff.

* test: reset test expectations

* Address review comments

* fix: don't mix up latest event with any status, with latest non-failed event index

---------

Co-authored-by: Jonas Platte <jplatte@matrix.org>
2023-06-30 09:37:49 +00:00
Benjamin Bouvier
77290ff2c1 feat: Get rid of "common extensions"
Common extensions are confusing, and they've included `e2ee` and `to-device` by default. This is not a sane default anymore,
now that there's the concept of `EncryptionSync`: it's either we have the encryption sync that enables e2ee and to-device +
a room list sync that doesn't, OR we have a single room list that has both.

Room List was misconfigured to always use `e2ee` and `to-device`, which was incorrect when it's running with the `EncryptionSync`
in the background. This is now removed, and properly tested.
2023-06-30 09:56:29 +02:00
jonnyandrew
7e7996d43d ui: Add local echoes for reactions to Timeline 2023-06-26 15:17:48 +00:00
Kévin Commaille
d6f9f08e30 sdk: Split Matrix authentication methods in a separate API
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-22 11:21:50 +02:00
Andy Balaam
2a2ce5f05c Already-passing tests for get_dm_room including left rooms 2023-06-20 11:05:37 +01:00
Jonas Platte
b3017a1073 Fix typos 2023-06-14 12:31:32 +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
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
Benjamin Bouvier
61c3a2a2c7 sliding sync: infer the storage key from the loop id and user id (#2008)
* sliding sync: infer the storage key from the loop id and user id
* chore: rename `sync_id` to `id`
* chore: check that the sliding sync id is less than 16 chars
* chore: rejigger the storage key creation logic

Now the prefix is visible only in the `format_storage_key_prefix` function, and other `format_storage_key` function will be based off that.

* chore: update sliding sync README with API updates and fix outdated information
* chore: clippy + fix test

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-05 14:51:40 +00:00
Kévin Commaille
83e7afab5d sdk: Allow to get stripped state events from the store
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-01 11:13:24 +02:00
Benjamin Bouvier
90d7ff764c Remove dead tests
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-29 12:46:50 +02:00
Benjamin Bouvier
fa25e4d9fc sliding sync: Rejigger the range API (#1955)
* feat: introduce SlidingSyncSelectiveModeBuilder
* feat: get rid of `CannotModifyRanges` \o/
* chore: rustfmt
* chore: remove scope in test
* chore: move request generator update to its own mod, gets rid of `set_ranges`
* chore: add comments on the request generator methods
* chore: sink one range_end definition into the match arm that matters
* ffi: remove unused `add_range` method
* test: update incorrect test expectation
* chore: make clippy happy
* address first review comments
* review: don't reuse the ranges field for two things
* chore: use a builder pattern for sliding sync selective mode
* address review comments + CI

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-26 13:40:46 +02:00
Ivan Enderlin
17f4ba5c9b fix(sdk): Client::sliding_sync doesn't need to be async
fix(sdk): `Client::sliding_sync` doesn't need to be `async`
2023-05-24 12:26:33 +02:00
Ivan Enderlin
a2a1b35622 fix(sdk): Client::sliding_sync doesn't need to be async.
The `Client::sliding_sync` method was declared as async. However, it's
not necessary as everything happening here is sync.
2023-05-24 11:56:38 +02:00
Ivan Enderlin
b8580b76f7 feat(sdk): Rename SlidingSync::stream to ::sync.
Because it doesn't start a stream, but a sync-loop.
2023-05-24 08:20:29 +02:00
Jonas Platte
59b1fa00df Replace futures dependencies with futures-* dependencies 2023-05-17 17:20:55 +02:00
Benjamin Bouvier
149950cc29 sliding sync: Use RangeInclusive<u32> instead of raw start/end UInt values (#1877)
* chore: use RangeInclusive instead of raw start/end integers for ranges in sliding sync
* chore: have timeline_limit use a u32 instead of a Ruma UInt
* chore: Remove all the `Into<u32>` generics on timeline_limit and ranges APIs
* chore: introduce a `Bound` type alias for u32

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-11 14:27:46 +02:00
Ivan Enderlin
281944696a Merge branch 'main' into feat-sdk-sliding-sync-cancellation-token 2023-05-08 14:11:20 +02:00
Kévin Commaille
ea826a257d sdk: Replace Sled with SQLite as defaut store
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-05-08 12:11:10 +02:00
Ivan Enderlin
cdb992e3b2 Merge branch 'main' into feat-sdk-sliding-sync-cancellation-token 2023-05-08 09:55:02 +02:00
Benjamin Bouvier
3e811d5246 Make SlidingSyncListBuilder::build infallible by mandating a name in ctor
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-04 15:42:35 +02:00
Benjamin Bouvier
be41dcf300 Remove unused dependencies 2023-05-02 15:06:46 +02:00
Ivan Enderlin
4b51a19564 chore: Clean up tests. 2023-04-27 14:26:51 +02:00
Ivan Enderlin
3a8b6696f7 test: Install SS proxy v0.99.2. 2023-04-27 14:07:39 +02:00
Ivan Enderlin
13088dff72 test: Use the latest Sliding Sync proxy version. 2023-04-27 10:02:50 +02:00
Ivan Enderlin
f26b9fb66c Merge branch 'main' into feat-sdk-sliding-sync-cancellation-token 2023-04-26 12:19:02 +02:00
Ivan Enderlin
5d0b42c42b test(sdk): Disable SlidingSync integration tests temporarily.
Because since SlidingSync no longer restarts, the behaviour is really
different. The current way the tests are written cannot assert the full
behaviour. We need to rewrite this test suite entirely.
2023-04-26 12:08:16 +02:00
Kévin Commaille
81a543e15b sdk-base: Deprecate get_invited_user_ids and get_joined_user_ids
get_user_ids can be used instead

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-04-25 18:03:53 +02:00
Kévin Commaille
493db9dd3f sdk-test: Add room member ban sync event
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-04-24 18:54:29 +02:00
Ivan Enderlin
f4e577bbe0 feat(sdk): Remove SlidingSync::pop_list.
This method is used by nobody. It's safe to remove it.
2023-04-24 14:07:27 +02:00
Jonas Platte
abd508676e sdk: Remove {Local,Remote}EventTimelineItem from public API 2023-04-19 14:17:16 +02:00