huskies: merge 948
This commit is contained in:
@@ -167,7 +167,7 @@ pub fn build_routes(
|
||||
#[poem::handler]
|
||||
pub async fn rpc_http_handler(body: poem::web::Json<serde_json::Value>) -> poem::Response {
|
||||
let text = serde_json::to_string(&body.0).unwrap_or_default();
|
||||
match crate::crdt_sync::try_handle_rpc_text(&text) {
|
||||
match crate::crdt_sync::try_handle_rpc_text(&text).await {
|
||||
Some(response) => {
|
||||
let json = serde_json::to_string(&response).unwrap_or_default();
|
||||
poem::Response::builder()
|
||||
|
||||
@@ -97,7 +97,7 @@ pub async fn ws_handler(ws: WebSocket, ctx: Data<&Arc<AppContext>>) -> impl poem
|
||||
};
|
||||
|
||||
// Handle read-RPC frames (discriminated by "kind", not "type").
|
||||
if let Some(rpc_resp) = crate::crdt_sync::try_handle_rpc_text(&text) {
|
||||
if let Some(rpc_resp) = crate::crdt_sync::try_handle_rpc_text(&text).await {
|
||||
if let Ok(resp_text) = serde_json::to_string(&rpc_resp) {
|
||||
let _ = raw_tx.send(resp_text);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ pub async fn ws_handler(ws: WebSocket, ctx: Data<&Arc<AppContext>>) -> impl poem
|
||||
|
||||
Some(Ok(WsMessage::Text(inner_text))) = stream.next() => {
|
||||
// Handle read-RPC frames during active chat.
|
||||
if let Some(rpc_resp) = crate::crdt_sync::try_handle_rpc_text(&inner_text) {
|
||||
if let Some(rpc_resp) = crate::crdt_sync::try_handle_rpc_text(&inner_text).await {
|
||||
if let Ok(resp_text) = serde_json::to_string(&rpc_resp) {
|
||||
let _ = raw_tx.send(resp_text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user