Subscribe to worktree messages at the entity level

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2021-08-18 19:06:46 -06:00
co-authored by Max Brunsfeld
parent ef421d735d
commit 37f24d10ec
7 changed files with 365 additions and 175 deletions
+4 -5
View File
@@ -171,11 +171,10 @@ impl Peer {
}
} else {
router.handle(connection_id, envelope.clone()).await;
match proto::build_typed_envelope(connection_id, envelope) {
Ok(envelope) => {
broadcast_incoming_messages.send(envelope).await.ok();
}
Err(error) => log::error!("{}", error),
if let Some(envelope) = proto::build_typed_envelope(connection_id, envelope) {
broadcast_incoming_messages.send(envelope).await.ok();
} else {
log::error!("unable to construct a typed envelope");
}
}
}