Kévin Commaille
407375ad17
base: Move StateStore::get_member_event to StateStoreExt
...
It is a wrapper around get_state_event_static_for_key
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-06-06 11:56:11 +02:00
Kévin Commaille
83e7afab5d
sdk: Allow to get stripped state events from the store
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-06-01 11:13:24 +02:00
Kévin Commaille
ea826a257d
sdk: Replace Sled with SQLite as defaut store
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-05-08 12:11:10 +02:00
Kévin Commaille
09e446b1d5
sqlite: Fix doc error
...
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-05-08 12:11:10 +02:00
Jonas Platte
88580d95bf
Consistently use Ruma's Owned*Id types
...
… for simplicity; instead of `Arc<*Id>`.
2023-05-05 12:34:15 +02:00
Jonas Platte
37be24ee19
sqlite: Fix compiler warnings
2023-05-03 11:42:50 +02:00
Benjamin Bouvier
be41dcf300
Remove unused dependencies
2023-05-02 15:06:46 +02:00
Kévin Commaille
6ca6a9a84a
Implement SQLite state store
...
Co-authored-by: Jonas Platte <jplatte@matrix.org >
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-04-26 17:51:11 +02:00
Kévin Commaille
91da155b55
sqlite: Change signatures of SqliteObjectExt methods
...
Allows to pass owned strings as well as static strings
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr >
2023-04-26 17:51:11 +02:00
Jonas Platte
40272c5989
refactor: Move sqlite crypto store migrations in new subdirectory
2023-04-26 17:51:11 +02:00
Damir Jelić
cd865d21c3
Drop outbound group sessions in the SQLite store
...
The format of the outbound group session struct has changed. We nowadays correctly rotate the group session if we can't restore it, but it's still good to avoid logging the error in this case.
2023-04-13 14:48:14 +00:00
Damir Jelić
316b29c95f
Merge branch 'main' into valere/msc_2399
2023-04-13 10:59:05 +02:00
Damir Jelić
c73aeef2ed
Fix the serialization of outbound group sessions in the SQLite store
...
The SQLite crypto store uses rmp_serde to serialize all the data we're
going to store. This works nicely for most things, one exception to this
is the OutboundGroupSession type.
The OutboundGroupSession type stores to-device requests to ensure that
the session doesn't get used before it is shared with the whole group
and to ensure that the to-device requests get restored if the
session gets restored after an application restart.
The to-device requests type critically contain `Raw<AnyToDeviceEvent>`,
the `Raw` type here being the serde_json::Raw type. rmp_serde seems to
serialize this just fine, but later deserialization fails.
We're avoiding the issue by using serde_json to serialize the
OutboundGroupSession.
2023-04-11 10:08:06 +02:00
Damir Jelić
0f8da0b723
Test that to-device requests in the group session can get deserialized
2023-04-11 10:08:06 +02:00
Damir Jelić
6fd129dcfa
Remove some commented out code and fix some formatting
2023-04-05 13:22:41 +02:00
Damir Jelić
50d477b91c
More clippy fixes
2023-04-05 11:54:29 +02:00
Damir Jelić
81e2725b6f
Remove DirectWithheldCode
2023-04-04 13:30:29 +02:00
Jonas Platte
7dd086fcdc
Make sqlite bundling optional
2023-03-30 17:59:51 +02:00
Jonas Platte
d680b331d0
Make tokio a workspace dependency
2023-03-28 21:08:57 +02:00
Jonas Platte
cd33d8ca38
Always use RwLock and Mutex from tokio
...
… instead of async-lock, which we previously used on wasm.
2023-03-28 21:08:57 +02:00
Damir Jelić
61ea15eb39
Merge branch 'main' into valere/msc_2399
2023-03-15 19:31:04 +01:00
Andy Uhnak
283137f190
Introduce RoomSettings
2023-03-14 10:27:11 +00:00
Andy Uhnak
7e7c91699f
Generic key-value API
2023-03-14 10:27:11 +00:00
Andy Uhnak
b4b111f91f
Store encryption settings
2023-03-14 10:27:11 +00:00
valere
9733d9842a
Merge branch 'main' into valere/msc_2399
2023-03-09 17:04:21 +01:00
Jonas Platte
68f8ed5a92
Add futures-util as a workspace dependency
...
… and always activate its `alloc` feature.
Fixes building matrix-sdk without the e2e-encryption feature.
2023-03-08 15:03:20 +01:00
valere
0ec3aca727
refactor(withheld) store withheld as ShareInfo
...
and store no_olm sent in device
2023-03-07 18:46:52 +01:00
valere
6cc31a0e13
fix clippy
2023-02-24 17:15:51 +01:00
valere
6b948711b9
feat(withheld) Integration tests
2023-02-23 17:47:57 +01:00
valere
e56d380f65
fix store after rebase
2023-02-22 14:28:20 +01:00
valere
3dbad4229a
feat(withheld): sql store support
2023-02-21 15:05:14 +01:00
valere
0154cccd4b
feat(withheld) Remember no_olm and implement in memory store
2023-02-21 15:03:04 +01:00
Jonas Platte
3a516a5fce
refactor(sqlite): Use internal Error in CryptoStore impl
2023-02-13 12:05:04 +01:00
Jonas Platte
c6f0e47077
refactor(crypto)!: Add an error type to the CryptoStore trait
...
This makes it easier to implement it. However, using a different error
type than CryptoStoreError is a non-trivial change, so left for the
coming commits for all stores except the memory store.
2023-02-13 12:05:04 +01:00
Jonas Platte
e430f65ce8
ci: Exclude Debug implementations from coverage reports
...
We don't really want to check for exact representations, and otherwise
they are really just invoked in tests that fail.
2023-02-10 13:46:00 +01:00
Jonas Platte
e25061f8cb
refactor(crypto)!: Unwrap unused Result
2023-02-08 16:04:29 +01:00
Jonas Platte
345f4f39f4
refactor(sqlite): Make Error more precise / useful
2023-02-08 15:44:17 +01:00
Jonas Platte
e12b9e3027
refactor(sqlite): Encode olm hashes with rmp instead of serde_json
...
… like everything else in the sqlite crypto store.
2023-02-08 15:44:17 +01:00
Jonas Platte
a22529344a
refactor(sqlite): Inline inherent methods that duplicate trait methods
2023-02-08 15:44:17 +01:00
Jonas Platte
64b7c4eb59
refactor(sqlite): Make OpenStoreError more precise / useful
2023-02-08 15:44:17 +01:00
Jonas Platte
1988d1e9a3
refactor(sqlite): Move sqlite extension traits to utils module
2023-02-08 15:44:17 +01:00
Jonas Platte
efc2397267
refactor(sqlite): Always use rusqlite::Error for sqlite extension traits
2023-02-08 15:44:17 +01:00
Jonas Platte
ecb521205f
refactor(sqlite): Move error types into new error module
2023-02-08 15:44:17 +01:00
Jonas Platte
7db40746bb
refactor(sqlite): Start cleaning up cfg attributes
2023-02-08 15:44:17 +01:00
Jonas Platte
b436918cb3
fix(sqlite): Fix Debug output for SqliteCryptoStore
2023-02-06 17:08:21 +01:00
Jonas Platte
b20424b8b5
chore(sqlite): Undo weird formatting of TOML file
2023-02-06 17:08:21 +01:00
dependabot[bot]
fc8cd2e7e5
chore(deps): bump tokio from 1.24.1 to 1.24.2
...
Bumps [tokio](https://github.com/tokio-rs/tokio ) from 1.24.1 to 1.24.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases )
- [Commits](https://github.com/tokio-rs/tokio/commits )
---
updated-dependencies:
- dependency-name: tokio
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-02-04 08:27:50 +01:00
Anderas
e9cef35f99
Add matrix-sdk-sqlite with a CryptoStore implementation
...
Note about "Write-Ahead Log" (WAL) mode: The SQLite WAL mode has a
bunch of advantages that are quite nice to have:
1. WAL is significantly faster in most scenarios.
2. WAL provides more concurrency as readers do not block writers and a
writer does not block readers. Reading and writing can proceed
concurrently.
3. Disk I/O operations tends to be more sequential using WAL.
4. WAL uses many fewer fsync() operations and is thus less vulnerable
to problems on systems where the fsync() system call is broken.
The downsides of WAL mode don't really affect us. So let's turn it on.
More info: https://www.sqlite.org/wal.html
Co-authored-by: Jonas Platte <jplatte@matrix.org >
Co-authored-by: Damir Jelić <poljar@termina.org.uk >
2023-02-01 15:06:59 +01:00