Commit Graph

6626 Commits

Author SHA1 Message Date
Jonas Platte
aee2ef6abf ffi: Use async-uniffi instead of block_on in app module 2023-07-13 13:13:50 +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
Richard van der Hoff
51ba4483c0 Merge pull request #2270 from matrix-org/release-matrix-sdk-crypto-js-0.1.4
matrix-sdk-crypto-js v0.1.4
2023-07-12 17:24:16 +01:00
Richard van der Hoff
b62bb90c79 matrix-sdk-crypto-js v0.1.4 matrix-sdk-crypto-js-0.1.4 2023-07-12 16:58:19 +01:00
Richard van der Hoff
a4cece7dd7 crypto: Add OlmMachine::query_keys_for_users (#2267)
Sometimes we need our key query results to be as up-to-date as possible. Add a mechanism to allow that.

Closes #2263 .
2023-07-12 16:48:34 +01:00
Jonas Platte
ec34036586 ci: Switch to branch-less GitHub pages workflow 2023-07-12 17:47:04 +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
a554a92dec crypto: Re-export vodozemac entirely 2023-07-12 15:14:47 +02:00
Jonas Platte
ccb6d7d05c Move ruma re-export from matrix-sdk to matrix-sdk-common
… since it's also useful for crypto bindings.
2023-07-12 15:14:47 +02:00
Jonas Platte
f6c339a5d2 Enable ruma's new compat-upload-signatures feature 2023-07-12 12:42:31 +02:00
Jonas Platte
63babcd35a Upgrade Ruma 2023-07-12 12:42:31 +02:00
Jonas Platte
8c3af12e47 test: Rename EventBuilder to SyncResponseBuilder
… because that's what it is.
2023-07-12 10:29:29 +02:00
Richard van der Hoff
e1c5f628e7 Merge pull request #2258 from matrix-org/matrix-sdk-crypto-js-0.1.3
Fix `receiveSyncChanges` js bindings, and release 0.1.3
2023-07-11 18:12:16 +01:00
Richard van der Hoff
f1def2a458 fix another test matrix-sdk-crypto-js-0.1.3 2023-07-11 17:19:58 +01:00
Richard van der Hoff
0bd1e65b49 update changelogs 2023-07-11 16:41:45 +01:00
Richard van der Hoff
fd3c4f669d matrix-sdk-crypto-js v0.1.3 2023-07-11 16:41:22 +01:00
Richard van der Hoff
a3a36291ad crypto-js Fix return type of receiveSyncChanges
https://github.com/matrix-org/matrix-rust-sdk/pull/2142 introduced an
unintended change such that `receiveSyncChanges` returned an array of arrays.
2023-07-11 16:29:17 +01:00
Jonas Platte
0daf3aeb6b ui: Move echoes to the bottom immediately when retrying 2023-07-11 16:36:26 +02:00
Jonas Platte
9dc6ac45d2 ui: Fix wrong field name 2023-07-11 16:36:26 +02:00
Jonas Platte
53ac8bea14 ffi: Provide tokio context for async exported method 2023-07-11 15:54:38 +02:00
Jonas Platte
01ceec43b1 ui: Use eyeball_im's new entry API 2023-07-11 15:41:34 +02:00
Benjamin Bouvier
43bbd4200e chore: inline variable and use From<bool> for WithLocking 2023-07-11 14:07:27 +02:00
Benjamin Bouvier
2d9f7d2f89 ffi: remove bindings for manually creating EncryptionSync and RoomList 2023-07-11 14:07:27 +02:00
Benjamin Bouvier
dbc8f0136b ffi: add bindings for App 2023-07-11 14:07:27 +02:00
Benjamin Bouvier
dd7d4ddf7c chore: rebase 2023-07-11 14:07:27 +02:00
Benjamin Bouvier
e60d04b368 doc: document the App API 2023-07-11 14:07:27 +02:00
Benjamin Bouvier
704cd7784b feat: experimental App API that wraps both the encryption sync and room list API 2023-07-11 14:07:27 +02:00
Damir Jelić
1c6d85935d Generate one-time keys when we receive new one-time key counts (#2249)
Previously we would generate one-time keys, if needed, whenever we tried
to upload them. This code-path is critically missing a `save_account()`
call and we would only persist the account once we uploaded the one-time
keys.

This patch changes things up to generate one-time keys whenever we
receive new one-time key counts from the sync response. This aligns
with the way we generate fallback keys and removes the need to introduce
a new place where we persist the `Account`.

It's still possible to re-upload the same one-time keys, in the case
where the upload process succeeds on the server side but we fail to
receive the response.

Co-authored-by: Denis Kasak <dkasak@termina.org.uk>
2023-07-11 10:27:04 +00:00
Benjamin Bouvier
9985a63dd3 feat: use a ring buffer for the RoomListService cache
This will limit the memory used by the cache entries (while it was unbounded before). It's now possible to do this,
since we have the `latest_room_event` handy for all the rooms; using the unbounded cache before was papering over
the lack of that feature.

We can bikeshed on the number of entries in this cache. It has to be small enough to not blow up memory (and keep
the linear search over room id fast, but it's secondary), and high enough that we don't hit the full timeline
re-build path that often.
2023-07-11 10:57:04 +02:00
Richard van der Hoff
00e85ef275 Disable debug logging for tests
Because https://github.com/jestjs/jest/issues/4156 is closed
2023-07-11 10:56:42 +02:00
Jonas Platte
879d1b189c ui: Test unique ID tracking 2023-07-10 19:19:31 +02:00
Jonas Platte
a11508fa58 ui: Linkify doc bits 2023-07-10 19:19:31 +02:00
Jonas Platte
754b668fe6 ui: Move TimelineItem, TimelineItemKind into new sub-module 2023-07-10 19:19:31 +02:00
Mauro Romito
bc811cc1dc ui: Add a unique ID for all timeline items
Co-authored-by: Jonas Platte <jplatte@matrix.org>
2023-07-10 19:19:31 +02:00
Benjamin Bouvier
2acc13ed2c feat: add a new NotificationClient API 📬 (#2235)
* chore: rename EncryptionSyncMode variants

* feat: split the encryption sync modes into two different functions

* feat: make locking optional in the `EncryptionSync`

* feat: experimental notification client that retries decryption if it failed the first time

* fix: don't iloop retrying decryption

* chore: helper to convert from bool to `WithLocking`

* feat: don't loop and just retry decryption of the notification event linearly

* feat: remove unused set_notification_delegate

Dead code is dead.

* ffi: get rid of `get_notification_item` and introduce the `NotificationClient`

* fmt

* feat: don't swallow encryption sync errors when retrying notification event decryption

* keeping a tidy commit history is NP-hard

* will i ever learn

* chore: enable experimental-notification-client in the FFI crate

* test: add basic integration test for the common path

* Address first batch of review comments, thanks Jonas!
2023-07-10 18:06:13 +02:00
Vladimir Panteleev
a094e10b35 base: Add unit test for deserialization failure of join events 2023-07-10 15:59:21 +02:00
Vladimir Panteleev
ab781bf5f4 base: Fix deserialization failure leading to database corruption
f36a5b8cd7 introduced
deserialize_events, moving the deserialization out of handle_state.
However, the new code in deserialize_events used filter_map, which
caused a deserialization failure to lead to the indices of the
serialized and deserialized events to no longer match up.

This was not caught because iter::zip also does not require that its
arguments have matching lengths, causing the mismatch to cascade for
that batch of events, and persist in the store.  An application
affected by this form of corruption can, for example, call
room.get_state_events requesting events of a certain type, and getting
back events of a different type.

Fix the bug by using Option to preserve the length of
deserialize_events' return value, and add an assertion to ensure
handle_state's contract.

Signed-off-by: Vladimir Panteleev <git@cy.md>
2023-07-10 15:59:21 +02:00
Jonas Platte
6ea806bf18 base: Fix clippy lints 2023-07-10 14:03:58 +02:00
Richard van der Hoff
57ea8173ae Merge pull request #2248 from matrix-org/release-matrix-sdk-crypto-js-0.1.2
matrix-sdk-crypto-js v0.1.2
2023-07-10 12:27:10 +01:00
Richard van der Hoff
bf1595309c matrix-sdk-crypto-js v0.1.2 matrix-sdk-crypto-js-0.1.2 2023-07-10 12:03:32 +01:00
Richard van der Hoff
caa70db31b Prepare changelog for v0.1.2 2023-07-10 12:03:12 +01:00
aringenbach
89aa2916c7 ui/ffi: Add timestamp to reactions 2023-07-10 10:13:53 +00:00
Benjamin Bouvier
2225e8ad80 feat: make it possible to configure the state store as an in-memory store in FFI 2023-07-10 12:04:52 +02:00
Richard van der Hoff
708a7d95a7 Add Qr.state() 2023-07-10 11:45:33 +02:00
Richard van der Hoff
0ccb1efded Enable rust-sdk tracing for device tests
... because knowing why your tests are failing is nice
2023-07-10 11:45:33 +02:00
Richard van der Hoff
0a5ef29c34 device.test: Stop pretending we have independent tests
This file claimed to have lots of tests, but actually they are not independent
- they are just one big test.

It's not ideal to have one massive test like this, but I don't really have time
to rewrite them and we should stop pretending.
2023-07-10 11:45:33 +02:00
Damir Jelić
9f68b3838f Merge pull request #2142 from matrix-org/andybalaam/cache-last-event-in-roominfo
Store the last timeline event in RoomInfo
2023-07-10 11:30:13 +02:00
Jonas Platte
0a6234f40a ffi: Send initial back-pagination status to subscriber immediately
… right as the subscriber is registered.
2023-07-10 11:07:43 +02:00
Kévin Commaille
4e52125551 ui: Allow to filter events added to the Timeline
To avoid to deal with events we are not interested in in the stream.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-07-07 22:20:14 +02:00