diff --git a/.github/workflows/integration-mysql.yml b/.github/workflows/integration-mysql.yml index 5b102eac7a0..48caf0d50e1 100644 --- a/.github/workflows/integration-mysql.yml +++ b/.github/workflows/integration-mysql.yml @@ -56,7 +56,7 @@ jobs: test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['stable28'] - guests-versions: ['master'] + guests-versions: ['stable28'] call-summary-bot-versions: ['main'] notifications-versions: ['stable28'] diff --git a/.github/workflows/integration-oci.yml b/.github/workflows/integration-oci.yml index e92b9bed002..c8989346f42 100644 --- a/.github/workflows/integration-oci.yml +++ b/.github/workflows/integration-oci.yml @@ -56,7 +56,7 @@ jobs: test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['stable28'] - guests-versions: ['master'] + guests-versions: ['stable28'] call-summary-bot-versions: ['main'] notifications-versions: ['stable28'] diff --git a/.github/workflows/integration-pgsql.yml b/.github/workflows/integration-pgsql.yml index 1ef4bab5257..ee13661dcee 100644 --- a/.github/workflows/integration-pgsql.yml +++ b/.github/workflows/integration-pgsql.yml @@ -53,7 +53,7 @@ jobs: test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.3'] server-versions: ['stable28'] - guests-versions: ['master'] + guests-versions: ['stable28'] call-summary-bot-versions: ['main'] notifications-versions: ['stable28'] diff --git a/.github/workflows/integration-sqlite.yml b/.github/workflows/integration-sqlite.yml index 780e43bbcf6..5113e57a0ae 100644 --- a/.github/workflows/integration-sqlite.yml +++ b/.github/workflows/integration-sqlite.yml @@ -56,7 +56,7 @@ jobs: test-suite: ['callapi', 'chat-1', 'chat-2', 'command', 'conversation-1', 'conversation-2', 'conversation-3', 'conversation-4', 'conversation-5', 'federation', 'integration', 'sharing-1', 'sharing-2', 'sharing-3', 'sharing-4'] php-versions: ['8.2'] server-versions: ['stable28'] - guests-versions: ['master'] + guests-versions: ['stable28'] call-summary-bot-versions: ['main'] notifications-versions: ['stable28'] diff --git a/lib/Service/BreakoutRoomService.php b/lib/Service/BreakoutRoomService.php index 2346c51cf17..23f20de78b4 100644 --- a/lib/Service/BreakoutRoomService.php +++ b/lib/Service/BreakoutRoomService.php @@ -36,6 +36,7 @@ use OCA\Talk\Participant; use OCA\Talk\Room; use OCA\Talk\Webinary; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\IL10N; use OCP\Notification\IManager as INotificationManager; @@ -48,6 +49,7 @@ public function __construct( protected ParticipantService $participantService, protected ChatManager $chatManager, protected INotificationManager $notificationManager, + protected ITimeFactory $timeFactory, protected IEventDispatcher $dispatcher, protected IL10N $l, ) { @@ -337,6 +339,7 @@ protected function createBreakoutRooms(Room $parent, int $amount): array { public function removeBreakoutRooms(Room $parent): void { $this->deleteBreakoutRooms($parent); $this->roomService->setBreakoutRoomMode($parent, BreakoutRoom::MODE_NOT_CONFIGURED); + $this->roomService->setBreakoutRoomStatus($parent, BreakoutRoom::STATUS_STOPPED); } protected function deleteBreakoutRooms(Room $parent): void { @@ -403,6 +406,7 @@ protected function setAssistanceRequest(Room $breakoutRoom, int $status): void { } $this->roomService->setBreakoutRoomStatus($breakoutRoom, $status); + $this->roomService->setLastActivity($breakoutRoom, $this->timeFactory->getDateTime()); } /** diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 1a4bc71f26b..74c7b31d9e2 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -2896,6 +2896,20 @@ public function userCreatesBreakoutRooms(string $user, int $amount, string $mode $this->assertStatusCode($this->response, $status); } + /** + * @Then /^user "([^"]*)" removes breakout rooms from "([^"]*)" with (\d+) \((v1)\)$/ + * + * @param string $user + * @param string $identifier + * @param int $status + * @param string $apiVersion + */ + public function userRemovesBreakoutRooms(string $user, string $identifier, int $status, string $apiVersion): void { + $this->setCurrentUser($user); + $this->sendRequest('DELETE', '/apps/spreed/api/' . $apiVersion . '/breakout-rooms/' . self::$identifierToToken[$identifier]); + $this->assertStatusCode($this->response, $status); + } + /** * @Then /^user "([^"]*)" moves participants into different breakout rooms for "([^"]*)" with (\d+) \((v1)\)$/ * diff --git a/tests/integration/features/conversation-1/breakout-rooms.feature b/tests/integration/features/conversation-1/breakout-rooms.feature index 01932206af8..05a7aa4d786 100644 --- a/tests/integration/features/conversation-1/breakout-rooms.feature +++ b/tests/integration/features/conversation-1/breakout-rooms.feature @@ -575,6 +575,40 @@ Feature: conversation/breakout-rooms And user "participant1" is participant of the following rooms (v4) And user "participant2" is participant of the following rooms (v4) + Scenario: Removing breakout rooms also stops them on the parent + Given user "participant1" creates room "class room" (v4) + | roomType | 2 | + | roomName | class room | + And user "participant1" adds user "participant2" to room "class room" with 200 (v4) + And user "participant1" sees the following attendees in room "class room" with 200 (v4) + | actorType | actorId | participantType | + | users | participant1 | 1 | + | users | participant2 | 3 | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | lobbyState | breakoutRoomMode | breakoutRoomStatus | + | 2 | class room | 0 | 0 | 0 | + And user "participant1" creates 2 automatic breakout rooms for "class room" with 200 (v1) + | users::participant2 | 0 | + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | lobbyState | breakoutRoomMode | breakoutRoomStatus | + | 2 | class room | 0 | 1 | 0 | + | 2 | Room 1 | 1 | 0 | 0 | + | 2 | Room 2 | 1 | 0 | 0 | + And user "participant1" starts breakout rooms in room "class room" with 200 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | lobbyState | breakoutRoomMode | breakoutRoomStatus | + | 2 | class room | 0 | 1 | 1 | + | 2 | Room 1 | 0 | 0 | 0 | + | 2 | Room 2 | 0 | 0 | 0 | + And user "participant2" is participant of the following unordered rooms (v4) + | type | name | + | 2 | class room | + | 2 | Room 1 | + When user "participant1" removes breakout rooms from "class room" with 200 (v1) + And user "participant1" is participant of the following unordered rooms (v4) + | type | name | lobbyState | breakoutRoomMode | breakoutRoomStatus | + | 2 | class room | 0 | 0 | 0 | + Scenario: Deleting a single breakout room unassigned the students from the mapping Given user "participant1" creates room "class room" (v4) | roomType | 2 | diff --git a/tests/php/Service/BreakoutRoomServiceTest.php b/tests/php/Service/BreakoutRoomServiceTest.php index 297d3d4eb89..e9141575473 100644 --- a/tests/php/Service/BreakoutRoomServiceTest.php +++ b/tests/php/Service/BreakoutRoomServiceTest.php @@ -32,6 +32,7 @@ use OCA\Talk\Service\BreakoutRoomService; use OCA\Talk\Service\ParticipantService; use OCA\Talk\Service\RoomService; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\EventDispatcher\IEventDispatcher; use OCP\IL10N; use OCP\Notification\IManager as INotificationManager; @@ -53,6 +54,8 @@ class BreakoutRoomServiceTest extends TestCase { private $chatManager; /** @var INotificationManager|MockObject */ private $notificationManager; + /** @var ITimeFactory|MockObject */ + protected $timeFactory; /** @var IEventDispatcher|MockObject */ private $dispatcher; /** @var IL10N|MockObject */ @@ -67,6 +70,7 @@ public function setUp(): void { $this->participantService = $this->createMock(ParticipantService::class); $this->chatManager = $this->createMock(ChatManager::class); $this->notificationManager = $this->createMock(INotificationManager::class); + $this->timeFactory = $this->createMock(ITimeFactory::class); $this->dispatcher = $this->createMock(IEventDispatcher::class); $this->l = $this->createMock(IL10N::class); $this->service = new BreakoutRoomService( @@ -76,6 +80,7 @@ public function setUp(): void { $this->participantService, $this->chatManager, $this->notificationManager, + $this->timeFactory, $this->dispatcher, $this->l );