-
Notifications
You must be signed in to change notification settings - Fork 509
Fix leaving room as a self joined user with several sessions #8722
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
Fix leaving room as a self joined user with several sessions #8722
Conversation
Self-joined users are just temporary participants and they need to be removed when they leave a conversation. However, this needs to be done once they have no more sessions in that conversation; otherwise the remaining sessions would be kicked out from the conversation as soon as one leaves it. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
|
/backport to stable25 |
|
/backport to stable24 |
| $this->dispatcher->dispatchTyped($attendeeEvent); | ||
| } | ||
| if ($participant->getAttendee()->getParticipantType() === Participant::USER_SELF_JOINED | ||
| && empty($this->sessionMapper->findByAttendeeId($participant->getAttendee()->getId()))) { |
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.
Optional: Can skip this query when we did the deleteByAttendeeId above, but might not have a big impact
|
Unit tests are not happy. On that note, integration tests would be awesome, but I know they don't work at the moment with multiple sessions, so something to be raised again later. |
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
If the external signaling server is used, when a participant is disinvited it is expected that the client leaves the conversation if still in it. Therefore, self-joined users should not be disinvited when they disconnect from a conversation, as they can still have other sessions in it. To ensure that self-joined users will be disinvited when their last session leaves the conversation now a USER_REMOVE event is explicitly triggered when that last session leaves and the user is, in fact, removed from the conversation. Note that this does not cause the system message about the participant leaving to be sent, as it is explicitly guarded against self-joined users leaving the conversation. However, this change will cause other handlers to be called now, like those to invalidate resources, but it is very likely that they should have been called and that this change is actually a fix too in that regard. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
This should not make any difference in the behaviour, but it looks more correct to first disconnect and then remove than the other way around. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
e7d0842 to
b82cc23
Compare
Fixed. |
vitormattos
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.
Will be necessary backport?
Fixes #8626
Self-joined users are just temporary participants and they need to be removed when they leave a conversation. However, this needs to be done once they have no more sessions in that conversation; otherwise the remaining sessions would be kicked out from the conversation as soon as one leaves it.
Moreover, if the external signaling server is used, when a participant is disinvited it is expected that the client leaves the conversation if still in it. Therefore, self-joined users should not be disinvited when
they disconnect from a conversation, as they can still have other sessions in it.
To ensure that self-joined users will be disinvited when their last session leaves the conversation now a USER_REMOVE event is explicitly triggered when that last session leaves and the user is, in fact, removed from the conversation.
Note that this does not cause the system message about the participant leaving to be sent, as it is explicitly guarded against self-joined users leaving the conversation. However, this change will cause other handlers to be called now, like those to invalidate resources, but it is very likely that they should have been called and that this change is actually a fix too in that regard.
It would be great to add integration tests to explicitly check this, but I do not if it is possible to simulate different sessions for the same participant in the integration tests.