Commit Graph

250 Commits

Author SHA1 Message Date
Jorge Martin Espinosa
26edf4169f ffi: Use forked tracing-android temporarily
… to have readable logs in Android.
2023-07-17 15:48:56 +00:00
Jonas Platte
bfed0907ed Remove wasm_command_bot 2023-07-14 11:07:47 +02:00
Jonas Platte
b2f7ba33c8 Patch const_panic to not use packed reference 2023-07-14 10:46:52 +02:00
Jonas Platte
6d8764f4e7 Patch const_panic 2023-07-14 10:46:52 +02:00
Jonas Platte
9cf1adbfa6 Upgrade UniFFI 2023-07-14 10:46:52 +02:00
Jonas Platte
6f2fee8965 Upgrade UniFFI 2023-07-13 13:13:50 +02:00
Jonas Platte
5abc781e1f Remove matrix-sdk-crypto-js
It now lives in its own repository at
https://github.com/matrix-org/matrix-rust-sdk-crypto-web
2023-07-13 13:11:02 +02:00
Jonas Platte
6e10eb9efb Remove matrix-sdk-crypto-js
It now lives in its own repository at
https://github.com/matrix-org/matrix-rust-sdk-crypto-nodejs
2023-07-12 16:23:37 +02:00
Jonas Platte
63babcd35a Upgrade Ruma 2023-07-12 12:42:31 +02:00
Jonas Platte
01ceec43b1 ui: Use eyeball_im's new entry API 2023-07-11 15:41:34 +02:00
Jonas Platte
6f295e2571 Upgrade UniFFI 2023-07-06 18:26:40 +02:00
Ivan Enderlin
23dae0612d chore(sqlite): Use itertools in repeat_vars. 2023-07-06 16:22:37 +02:00
Jonas Platte
206accb5fb Bump serde_html_form 2023-07-05 11:34:50 +02:00
Jonas Platte
0b24df991e Bump bs58 2023-07-05 11:34:50 +02:00
Jonas Platte
dd2fefa2f3 Bump indexmap 2023-07-05 11:34:50 +02:00
Jonas Platte
2b72df7c06 Bump itertools 2023-07-05 11:34:50 +02:00
Jonas Platte
4ae63caa56 Bump bitflags dependency
2.3.3 contains some bug fixes, might be relevant.
2023-07-05 11:34:50 +02:00
Jonas Platte
cb2e97f06a Upgrade eyeball to 0.8 2023-07-04 16:22:45 +00:00
Jonas Platte
b681f234a3 Upgrade criterion, pprof 2023-07-03 18:08:01 +02:00
Alfonso Grillo
147cd970c4 Map MSC3488 fields for UniFFI (#2187)
* Update ruma

* Refactor send_location

* Add timeline parser

* Fix code format

* Add zoom_level

* Update ruma

* Map zoom_level

* Format code

* Cleanup

* Refactor LocationContent

* Apply suggestion

* Fix format issue
2023-07-03 13:34:07 +00:00
jonnyandrew
7e7996d43d ui: Add local echoes for reactions to Timeline 2023-06-26 15:17:48 +00:00
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
jonnyandrew
7fd5068faa ui: Deduplicate reaction senders in timeline 2023-06-22 12:42:49 +00: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
Jonas Platte
ac140c192a Make upload progress observable 2023-06-20 11:16:13 +02:00
Benjamin Bouvier
55aad67338 Remove the sqlite-lock binary from the main repo
Will move it to a personal repository of mine.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-19 15:42:58 +02:00
Benjamin Bouvier
76ed3511b5 Add a value-based lock in the CryptoStores (#2049)
This implements a value-based lock in the crypto stores. The intent is to use that for multiple processes to be able to make writes into the store concurrently, while still cooperating on who does them. In particular, we need this for #1928, since we may have up to two different processes trying to write into the crypto store at the same time.

## New methods in the `CryptoStore` trait

The idea is to introduce two new methods touching **custom values** in the crypto store:

- one to atomically insert a value, only if it was missing (so, not following the semantics of `upsert` used in the `set_custom_value`) 
- one to atomically remove a custom value

Those two operations match the semantics we want:

- take the lock only if it ain't taken already == insert an entry only if it was missing
- release the lock = remove the entry

By looking at the number of lines affected by the query, we can infer whether the insert/remove happened or not, that is, if we managed to take the lock or not.

## High-level APIs

I've also added an high-level API, `CryptoStoreLock`, that helps managing such a lock, and adds some niceties on top of that:

- exponential backoff to retry attempts at acquiring the lock, when it was already taken
- attempt to gracefully recover when the lock has been taken by an app that's been killed by the environment
- full configuration of the key / value / backoff parameters

While it'd be nice to have something like a `CryptoStoreLockGuard`, it's hard to implement without being racy, because of the `async` statements that would happen in the `Drop` method (and async drop isn't stable yet).

## Test program

There's also a test program in which I shamelessly show my rudimentary unix skills; I've put it in the `labs/` directory but this could as well be a large integration test. A parent program initially fills a custom crypto store, then creates a `pipe()` for 1-way communication with a child created with `fork()`; then the parent sends commands to the child. These commands consist in reading and writing into the crypto store, using a lock. And while the child attempts to perform these operations, the parent tries hard to get the lock at the same time. This helps figuring out a few issues and making sure that cross-process locking would work as intended.
2023-06-16 13:05:54 +00:00
Jonas Platte
b1c8859eb9 Upgrade UniFFI 2023-06-15 15:20:46 +02:00
Jonas Platte
47a67d1d67 Upgrade Ruma 2023-06-13 18:33:28 +02:00
Jonas Platte
2c71556ef2 Upgrade opentelemetry dependencies 2023-06-13 11:08:45 +02:00
Jonas Platte
af870fcff3 ui: Allow waiting for token before starting pagination 2023-06-07 16:21:48 +02:00
Jonas Platte
dc05d17330 Upgrade eyeball-im-util 2023-06-07 13:29:42 +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
Benjamin Bouvier
d1a1a0f5c5 Reuse upstream Ruma repository
This was a temporary replacement I've made, waiting for a PR of mine to be merged, and it's been merged since then. Oh well.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-06 10:04:20 +02:00
Ivan Enderlin
08559b58b6 Merge branch 'main' into feat-ui-roomlist 2023-06-05 19:22:33 +02:00
Jonas Platte
2c2285b5d7 ui: Deduplicate local and remote echo by event ID when it comes in late 2023-06-05 17:33:11 +02:00
Ivan Enderlin
c6dae678bd sliding sync: move the bump_event_types to be per-list
sliding sync: move the `bump_event_types` to be per-list
2023-06-02 20:29:10 +02:00
Kévin Commaille
3ab171ca2d chore: Update log dependency
Fixes compilation of value-bag crate with Rust nightly

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-06-02 12:22:26 +02:00
Benjamin Bouvier
6a58be38ca Temporarily use bnjbvr's repository for bump-event-types change in ruma
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-06-01 18:51:53 +02:00
Jonas Platte
3e2bc3a514 Drop matrix-sdk-sled 2023-06-01 12:06:35 +02:00
Ivan Enderlin
954d798ac3 test(ui): Write an assert_entries_stream macro. 2023-06-01 09:48:54 +02:00
Ivan Enderlin
a3c96dcb62 feat(ui): Implement RoomList::entries_stream. 2023-06-01 09:48:53 +02:00
Ivan Enderlin
4557c2a7b2 feat(ui): Add RoomList::entries.
This patch implements the `RoomList::entries` method, which allows
to get a stream of `VectorDiff` over the room list, and that can be
filtered.
2023-06-01 09:48:53 +02:00
Ivan Enderlin
f058c59582 feat(sdk): Add SlidingSyncList::room_list_filtered_stream.
This patch adds a new method on `SlidingSyncList` named
`room_list_filtered_stream`, which uses the new `eyeball-im-util` crate
with its new `FilteredSubscriber` type.
2023-06-01 09:48:53 +02:00
Ivan Enderlin
4fa38d23d4 feat(sdk): SlidingSync has more non-blocking API.
This patch does several things.

First, `SlidingSync::on_list` is now async, and accept async closures.

Second, `SlidingSync::lists` and `::rooms` are behind an `AsyncRwLock`
instead of a `StdRwLock`. The rest of the patch updates the consequence
of this.
2023-06-01 09:48:53 +02:00
Damir Jelić
2fa4410dc6 Bump the vodozemac version 2023-05-31 11:52:47 +02:00
Jonas Platte
ebe97623aa Upgrade Ruma 2023-05-26 12:26:00 +02:00
Damir Jelić
2e09bf63a6 Add a message id to our encrypted to-device events 2023-05-24 12:29:15 +02:00
Jonas Platte
2660e7bcf1 bindings: Use native async support for latest_room_message 2023-05-24 11:31:33 +02:00