1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-06-27 16:35:59 +00:00

fix(key_value): return a map of algorithms instead of key ids for count_one_time_keys

this regession was introduced in 2a7aa6242f
This commit is contained in:
Matthias Ahouansou 2025-05-11 12:27:08 +01:00
parent 17f56081ce
commit 45861f8e4a
No known key found for this signature in database

View file

@ -406,11 +406,12 @@ impl service::users::Data for KeyValueDatabase {
self.onetimekeyid_onetimekeys
.scan_prefix(userdeviceid)
.map(|(bytes, _)| {
serde_json::from_slice::<OneTimeKeyAlgorithm>(
serde_json::from_slice::<OwnedOneTimeKeyId>(
bytes.rsplit(|&b| b == 0xff).next().ok_or_else(|| {
Error::bad_database("OneTimeKey ID in db is invalid.")
})?,
)
.map(|key_id| key_id.algorithm())
.map_err(|_| Error::bad_database("DeviceKeyId in db is invalid."))
})
{