Skip to content

Commit 009ead2

Browse files
committed
chore: Bump Ruma.
1 parent f97aed0 commit 009ead2

File tree

21 files changed

+297
-159
lines changed

21 files changed

+297
-159
lines changed

crates/matrix-qrcode/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ byteorder = "1.4.3"
2727
image = { version = "0.23.14", optional = true }
2828
qrcode = { version = "0.12.0", default-features = false }
2929
rqrr = { version = "0.4.0", optional = true }
30-
ruma-identifiers = { git = "https://github.com/ruma/ruma", rev = "6c4892664" }
3130
thiserror = "1.0.25"
31+
32+
[dependencies.ruma-identifiers]
33+
git = "https://github.com/ruma/ruma/"
34+
rev = "fdbc4d6d1dd273c8a6ac95b329943ed8c68df70d"

crates/matrix-sdk-appservice/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ url = "2"
3737
warp = { version = "0.3.1", optional = true, default-features = false }
3838

3939
[dependencies.ruma]
40-
git = "https://github.com/ruma/ruma"
41-
rev = "6c4892664"
40+
git = "https://github.com/ruma/ruma/"
41+
rev = "fdbc4d6d1dd273c8a6ac95b329943ed8c68df70d"
4242
features = ["client-api-c", "appservice-api-s", "unstable-pre-spec"]
4343

4444
[dev-dependencies]

crates/matrix-sdk-base/Cargo.toml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ rustdoc-args = ["--cfg", "feature=\"docs\""]
1919
default = []
2020
encryption = ["matrix-sdk-crypto"]
2121
qrcode = ["matrix-sdk-crypto/qrcode"]
22-
sled_state_store = ["sled", "pbkdf2", "hmac", "sha2", "rand", "chacha20poly1305"]
22+
sled_state_store = [
23+
"sled",
24+
"pbkdf2",
25+
"hmac",
26+
"sha2",
27+
"rand",
28+
"chacha20poly1305",
29+
]
2330
sled_cryptostore = ["matrix-sdk-crypto/sled_cryptostore"]
2431

2532
docs = ["encryption", "sled_cryptostore"]
@@ -35,7 +42,6 @@ matrix-sdk-common = { version = "0.4.0", path = "../matrix-sdk-common" }
3542
matrix-sdk-crypto = { version = "0.4.0", path = "../matrix-sdk-crypto", optional = true }
3643
pbkdf2 = { version = "0.9.0", default-features = false, optional = true }
3744
rand = { version = "0.8.4", optional = true }
38-
ruma = { git = "https://github.com/ruma/ruma", rev = "6c4892664", features = ["client-api-c", "unstable-pre-spec"] }
3945
serde = { version = "1.0.126", features = ["rc"] }
4046
serde_json = "1.0.64"
4147
sha2 = { version = "0.9.5", optional = true }
@@ -44,6 +50,11 @@ thiserror = "1.0.25"
4450
tracing = "0.1.26"
4551
zeroize = { version = "1.3.0", features = ["zeroize_derive"] }
4652

53+
[dependencies.ruma]
54+
git = "https://github.com/ruma/ruma/"
55+
rev = "fdbc4d6d1dd273c8a6ac95b329943ed8c68df70d"
56+
features = ["client-api-c", "unstable-pre-spec"]
57+
4758
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
4859
version = "1.7.1"
4960
default-features = false
@@ -60,7 +71,10 @@ clap = "2.33.3"
6071
rustyline = "9.0.0"
6172
rustyline-derive = "0.5.0"
6273
syntect = "4.5.0"
63-
tokio = { version = "1.7.1", default-features = false, features = ["rt-multi-thread", "macros"] }
74+
tokio = { version = "1.7.1", default-features = false, features = [
75+
"rt-multi-thread",
76+
"macros",
77+
] }
6478
tempfile = "3.2.0"
6579

6680
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]

