Skip to content

Commit 567cfdb

Browse files
Only subscribe to breakoutrooms if capable. Resolves a bug where ecs disabled flag causes breakoutroom initialization to fail (#5978)
* Only subscribe to breakoutrooms if capable. Resolves a bug when ecs is disabled for breakoutrooms * stable changelog * beta changelog * Add checks to ensure capabiltiies object is available
1 parent 05d6e8f commit 567cfdb

3 files changed

Lines changed: 31 additions & 10 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": "Breakoutrooms",
5+
"comment": "Subscribe to breakoutrooms only when the feature is available.",
6+
"packageName": "@azure/communication-react",
7+
"email": "edwardlee@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}
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": "Breakoutroom",
5+
"comment": "Subscribe to breakoutrooms only when capable.",
6+
"packageName": "@azure/communication-react",
7+
"email": "edwardlee@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class CallSubscriber {
6262

6363
private _capabilitiesSubscriber: CapabilitiesSubscriber;
6464
private _spotlightSubscriber: SpotlightSubscriber;
65-
private _breakoutRoomsSubscriber: BreakoutRoomsSubscriber;
65+
private _breakoutRoomsSubscriber?: BreakoutRoomsSubscriber;
6666

6767
private _togetherModeSubscriber: TogetherModeSubscriber;
6868
private _mediaAccessSubscriber: MediaAccessSubscriber;
@@ -120,13 +120,15 @@ export class CallSubscriber {
120120
this._call.feature(Features.Spotlight)
121121
);
122122

123-
// Clear assigned breakout room closed notification for this call.
124-
this._context.deleteLatestNotification('assignedBreakoutRoomClosed');
125-
this._breakoutRoomsSubscriber = new BreakoutRoomsSubscriber(
126-
this._callIdRef,
127-
this._context,
128-
this._call.feature(Features.BreakoutRooms)
129-
);
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+
}
130132

131133
this._togetherModeSubscriber = new TogetherModeSubscriber(
132134
this._callIdRef,
@@ -254,8 +256,9 @@ export class CallSubscriber {
254256
this._capabilitiesSubscriber.unsubscribe();
255257
this._reactionSubscriber?.unsubscribe();
256258
this._spotlightSubscriber.unsubscribe();
257-
this._breakoutRoomsSubscriber.unsubscribe();
258-
259+
if (this._call.feature(Features.Capabilities) && this._call.feature(Features.Capabilities).capabilities?.joinBreakoutRooms.isPresent && this._breakoutRoomsSubscriber) {
260+
this._breakoutRoomsSubscriber.unsubscribe();
261+
}
259262
this._togetherModeSubscriber.unsubscribe();
260263
this._mediaAccessSubscriber.unsubscribe();
261264
};

0 commit comments

Comments
 (0)