-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update protocol to v15 #394
Conversation
Currently Rust stack is on protocol version 9. part of this update will require bringing it to 10+. and I think we should just bring it up to date to support protocol 15. Here are the changes required (JS PRs) |
exported as LocalTrackSubscribed in the client and FFI.
9d7ba47
to
739c00e
Compare
v10 through v13 added or already there. re: |
yeah no-op is fine. we can add the capability later of firing error responses for things, but not required to be protocol-compatible. |
739c00e
to
dd5fe53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work! Just a couple of things:
- see inline about handling action
- the streamID change is a bit tricky and we would need to test e2e to be sure. the way to test is creating a room with sync-stream enabled:
lk room create --name <myroom> --sync-streams
- then starting a publisher immediately:
lk load-test --room <myroom> --publishers 1 --audio-publishers 1
- then join the room with Rust and ensure both streams are retrieved correctly
@@ -778,8 +798,8 @@ impl SessionInner { | |||
async fn simulate_scenario(&self, scenario: SimulateScenario) -> EngineResult<()> { | |||
let simulate_leave = || { | |||
self.on_signal_event(proto::signal_response::Message::Leave(proto::LeaveRequest { | |||
action: proto::leave_request::Action::Reconnect.into(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't look like this is handled? this would determine if a client should reconnect vs disconnect for good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from what i've seen rust-sdks reconnection logic is fundamentally different, and doesn't use LeaveRequest
for retrying at all? it attempts to restart the publisher, or completely closing it (with Action::Disconnect
) then reconnecting and recovering? i'll see if i can make it consistent with JS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the key here is if server is not sending a reconnect action, Rust should not attempt to reconnect. CC: @theomonnom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also can confirm streams are received and handled correctly
d4349fc
to
df2392c
Compare
df2392c
to
ad4baad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, seems like it is still not returning an Error when receiving a bad RequestResponse.
(e.g update_metadata, ..)
0c7c83a
to
00583a8
Compare
livekit/src/room/mod.rs
Outdated
@@ -69,6 +69,8 @@ pub enum RoomError { | |||
TrackAlreadyPublished, | |||
#[error("already closed")] | |||
AlreadyClosed, | |||
#[error("request error: {}", .0.message)] | |||
Request(proto::RequestResponse), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you recreate another struct, basically having the same fields of the RequestResponse but removing the internal fields like the request_id
_ => Err(RoomError::Request(response)), | ||
} | ||
} else { | ||
log::error!("could not receive response for set_metadata request"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logs aren't useful if we're already returning an error
.await; | ||
Ok(()) | ||
if let Ok(response) = timeout(REQUEST_TIMEOUT, { | ||
let request_id = self.inner.rtc_engine.session().signal_client().request_id(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be moved to the Room impl? request_id doesn't necessarily needs to be on the signal client?
Also making it more explicit like "new_request_id"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the JS SDK puts it in the signal client, but it's a bit more cumbersome here, yeah
we can maybe move it to RtcEngine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise
exported as LocalTrackSubscribed in the client and FFI.
at the moment the SFU assumes Rust doesn't accept TrackSubscribed so it doesn't send it: see livekit/livekit#2939