crates/matrix-sdk-base/src/client.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ impl BaseClient {
650650
&self,
651651
response: api::sync::sync_events::Response,
652652
) -> Result<SyncResponse> {
653+
#[allow(unused_variables)]
653654
let api::sync::sync_events::Response {
654655
next_batch,
655656
rooms,
@@ -658,6 +659,7 @@ impl BaseClient {
658659
to_device,
659660
device_lists,
660661
device_one_time_keys_count,
662+
device_unused_fallback_key_types,
661663
..
662664
} = response;
663665

@@ -679,8 +681,13 @@ impl BaseClient {
679681
// decrypts to-device events, but leaves room events alone.
680682
// This makes sure that we have the decryption keys for the room
681683
// events at hand.
682-
o.receive_sync_changes(to_device, &device_lists, &device_one_time_keys_count)
683-
.await?
684+
o.receive_sync_changes(
685+
to_device,
686+
&device_lists,
687+
&device_one_time_keys_count,
688+
device_unused_fallback_key_types.as_deref(),
689+
)
690+
.await?
684691
} else {
685692
to_device
686693
}

crates/matrix-sdk-common/Cargo.toml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@ version = "0.4.1"
1313

1414
[dependencies]
1515
async-trait = "0.1.50"
16-
ruma = { git = "https://github.com/ruma/ruma", rev = "6c4892664", features = ["client-api-c"] }
1716
serde = "1.0.126"
1817

18+
[dependencies.ruma]
19+
git = "https://github.com/ruma/ruma/"
20+
rev = "fdbc4d6d1dd273c8a6ac95b329943ed8c68df70d"
21+
features = ["client-api-c"]
22+
1923
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
20-
uuid = { version = "0.8.2", default-features = false, features = ["v4", "serde"] }
24+
uuid = { version = "0.8.2", default-features = false, features = [
25+
"v4",
26+
"serde",
27+
] }
2128

2229
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
2330
version = "1.7.1"
@@ -36,4 +43,8 @@ features = ["now"]
3643
async-lock = "2.4.0"
3744
futures-util = { version = "0.3.15", default-features = false, features = ["channel"] }
3845
wasm-bindgen-futures = "0.4.24"
39-
uuid = { version = "0.8.2", default-features = false, features = ["v4", "wasm-bindgen", "serde"] }
46+
uuid = { version = "0.8.2", default-features = false, features = [
47+
"v4",
48+
"wasm-bindgen",
49+
"serde",
50+
] }

crates/matrix-sdk-crypto/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ matrix-sdk-common = { version = "0.4.0", path = "../matrix-sdk-common" }
3838
olm-rs = { version = "2.1", features = ["serde"] }
3939
pbkdf2 = { version = "0.9.0", default-features = false }
4040
rand = "0.8.4"
41-
ruma = { git = "https://github.com/ruma/ruma", rev = "6c4892664", features = [
42-
"client-api-c",
43-
"unstable-pre-spec",
44-
] }
4541
serde = { version = "1.0.126", features = ["derive", "rc"] }
4642
serde_json = "1.0.64"
4743
sha2 = "0.9.5"
@@ -50,6 +46,11 @@ thiserror = "1.0.25"
5046
tracing = "0.1.26"
5147
zeroize = { version = "1.3.0", features = ["zeroize_derive"] }
5248

49+
[dependencies.ruma]
50+
git = "https://github.com/ruma/ruma/"
51+
rev = "fdbc4d6d1dd273c8a6ac95b329943ed8c68df70d"
52+
features = ["client-api-c", "unstable-pre-spec"]
53+
5354
[dev-dependencies]
5455
criterion = { version = "0.3.4", features = [
5556
"async",

crates/matrix-sdk-crypto/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ async fn main() -> Result<(), OlmError> {
3333
let to_device_events = ToDevice::default();
3434
let changed_devices = DeviceLists::default();
3535
let one_time_key_counts = BTreeMap::default();
36+
let unused_fallback_keys = Some(Vec::new());
3637
3738
// Push changes that the server sent to us in a sync response.
3839
let decrypted_to_device = machine.receive_sync_changes(
3940
to_device_events,
4041
&changed_devices,
41-
&one_time_key_counts
42+
&one_time_key_counts,
43+
unused_fallback_keys.as_deref(),
4244
).await?;
4345
4446
// Pull requests that we need to send out.

crates/matrix-sdk-crypto/src/backups/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ use std::{
3030

3131
use matrix_sdk_common::{locks::RwLock, uuid::Uuid};
3232
use ruma::{
33-
api::client::r0::backup::RoomKeyBackup, DeviceKeyAlgorithm, DeviceKeyId, RoomId, UserId,
33+
api::client::r0::backup::RoomKeyBackup, serde::Raw, DeviceKeyAlgorithm, DeviceKeyId, RoomId,
34+
UserId,
3435
};
3536
use serde::{Deserialize, Serialize};
3637
use serde_json::Value;
@@ -369,6 +370,11 @@ impl BackupMachine {
369370
.or_default()
370371
.insert(session_id.clone());
371372

373+
let session = Raw::from_json(
374+
serde_json::value::to_raw_value(&session)
375+
.expect("Can't serialize a backed up room key"),
376+
);
377+
372378
backup
373379
.entry(room_id)
374380
.or_insert_with(|| RoomKeyBackup::new(BTreeMap::new()))

crates/matrix-sdk-crypto/src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,6 @@ pub(crate) enum SessionCreationError {
213213
DeviceMissingCurveKey(Box<UserId>, Box<DeviceId>),
214214
#[error("Error creating new Olm session for {0} {1}: {2:?}")]
215215
OlmError(Box<UserId>, Box<DeviceId>, OlmSessionError),
216+
#[error("Error deserializing the one-time key: {0}")]
217+
InvalidJson(#[from] serde_json::Error),
216218
}

0 commit comments

Comments
 (0)