Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bcherry committed Jan 14, 2025
1 parent d2d66b5 commit 3b93a0e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Sources/LiveKit/Core/Room+EngineDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,25 @@ extension Room {

func room(didReceiveRpcResponse response: Livekit_RpcResponse) {
let requestId = response.requestID
let payload = response.payload
let error = response.error

let payload: String?
let error: RpcError?
switch response.value {
case .payload(let v):
payload = v
error = nil
case .error(let e):
error = .fromProto(e)
payload = nil
default:
log("[Rpc] Response without payload nor error \(response)")
payload = nil
error = nil
break
}

localParticipant.handleIncomingRpcResponse(requestId: requestId,
payload: payload,
error: .fromProto(error))
error: error)
}

func room(didReceiveRpcAck ack: Livekit_RpcAck) {
Expand Down
1 change: 1 addition & 0 deletions Sources/LiveKit/Participant/LocalParticipant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ extension LocalParticipant {
$0.method = method
$0.payload = payload
$0.responseTimeoutMs = UInt32(responseTimeout * 1000)
$0.version = 1
}
}

Expand Down

0 comments on commit 3b93a0e

Please sign in to comment.