Richard van der Hoff
2d3ee89477
delint, again
2023-11-19 14:50:02 +00:00
Richard van der Hoff
cb1827f151
delint
2023-11-17 18:37:57 +00:00
Richard van der Hoff
4299697935
Implement a custom event formatter for javascript logging
...
Somehow `fmt::pretty` manages to be both overcomplicated and not flexible
enough.
The driver here is that I want to put the event "fields" on a separate line to
the message.
2023-11-17 18:30:21 +00:00
Richard van der Hoff
5786b1a631
Update changelog for matrix-sdk-crypto ( #2837 )
...
- Add an entry which I forgot for #2805
- Reorder a few other items that have been added since
https://github.com/matrix-org/matrix-rust-sdk/pull/2591 .
2023-11-10 12:19:40 +00:00
Val Lorentz
445bf3b02a
Add missing "room_id" to test_json::MEMBERS
...
It doesn't matter at the moment as the only test using `test_json::MEMBERS`
does not rely on the event being valid, but it shows this error
nonetheless:
```
2023-11-10T08:54:29.920782Z DEBUG receive_members{room_id="!hIMjEx205EXNyjVPCV:localhost"}: matrix_sdk_base::client: Failed to deserialize member event: missing field `room_id` at line 1 column 297 event_id="$151800140517rfvjc:localhost"
```
and https://spec.matrix.org/v1.8/client-server-api/#get_matrixclientv3roomsroomidmembers
says it is a required key.
2023-11-10 09:35:47 +00:00
Richard van der Hoff
71a2d23bf3
Handle missing devices in /keys/claim responses ( #2805 )
...
Keep a record of devices that were included in a /keys/claim request, and then, if they are missing in the response, register them as "failed".
2023-11-09 18:30:10 +00:00
Damir Jelić
955d611aaa
Bump our deps so we pull in the new release of ruma-client-api
2023-11-09 17:40:03 +01:00
Ivan Enderlin
0f4a175a99
Merge pull request #2833 from matrix-org/mauroromito/notification_has_mention
...
feat (bindings): `has_mention` in `NotificationItem`
2023-11-09 11:39:33 +01:00
Mauro
b553dbb31c
Merge branch 'main' into mauroromito/notification_has_mention
2023-11-09 11:14:56 +01:00
Benjamin Bouvier
1abe039582
style: decrease indent in GroupSessionManager::mark_request_as_sent
2023-11-09 11:01:50 +01:00
Benjamin Bouvier
6c490b7aec
crypto: inline GroupSessionCache::get_with_id into its single callsite
2023-11-09 11:01:50 +01:00
Benjamin Bouvier
c17acd5fe3
crypto: remove direct usage of GroupSessionCache::sessions_being_shared outside the struct
2023-11-09 11:01:50 +01:00
Benjamin Bouvier
8c05d09e4d
crypto: remove usage of GroupSessionCache::sessions fields in external users
2023-11-09 11:01:50 +01:00
Jonas Platte
72254caf08
sdk: Enable indexeddb in docsrs feature
...
… so `ClientBuilder::indexeddb_store` is visible on docs.rs.
2023-11-09 09:25:39 +01:00
Mauro Romito
b232cd37e8
implement has_mentions
2023-11-08 17:53:06 +01:00
Jonas Platte
6baf092bc8
sdk: Exclude query parameters from logging
...
Unfortunately there are a few requests like
check_registration_token_validity that include secrets in the query
parameters.
2023-11-08 10:58:42 +01:00
Jonas Platte
c109119b35
sdk: Clean up http_client logging
...
- Log URI instead of separate homeserver, path
- Always log query parameters (not just for sliding sync)
- Only log request size for requests that could have a body based on the
HTTP verb
2023-11-08 09:33:39 +01:00
Benjamin Bouvier
8bce5e2416
oidc: add custom hex display to SessionHash
...
The most important thing is that it's stable and doesn't miss any byte.
2023-11-07 16:44:27 +01:00
Benjamin Bouvier
a03b29ac70
oidc(style): avoid qualifying module name when not needed
2023-11-07 16:44:27 +01:00
Benjamin Bouvier
c7f7941734
oidc: use hex logging for the hashed oidc tokens
2023-11-07 16:44:27 +01:00
Kévin Commaille
8895ce40d1
Add test for PaginationOptions::until_num_items
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-11-07 12:36:01 +01:00
Kévin Commaille
edf32e8941
Store back-pagination tokens in same order as timeline
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-11-07 12:36:01 +01:00
Kévin Commaille
73ddd34cb1
Make several requests if the back-pagination token is not updated
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-11-07 12:36:01 +01:00
Kévin Commaille
0916c93641
ui: Update back-pagination token with the first or last event added
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-11-07 12:36:01 +01:00
Kévin Commaille
8a65e32e7e
ui: Update back-pagination token even if chunk is empty or event fails to deserialize
...
Otherwise back-pagination goes in a loop because the token is never correct
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-11-07 12:36:01 +01:00
Jonas Platte
91c4bc0b3e
Upgrade tracing-opentelemetry
2023-11-06 18:41:48 +01:00
Jonas Platte
6f710063b5
Upgrade mas-oidc-client
2023-11-06 18:41:48 +01:00
Jonas Platte
e788a6b099
ffi: Simplify Drop implementation for Client
2023-11-06 16:16:40 +01:00
Jonas Platte
8c1baf6ba8
crypto-ffi: Simplify ManuallyDrop usage
2023-11-06 16:16:40 +01:00
Damir Jelić
99032511aa
Order the changelog, new entries at the top
2023-11-06 15:17:39 +01:00
Damir Jelić
645bbd67df
Remove a unused error type
2023-11-06 14:19:12 +01:00
Damir Jelić
26ede608b0
Add a method which checks if a backup decryption key matches a backup info
2023-11-06 14:19:12 +01:00
Damir Jelić
554aa0404a
Add a higher level method to decrypt backed up room keys
2023-11-06 14:19:12 +01:00
Damir Jelić
3438e7de9b
Add a higher level method to sign backup versions ( #2819 )
2023-11-06 12:50:51 +00:00
Damir Jelić
44bb9a3d8f
Add a method to create an ExportedRoomKey from a BackedUpRoomKey
2023-11-06 13:41:57 +01:00
Damir Jelić
bc5b190509
Add a method to get the RoomKeyBackupInfo to the BackupDecryptionKey
2023-11-06 12:41:22 +01:00
Damir Jelić
2e20f00d99
Add an example for the secret storage support
2023-11-06 10:41:44 +01:00
Damir Jelić
760053b15d
Add a test for the secret storage support in the main crate
2023-11-06 10:41:44 +01:00
Damir Jelić
e599fa1ccf
Add secret storage support to the main SDK crate
2023-11-06 10:41:44 +01:00
Jonas Platte
c7fbfd4db8
ffi: Add MediaFileHandle::persist
2023-11-06 10:32:11 +01:00
Jonas Platte
ad392a1977
sdk: Add MediaFileHandle::persist
2023-11-06 10:32:11 +01:00
Jonas Platte
57136247bf
ffi: Add use_cache parameter to get_media_file
2023-11-06 10:32:11 +01:00
Damir Jelić
e5b06bd6d8
Enable backups in the crypto crate by default
2023-11-03 19:17:10 +01:00
Damir Jelić
beb01eacfa
fixup! Use the better Signatures type in the MegolmV1BackupKey type
2023-11-03 17:01:47 +01:00
Damir Jelić
1e9fab1e4e
Use the better Signatures type in the MegolmV1BackupKey type
2023-11-03 17:01:47 +01:00
Benjamin Bouvier
1be7fab4fd
ffi: have the (ffi) NotificationClient keep the (ffi) Client alive
...
Otherwise, it's possible for the `NotificationClient` to be destroyed *after* the ffi `Client`, and then the hack introduced in the previous commit won't work.
2023-11-03 16:54:54 +01:00
Benjamin Bouvier
ad5761bfb5
fix(ffi): don't leak Client instances
...
A detached task was spawned to react upon session changes, and that task captured a clone of the current `Client`.
This caused a leak of the `Client`, because that task would never get aborted, and would not stop by itself.
The fix here consists in having `Client::set_delegate` return a task handle that needs to be stashed by the FFI
users, and cancelled when the Client gets out of scope. This fixes the leak, by removing the last reference onto
the Client.
Then, when dropping the Client, we have to drop the Stores in it. These stores may be sqlite-based stores, which
make use of deadpool. Deadpool has a sync wrapper that will call `block_on` in a `drop` method, and as such it
requires to be in the scope of a tokio runtime to run properly. To avoid breaking all abstractions and giving
access to the inners of the `Client`, the hack used here to properly be in a runtime when dropping the stores is
to replace the inner sdk `Client` in the FFI `Client::drop` method (and replace it with a dummy client that is
minimally configured and will use in-memory stores).
2023-11-03 16:54:54 +01:00
Damir Jelić
efb72063ac
Add a backup specific method to import room keys
2023-11-03 15:34:11 +01:00
Jonas Platte
9ef6103912
Insert strategic Box::pin to reduce async stack size
2023-11-03 12:23:59 +01:00
Jonas Platte
71c6b98d6a
crypto: Box inner field of Account
...
This reduces its stack size to less than a third of what it previously
was and thus helps with async fn stack size problems.
2023-11-03 12:23:59 +01:00