backend: refine updateMeetRoomStatus to always save changes in storage

This commit is contained in:
juancarmore 2025-08-30 13:31:11 +02:00
parent 982247736e
commit 2475f7a8e2

View File

@ -156,18 +156,19 @@ export class RoomService {
*/ */
async updateMeetRoomStatus(roomId: string, status: MeetRoomStatus): Promise<{ room: MeetRoom; updated: boolean }> { async updateMeetRoomStatus(roomId: string, status: MeetRoomStatus): Promise<{ room: MeetRoom; updated: boolean }> {
const room = await this.getMeetRoom(roomId); const room = await this.getMeetRoom(roomId);
let updated = true;
// If closing the room while a meeting is active, mark it to be closed when the meeting ends // If closing the room while a meeting is active, mark it to be closed when the meeting ends
if (status === MeetRoomStatus.CLOSED && room.status === MeetRoomStatus.ACTIVE_MEETING) { if (status === MeetRoomStatus.CLOSED && room.status === MeetRoomStatus.ACTIVE_MEETING) {
room.meetingEndAction = MeetingEndAction.CLOSE; room.meetingEndAction = MeetingEndAction.CLOSE;
return { room, updated: false }; updated = false;
} else { } else {
room.status = status; room.status = status;
room.meetingEndAction = MeetingEndAction.NONE; room.meetingEndAction = MeetingEndAction.NONE;
} }
await this.storageService.saveMeetRoom(room); await this.storageService.saveMeetRoom(room);
return { room, updated: true }; return { room, updated };
} }
/** /**