Commit Graph

6436 Commits

Author SHA1 Message Date
Jonas Platte
49b1e8732c Upgrade most of our dependencies
Still holding back js-sys and web-sys due to unresolved wasm-bindgen issues.
2023-06-26 14:32:24 +02:00
Ivan Enderlin
ba422f861e fix(sdk): Change SlidingSyncList::room_list's capacity
fix(sdk): Change `SlidingSyncList::room_list`'s capacity
2023-06-26 14:16:05 +02:00
Ivan Enderlin
749911af60 fix(sdk): Change SlidingSyncList::room_list's capacity.
This patch changes the capacity of the internal buffer of
`ObservableVector` for `SlidingSyncList::room_list` from 16 to 4096.
With an increased capacity, we reduce the probability to send a
`VectorDiff::Reset` to subscribers. `Reset` are happening quite often
for apps using `matrix-sdk`, and it impacts their performance. This
patch tries to improve this situation. This `room-list` contains
`RoomListEntry`, which is can cheap in terms of memory, compared to the
impact of sending `Reset`s too often. That's a tradeoff.
2023-06-26 13:52:15 +02:00
Jonas Platte
0e1f74f617 Increase other sleep in test a bit 2023-06-26 11:36:24 +02:00
Jonas Platte
b6353f82a8 ui: Improve logging for message-sending queue 2023-06-26 11:36:24 +02:00
Benjamin Bouvier
171c1cf25b chore: fix documentation
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-26 11:22:38 +02:00
Benjamin Bouvier
b442d30848 feat: remove the in-memory cache for to_device_token in sliding sync
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-26 11:22:38 +02:00
Benjamin Bouvier
94fa888b7b feat: always enable the SS cache by default
This makes sure that the to-device prev_batch/since token is already saved to and reloaded from disk.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-26 11:22:38 +02:00
Benjamin Bouvier
69932adb7e chore: remove unreachable UI notifications module
Remnant from a bad merge/renaming.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-26 11:22:38 +02:00
Mauro
2c58c65add ffi: Allow disabling local notification filtering using push rules 2023-06-26 08:49:06 +00:00
Ivan Enderlin
8916eb6409 test(ui): Replace sleep by yield_now
test(ui): Replace `sleep` by `yield_now`
2023-06-23 16:37:00 +02:00
Jonas Platte
44ef302bc7 Increase sleep in test a bit
since it seems flaky in CI
2023-06-23 16:17:21 +02:00
Ivan Enderlin
40db35abe7 test(ui): Replace sleep by yield_now.
Eh, removing `sleep` from the tests is always a pleasure right?
2023-06-23 16:15:57 +02:00
Jonas Platte
9b802998b3 ui: Put retries in the message-sending queue 2023-06-23 14:03:27 +02:00
Jonas Platte
0a37ce50a8 ui: Allow retrying cancelled local echoes 2023-06-23 14:03:27 +02:00
Alfonso Grillo
e72bae1a8f ffi: Add send_location api 2023-06-23 11:29:01 +00:00
Jonas Platte
4c24007cb8 ui: Add a queue to serialize message sending requests 2023-06-23 09:41:07 +02:00
Jonas Platte
cb6d3c3c47 ui: Add a failing test for message ordering 2023-06-23 09:41:07 +02:00
David Langley
19ba18d788 ffi: Expose the senders of reactions 2023-06-23 08:56:16 +02:00
Ivan Enderlin
73de71bd42 feat(ui): Welcome to RoomListService
feat(ui): Welcome to `RoomListService`
2023-06-22 17:36:05 +02:00
Ivan Enderlin
1c6ad4a082 chore(ui): Address feedbacks. 2023-06-22 17:16:25 +02:00
Ivan Enderlin
9eadbc302f feat(ffi): Rename Client::room_list to Client::room_list_service. 2023-06-22 17:08:30 +02:00
Ivan Enderlin
93d619249c test(ui): Reduce latency of the tests. 2023-06-22 15:37:25 +02:00
Ivan Enderlin
35ee6db152 fix(ffi): Eh UniFFI, we want Tokio compat. 2023-06-22 14:59:51 +02:00
jonnyandrew
7fd5068faa ui: Deduplicate reaction senders in timeline 2023-06-22 12:42:49 +00:00
Ivan Enderlin
1631b5ba18 chore(ui): Use matrix_sdk::executor instead of tokio. 2023-06-22 14:15:10 +02:00
Valere
3fd55c0ab1 bindings: Ignore silently malformed userId in migration of tracked users (#2130)
* bindings: Ignore silently malformed userId in migration of tracked users
* Clean: collect will now never fail

Co-authored-by: Benjamin Bouvier <public@benj.me>
matrix-sdk-crypto-ffi-0.3.10
2023-06-22 12:11:06 +00:00
Ivan Enderlin
083a79a408 doc(ui): Fix intra-links. 2023-06-22 14:08:09 +02:00
Ivan Enderlin
f9fe7450ce Merge branch 'main' into feat-ui-roomlist-service 2023-06-22 13:48:00 +02:00
Ivan Enderlin
d43d5b515e chore: Make Clippy happy. 2023-06-22 13:39:00 +02:00
Damir Jelić
daa3944593 Bump Ruma 2023-06-22 13:20:37 +02:00
Benjamin Bouvier
679ec70200 feat: implement the full EncryptionSync (#2110)
* crypto: implement more primitives for the MemoryStore to work in tests

* crypto: change the shape of the `CryptoStoreLock` API

In particular:

- make the lock work across multiple threads of the same process trying to acquire it,
using `num_holders`.
- add a mechanism to get the lock only once (for the NSE process, in case the main app
had acquired the lock before).

* client: add a cross-process crypto store lock, enable it with `Encryption::enable_cross_process_store_lock`
* client: make `preshare_room_key` a critical section of the cross-process lock
* sliding sync: make it possible to define different timeouts for a `SlidingSyncInstance`

This will be handy for the NSE process on iOS, which has very little time to wait for the proxy's responses.

* feat: implement the `EncryptionSync` API (renamed from `Notification` API)
* fixup! client: add a cross-process crypto store lock, enable it with `Encryption::enable_cross_process_store_lock`
* feat: allow disabling e2ee / to-device in the RoomList API
* feat: use same SS id for main/NSE process, reload to-device token from disk before each encryption sync
* fix: better error handling if restoring the to-device token failed
* feat: add logs for the locking functions
* test: add a few tests for encryption sync
* feat: add `reload_caches` method in the `EncryptionSync` + FFI bindings
* chore: clean up FFI loop
* encryption sync: Remove unused errors, specialize some errors
* feat: include termination reason in the encryption sync loop
* feat: add more logs
* chore: fmt + clippy + doc
* comment: precise only in the presence of another process
* Tweak `room_list` APIs to include `_with_encryption` variants
* chore: rustfmt
2023-06-22 12:50:45 +02:00
Ivan Enderlin
eb2213467a feat(ffi): Implement RoomList::loading_state. 2023-06-22 12:12:45 +02:00
Ivan Enderlin
398f70c9de feat(ui): Implement RoomListLoadingState.
The type is well documented. Go check it out :-).
2023-06-22 11:43:38 +02:00
Kévin Commaille
2b3d1080dc sdk: Allow to support several authentication APIs
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-22 11:21:50 +02:00
Kévin Commaille
7298df0db6 sdk: Move Session and SessionTokens to matrix_auth
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-22 11:21:50 +02: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
Mauro Romito
528607f079 feat(bindings): get_notification_item filters out notifications given the push context 2023-06-22 11:09:45 +02:00
Ivan Enderlin
c9e3d7988f feat(ui): Change how room_list::State is updated.
Instead of broadcasting an intermediate update for the `State`, it's
updated once after the sync.
2023-06-22 10:23:45 +02:00
aringenbach
726c1bca2c ui: Filter redacted reactions from the timeline 2023-06-21 16:21:39 +00:00
Ivan Enderlin
d77a48cc2c feat(ffi): Implement RoomList::room. 2023-06-21 17:20:05 +02:00
Ivan Enderlin
40602e7bba chore(ffi): Update according to previous commits. 2023-06-21 17:11:26 +02:00
Ivan Enderlin
b774110235 chore(ui): Move methods from RoomListService inside RoomList.
This patch moves `RoomListService::entries` and `::filtered_entries`
inside `RoomList`. It also implements `RoomList::new`. Finally,
it implements `RoomListService::all_rooms` and re-implement
`RoomListService::invites`.

Basically:

```rust
// 1.
room_list.entries().await?
// 2.
room_list.invites().await?
```

becomes:

```rust
// 1.
room_list.all_rooms().await?.entries()
// 2.
room_list.invites().await?.entries()
```

`all_rooms` and `invites` both return a `RoomList`.
2023-06-21 17:00:30 +02:00
Jonas Platte
dccf0c29bf Update reldbg profile to optimize our own packages too
… and enable incremental compilation for it.
2023-06-21 16:36:40 +02:00
Ivan Enderlin
b01bbe7e92 chore: Add missing copyright headers. 2023-06-21 16:29:55 +02:00
Ivan Enderlin
dc061308bd chore(ui): Rename RoomList to RoomListService. 2023-06-21 16:29:03 +02:00
Ivan Enderlin
12a6f12461 feat(ui): Implement RoomList::stop_sync
feat(ui): Implement `RoomList::stop_sync`
2023-06-21 16:23:06 +02:00
Jonas Platte
895669e39b sdk: Upload thumbnail and attachment in parallel 2023-06-21 14:56:22 +02:00
Jonas Platte
54288cb4cb Fix clippy lints 2023-06-21 14:56:22 +02:00
Jonas Platte
b883ec000a sdk: Clean up imports in encryption module 2023-06-21 14:56:22 +02:00