fix: avoid panic

This commit is contained in:
Timo Kösters 2021-09-01 22:49:16 +02:00 committed by Jonas Zohren
parent 1b9f56e48c
commit 870c178c8b
3 changed files with 9 additions and 13 deletions

View file

@ -20,16 +20,14 @@ HQ.
#### What is the current status?
As of 2021-09-01 Conduit is Beta, meaning you can join and participate in most
As of 2021-09-01, Conduit is Beta, meaning you can join and participate in most
Matrix rooms, but not all features are supported and you might run into bugs
from time to time.
There are still a few important features missing:
- Database stability (currently you might have to do manual upgrades or even wipe the db for new versions)
- Edge cases for end-to-end encryption over federation
- Typing and presence over federation
- Lots of testing
- E2EE verification over federation
- Outgoing read receipts, typing, presence over federation
Check out the [Conduit 1.0 Release Milestone](https://gitlab.com/famedly/conduit/-/milestones/3).

View file

@ -66,7 +66,11 @@ where
let limit = db.globals.max_request_size();
let mut handle = data.open(ByteUnit::Byte(limit.into()));
let mut body = Vec::new();
handle.read_to_end(&mut body).await.unwrap();
if let Err(_) = handle.read_to_end(&mut body).await {
// Client disconnected
// Missing Token
return Failure((Status::new(582), ()));
}
let mut json_body = serde_json::from_slice::<CanonicalJsonValue>(&body).ok();

View file

@ -1439,13 +1439,7 @@ async fn upgrade_outlier_to_timeline_pdu(
let fork_states = &fork_states
.into_iter()
.map(|map| {
map.into_iter()
.map(|(k, id)| {
(k, (*id).clone())
})
.collect()
})
.map(|map| map.into_iter().map(|(k, id)| (k, (*id).clone())).collect())
.collect::<Vec<_>>();
state_at_incoming_event = match state_res::StateResolution::resolve(