Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nanpa/rpc-race.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patch package="livekit-ffi" type="fixed" "Fix RPC invocation race bug"
4 changes: 2 additions & 2 deletions livekit-ffi/src/server/participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ async fn forward_rpc_method_invocation(
let (tx, rx) = oneshot::channel();
let invocation_id = server.next_id();

room.store_rpc_method_invocation_waiter(invocation_id, tx);

let _ = server.send_event(proto::ffi_event::Message::RpcMethodInvocation(
proto::RpcMethodInvocationEvent {
local_participant_handle: local_participant_handle as u64,
Expand All @@ -152,8 +154,6 @@ async fn forward_rpc_method_invocation(
},
));

room.store_rpc_method_invocation_waiter(invocation_id, tx);

rx.await.unwrap_or_else(|_| {
Err(RpcError {
code: RpcErrorCode::ApplicationError as u32,
Expand Down