Skip to content

Commit 5ab3a4d

Browse files
authored
Fix return to main meeting from breakout room and notifications after joining breakout room (#6037)
* Fix returnFromBreakoutRoom to use BreakoutRooms feature for assigned breakout room * Refactor CallSubscriber to always clear assigned breakout room notifications and initialize BreakoutRoomsSubscriber unconditionally * Change files
1 parent e470279 commit 5ab3a4d

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Breakout rooms",
5+
"comment": "Fix return to main meeting from breakout room. Fix breakout room notifications after joining breakout room.",
6+
"packageName": "@azure/communication-react",
7+
"email": "miguelgamis@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}

packages/calling-stateful-client/src/CallSubscriber.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,12 @@ export class CallSubscriber {
120120
this._call.feature(Features.Spotlight)
121121
);
122122

123-
if (this._call.feature(Features.Capabilities) && this._call.feature(Features.Capabilities).capabilities?.joinBreakoutRooms.isPresent) {
124-
// Clear assigned breakout room closed notification for this call.
125-
this._context.deleteLatestNotification('assignedBreakoutRoomClosed');
126-
this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(
127-
this._callIdRef,
128-
this._context,
129-
this._call.feature(Features.BreakoutRooms)
130-
);
131-
}
123+
this._context.deleteLatestNotification('assignedBreakoutRoomClosed');
124+
this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(
125+
this._callIdRef,
126+
this._context,
127+
this._call.feature(Features.BreakoutRooms)
128+
);
132129

133130
this._togetherModeSubscriber = new TogetherModeSubscriber(
134131
this._callIdRef,
@@ -256,9 +253,7 @@ export class CallSubscriber {
256253
this._capabilitiesSubscriber.unsubscribe();
257254
this._reactionSubscriber?.unsubscribe();
258255
this._spotlightSubscriber.unsubscribe();
259-
if (this._call.feature(Features.Capabilities) && this._call.feature(Features.Capabilities).capabilities?.joinBreakoutRooms.isPresent && this._breakoutRoomsSubscriber) {
260-
this._breakoutRoomsSubscriber.unsubscribe();
261-
}
256+
this._breakoutRoomsSubscriber?.unsubscribe();
262257
this._togetherModeSubscriber.unsubscribe();
263258
this._mediaAccessSubscriber.unsubscribe();
264259
};

packages/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,8 +1230,10 @@ export class AzureCommunicationCallAdapter<AgentType extends CallAgent | TeamsCa
12301230
}
12311231

12321232
public async returnFromBreakoutRoom(): Promise<void> {
1233-
const callState = this.call?.id ? this.callClient.getState().calls[this.call.id] : undefined;
1234-
const assignedBreakoutRoom = callState?.breakoutRooms?.assignedBreakoutRoom;
1233+
// Get assignedBreakoutRoom directly from the SDK's BreakoutRooms feature on the originCall (main meeting).
1234+
// We can't rely on state because the main meeting's call state may not exist in calls when in a breakout room.
1235+
const breakoutRoomsFeature = this.originCall?.feature(Features.BreakoutRooms);
1236+
const assignedBreakoutRoom = breakoutRoomsFeature?.assignedBreakoutRooms;
12351237

12361238
if (!assignedBreakoutRoom) {
12371239
throw new Error(

0 commit comments

Comments
 (0)