-
Notifications
You must be signed in to change notification settings - Fork 158
Handle room moved #857
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
base: main
Are you sure you want to change the base?
Handle room moved #857
Conversation
hiroshihorie
left a comment
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 JS SDK emits both RemoteParticipant disconnected / connected events (by using the normal participant disconnect flow etc), maybe we should do that also ?
| func signalClient(_: SignalClient, didReceiveRoomMoved response: Livekit_RoomMovedResponse) async { | ||
| log("didReceiveRoomMoved to room: \(response.hasRoom ? response.room.name : "unknown")") | ||
|
|
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.
We might need to update the room's token to Livekit_RoomMovedResponse.token.
| // Re-add participants | ||
| var participantsToAdd: [Livekit_ParticipantInfo] = [] | ||
| if response.hasParticipant { | ||
| participantsToAdd.append(response.participant) | ||
| } | ||
| participantsToAdd.append(contentsOf: response.otherParticipants) | ||
|
|
||
| for info in participantsToAdd { | ||
| _state.mutate { $0.updateRemoteParticipant(info: info, room: self) } | ||
| } |
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’s not well documented, but response.participant appears to be a LocalParticipant. We should probably call localParticipant.updateInfo instead. (I’m not sure if any of the info actually changes, though.)
| _state.mutate { | ||
| $0.metadata = response.room.metadata | ||
| $0.isRecording = response.room.activeRecording | ||
| $0.numParticipants = Int(response.room.numParticipants) | ||
| $0.numPublishers = Int(response.room.numPublishers) | ||
| } |
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.
Other fields like sid / name / maxParticipants / creationTime etc. could be missing ?
|
@hiroshihorie I don't think that's a hi-priority task tbh, any reliable ways to test it? |
|
@pblazej Yes, probably not super high priority. I was hoping Livekit_SimulateScenario as a case but it looks like it doesn't. |
|
Let's try to prioritize #845 (more severe), then fix this one. |
No description provided.