Skip to content

Commit

Permalink
fix(signaling): Make alluserids more reliable for testing
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Apr 24, 2024
1 parent 3afd3d0 commit 14b4c44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Signaling/BackendNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public function roomInvited(Room $room, array $attendees): void {
* @throws \Exception
*/
public function roomsDisinvited(Room $room, array $attendees): void {
$allUserIds = $this->participantService->getParticipantUserIds($room);
sort($allUserIds);
$userIds = [];
foreach ($attendees as $attendee) {
if ($attendee->getActorType() === Attendee::ACTOR_USERS) {
Expand All @@ -206,7 +208,7 @@ public function roomsDisinvited(Room $room, array $attendees): void {
'userids' => $userIds,
// TODO(fancycode): We should try to get rid of 'alluserids' and
// find a better way to notify existing users to update the room.
'alluserids' => $this->participantService->getParticipantUserIds($room),
'alluserids' => $allUserIds,
'properties' => $room->getPropertiesForSignaling('', false),
],
]);
Expand All @@ -227,14 +229,16 @@ public function roomsDisinvited(Room $room, array $attendees): void {
* @throws \Exception
*/
public function roomSessionsRemoved(Room $room, array $sessionIds): void {
$allUserIds = $this->participantService->getParticipantUserIds($room);
sort($allUserIds);
$start = microtime(true);
$this->backendRequest($room, [
'type' => 'disinvite',
'disinvite' => [
'sessionids' => $sessionIds,
// TODO(fancycode): We should try to get rid of 'alluserids' and
// find a better way to notify existing users to update the room.
'alluserids' => $this->participantService->getParticipantUserIds($room),
'alluserids' => $allUserIds,
'properties' => $room->getPropertiesForSignaling('', false),
],
]);
Expand Down

0 comments on commit 14b4c44

Please sign in to comment.