Commit Graph

8002 Commits

Author SHA1 Message Date
Benjamin Bouvier
ddb44d35cd read receipts: extract create_sync_index out of compute_notifications and unit-test it 2024-01-18 16:48:47 +01:00
Benjamin Bouvier
8de6345d0f test: add test for multiple receipts coming in the same sync 2024-01-18 16:48:47 +01:00
Benjamin Bouvier
e6d33eaf90 test: use existing make_receipt_event_content test helper 2024-01-18 16:48:47 +01:00
Benjamin Bouvier
fa74602c65 test: introduce test helper sync_timeline_message 2024-01-18 16:48:47 +01:00
Benjamin Bouvier
5cbc34811f read receipts: use sync order
No caching. Step 1 make it correct, etc.
2024-01-18 16:48:47 +01:00
Benjamin Bouvier
2d60611a44 read receipts: don't repeat iterating over older events if the server sent us the same receipt twice 2024-01-18 16:48:47 +01:00
Andy Balaam
ff387609c3 Merge pull request #3012 from matrix-org/andybalaam/batch-indexeddb-fetch-for-get_inbound_group_sessions
indexeddb: Attempt to fix export crashes by batching DB operations in get_inbound_group_sessions
2024-01-18 13:40:20 +00:00
Andy Balaam
b05a0ecb3b indexeddb: Batch DB access in get_inbound_group_sessions
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
2024-01-18 13:28:14 +00:00
Valere
784c7459fe refactor(bootstrap): init cross-signing with other e2e initial task (#3024)
In existing code the bootstraping is done in different places:
  - in `bootstrap_cross_signing_if_needed` 
  - or in `run_intialization_tasks`

And both are based on the same EncryptionSettings.
`bootstrap_cross_signing_if_needed` was done by `LoginBuilder` but `run_intialization_tasks` by `MatrixAuth`. 

I propose to move all that under `run_intialization_tasks` that has already support to do it in background, and to call it in one place only: `MatrixAuth`

Also Fixes https://github.com/matrix-org/matrix-rust-sdk/issues/2763

## Notes

- Some tests have been updated to properly `wait_for_e2ee_initialization_tasks`

- `bootstrap_cross_signing_if_needed` might require re-authentication. Which I suppose was the original reason to have that in a seperate place. But given that the need to re-auth will soon be deprecated for bootstrap (when this [MSC](https://github.com/matrix-org/matrix-spec-proposals/pull/3967) will land); so for now we pass the authentication info to `run_intialization_tasks` if any. 

---

* refactor(bootstrap): init cross-signing with other e2e initial task

* fix compilation warning for NoEncryption feature set

* Doc and Formatting: Improve doc and formatting

* Fix missing import with encryption feature flag
2024-01-18 14:25:50 +01:00
Benjamin Bouvier
18065cb42e ffi: remove unused RoomListItem::full_room_blocking() function
The Kotlin leaks have been fixed nowadays.
2024-01-18 12:30:47 +01:00
Richard van der Hoff
01d11888f4 RELEASE.md: remove spurious backticks
Signed-off-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2024-01-18 10:31:36 +01:00
Richard van der Hoff
8aef687dcb Merge pull request #3026 from matrix-org/rav/remove_base_dep
indexeddb, sqlite: Avoid dependency on `matrix-sdk-base`
2024-01-17 09:19:15 +00:00
Richard van der Hoff
79bb716298 Inline matrix_sdk_sqlite::make_store_config
... mostly for parity with `matrix_sdk_indexeddb::make_store_config`, but
again, simplifying the dependency graph.
2024-01-16 18:13:51 +00:00
Richard van der Hoff
8ef09b4044 indexeddb: Replace make_store_config
Replace `make_store_config` with a pair of funtions `open_stores_with_name` and
`open_state_store`. This allows us to remove a dependency on
`matrix-sdk-base/e2e-encryption`, and generally simplifies things.
2024-01-16 18:13:51 +00:00
Richard van der Hoff
5f435a86ee Factor out build_store_config function 2024-01-16 12:57:18 +00:00
Andy Balaam
58be7b0f3d Merge pull request #3013 from matrix-org/andybalaam/retain-in-export_room_keys
crypto: Improve memory overhead of export_room_keys by using Vec::retain
2024-01-15 11:59:33 +00:00
Andy Balaam
7034104ef1 fixup! crypto: Improve memory overhead of export_room_keys by using Vec::retain 2024-01-15 10:05:42 +00:00
Denis Kasak
c4113060b2 refactor: Simplify construction of main crate UserIdentity.
Instead of needing three methods, we now only need one: since we use the
crypto crate enum directly, we no longer need to convert between the
crypto crate and main crate enums.

Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2024-01-14 18:29:57 +01:00
Denis Kasak
3d1de1f583 refactor: Simplify main crate user identities types.
Specifically, this removes the following redundant types in the main
crate:

- enum UserIdentities
- struct OwnUserIdentity
- struct OtherUserIdentity

This is possible because `OwnUserIdentity` and `OtherUserIdentity` are
exactly the same as their crypto crate counterparts, except they also
wrap a `Client`.

As a consequence, the main crate enum `UserIdentities` is isomorphic to
a struct containing:

1. the crypto crate `UserIdentities`
2. a `Client`

So this commit performs that transformation.

Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
2024-01-14 18:29:57 +01:00
Sami J. Mäkinen
147f1d3f6c Upgrade aquamarine dependency 2024-01-14 11:20:12 +00:00
Kévin Commaille
e3af74739d ui: Improve logging of toggle reaction failures
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-01-13 21:19:55 +01:00
Kévin Commaille
8d0867a1a8 ui: Forward server failures to toggle reaction to user
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2024-01-13 21:19:55 +01:00
Benjamin Bouvier
cfe3bb7cef sdk: expose SqliteStateStore for symmetry with the crypto store export 2024-01-13 09:25:05 +01:00
Benjamin Bouvier
95b95aae5f Apply suggestions from code review
Co-authored-by: Jonas Platte <jplatte@matrix.org>
Signed-off-by: Benjamin Bouvier <public@benj.me>
2024-01-12 17:20:10 +01:00
Benjamin Bouvier
83d7cd5430 docs: explain how to release the SDK in RELEASE.md 2024-01-12 17:20:10 +01:00
Benjamin Bouvier
d0e5d84bff docs: add commit messages and PR titles guidelines 2024-01-12 17:20:10 +01:00
Mauro
fb4b5ea48f ffi bindings: Expose members_no_sync (#3004)
As it is useful to allow fetching members from the store in offline contexts.
2024-01-12 17:01:05 +01:00
Andy Balaam
985f9f9b07 crypto: Improve memory overhead of export_room_keys by using Vec::retain
Signed-off-by: Andy Balaam <andy.balaam@matrix.org>
2024-01-12 15:05:13 +00:00
Mauro
c7f7828368 ffi: Expose is_name_ambiguous for notification item 2024-01-12 10:28:48 +00:00
Benjamin Bouvier
3fea9ae51a crypto: rename Account::generate_one_time_keys_helper to generate_one_time_keys 2024-01-11 16:19:12 +01:00
Benjamin Bouvier
3c4b892129 crypto: rename Account::generate_one_time_keys to Account::generate_one_time_keys_if_needed 2024-01-11 16:19:12 +01:00
Benjamin Bouvier
a7d2ff327d style: reduce indent in generate_one_time_keys 2024-01-11 16:19:12 +01:00
Benjamin Bouvier
90c1858389 style: don't use a large outer Ok with ? in it 2024-01-11 16:19:12 +01:00
Benjamin Bouvier
289268a60b crypto: make it clearer receive_to_device_event is infallible 2024-01-11 16:19:12 +01:00
Benjamin Bouvier
04d1fd4b8a test: rename create_session_for to create_session_for_test_helper
To make it easier to see it's a test function when looking up callers/callees.
2024-01-11 16:19:12 +01:00
Ivan Enderlin
97b2a20338 Merge pull request #3007 from matrix-org/revert-3006-revert-2995-rav/indexeddb_optional_base
Revert "Revert "matrix-sdk-indexeddb: make `matrix-sdk-base` an optional dependency""
2024-01-11 15:21:05 +01:00
Ivan Enderlin
62641adfeb Revert "Revert "matrix-sdk-indexeddb: make matrix-sdk-base an optional dependency"" 2024-01-11 15:20:38 +01:00
Ivan Enderlin
6e407989e8 Merge pull request #3006 from matrix-org/revert-2995-rav/indexeddb_optional_base
Revert "matrix-sdk-indexeddb: make `matrix-sdk-base` an optional dependency"
2024-01-11 15:18:27 +01:00
Ivan Enderlin
1521ec6cb2 Revert "matrix-sdk-indexeddb: make matrix-sdk-base an optional dependency" 2024-01-11 15:05:00 +01:00
Ivan Enderlin
b3ada6cb37 Merge pull request #3003 from matrix-org/mauroromito/better_naming_for_msc4028
Improving documentation: Can push encrypted events to device
2024-01-11 14:13:28 +01:00
Mauro
21b7e54a59 Merge branch 'main' into mauroromito/better_naming_for_msc4028 2024-01-11 12:16:20 +01:00
Benjamin Bouvier
463b0dfb91 sliding sync: make the maximum number of room facultative when updating a room 2024-01-11 11:38:26 +01:00
Benjamin Bouvier
f48695cc95 Test that an extension causing a room update will mark the room as updated 2024-01-11 11:38:26 +01:00
Benjamin Bouvier
395a39e039 sliding sync: mark room/list as updated whenever a room is updated by an extension
Some sliding sync responses may include extension data that will cause an update to the room, but the room itself may not be in the set of
rooms as returned in the top-level `rooms` fields of the response. This may cause missed updates for rooms, since notifiers won't be notified
about those.

This fixes that, by making sure that a `RoomInfo`-only update will cause the room (and the lists that contain it) to be marked as updated.
2024-01-11 11:38:26 +01:00
Mauro Romito
e37f5e5ac3 ffi docs: renamed push encrypted event FFI API
and improved the documentation
2024-01-11 11:35:21 +01:00
Benjamin Bouvier
1bc921f373 integration tests: remove useless qualifications 2024-01-11 10:30:16 +01:00
Benjamin Bouvier
36e69f30ec crypto ffi: use a u64 for timestamps
Fixes https://github.com/matrix-org/matrix-rust-sdk/issues/2974
2024-01-11 10:30:16 +01:00
Ivan Enderlin
82c60116ef Merge pull request #2995 from matrix-org/rav/indexeddb_optional_base
matrix-sdk-indexeddb: make `matrix-sdk-base` an optional dependency
2024-01-10 10:52:29 +01:00
Ivan Enderlin
840cb97c21 Merge pull request #3001 from matrix-org/andybalaam/tests-for-inbound-group-session-serialization
Tests for serialization of InboundGroupSessionIndexedDbObject
2024-01-10 10:23:22 +01:00
Benjamin Bouvier
ae15595af1 cleanup: move homeserver overriding to the SendRequest struct 2024-01-09 16:54:58 +01:00