@webex/plugin-meetings 3.11.0-webex-services-ready.1 → 3.12.0-llmrefactor.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +197 -0
- package/dist/aiEnableRequest/index.js.map +1 -0
- package/dist/aiEnableRequest/utils.js +36 -0
- package/dist/aiEnableRequest/utils.js.map +1 -0
- package/dist/annotation/index.js +58 -13
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +124 -7
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +8 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +60 -11
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +16 -2
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTree.js +18 -0
- package/dist/hashTree/hashTree.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1655 -538
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +4 -2
- package/dist/hashTree/types.js.map +1 -1
- package/dist/hashTree/utils.js +52 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/constant.js +12 -0
- package/dist/interceptors/constant.js.map +1 -0
- package/dist/interceptors/dataChannelAuthToken.js +332 -0
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
- package/dist/interceptors/index.js +7 -0
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/utils.js +27 -0
- package/dist/interceptors/utils.js.map +1 -0
- package/dist/interpretation/index.js +11 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +9 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +914 -212
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +1 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +72 -3
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +8 -7
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +11 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2286 -1129
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +168 -5
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +369 -162
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +20 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +40 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +12 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +64 -68
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +11 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +0 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/aiEnableRequest/index.d.ts +5 -0
- package/dist/types/aiEnableRequest/utils.d.ts +2 -0
- package/dist/types/annotation/index.d.ts +19 -0
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +6 -2
- package/dist/types/constants.d.ts +35 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +3 -0
- package/dist/types/hashTree/hashTree.d.ts +7 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
- package/dist/types/hashTree/types.d.ts +3 -0
- package/dist/types/hashTree/utils.d.ts +24 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/constant.d.ts +5 -0
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
- package/dist/types/interceptors/index.d.ts +2 -1
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interceptors/utils.d.ts +1 -0
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +126 -15
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +28 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
- package/dist/types/media/properties.d.ts +8 -3
- package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
- package/dist/types/meeting/index.d.ts +271 -16
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +17 -1
- package/dist/types/meeting/request.type.d.ts +5 -0
- package/dist/types/meeting/util.d.ts +40 -0
- package/dist/types/meetings/index.d.ts +42 -20
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +2 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +14 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +11 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +4 -0
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/index.js +611 -164
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +24 -23
- package/src/aiEnableRequest/README.md +84 -0
- package/src/aiEnableRequest/index.ts +186 -0
- package/src/aiEnableRequest/utils.ts +25 -0
- package/src/annotation/index.ts +62 -12
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +143 -3
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +6 -2
- package/src/constants.ts +49 -3
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +17 -0
- package/src/hashTree/hashTree.ts +17 -0
- package/src/hashTree/hashTreeParser.ts +1482 -361
- package/src/hashTree/types.ts +4 -0
- package/src/hashTree/utils.ts +45 -0
- package/src/index.ts +14 -1
- package/src/interceptors/constant.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +217 -0
- package/src/interceptors/index.ts +2 -1
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interceptors/utils.ts +16 -0
- package/src/interpretation/index.ts +29 -11
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +14 -1
- package/src/locus-info/index.ts +976 -203
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/selfUtils.ts +1 -0
- package/src/locus-info/types.ts +33 -1
- package/src/media/MediaConnectionAwaiter.ts +62 -5
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +11 -4
- package/src/meeting/in-meeting-actions.ts +20 -0
- package/src/meeting/index.ts +1244 -224
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +53 -0
- package/src/meeting/request.type.ts +6 -0
- package/src/meeting/util.ts +207 -7
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +319 -117
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +20 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +41 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +12 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +117 -76
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +13 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +4 -0
- package/src/reconnection-manager/index.ts +0 -1
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +415 -11
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
- package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
- package/test/unit/spec/annotation/index.ts +228 -134
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +305 -18
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTree.ts +66 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +388 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interceptors/utils.ts +75 -0
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +200 -56
- package/test/unit/spec/locus-info/index.js +1861 -149
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +35 -26
- package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
- package/test/unit/spec/meeting/index.js +3573 -353
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +82 -0
- package/test/unit/spec/meeting/utils.js +595 -27
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +1138 -86
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +35 -4
- package/test/unit/spec/member/util.js +154 -27
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
- package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -8
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +1087 -167
- package/test/unit/spec/webinar/utils.ts +39 -0
|
@@ -5,6 +5,7 @@ import breakoutEvent from "../../../../src/breakouts/events";
|
|
|
5
5
|
|
|
6
6
|
describe('plugin-meetings', () => {
|
|
7
7
|
describe('breakoutEvent', () => {
|
|
8
|
+
const originalPostMoveCallAnalyzer = breakoutEvent.postMoveCallAnalyzer;
|
|
8
9
|
let webex;
|
|
9
10
|
let mockMeeting = {};
|
|
10
11
|
let breakoutMoveId;
|
|
@@ -24,20 +25,35 @@ describe('plugin-meetings', () => {
|
|
|
24
25
|
groupId: "groupId",
|
|
25
26
|
};
|
|
26
27
|
breakoutMoveId = 'breakoutMoveId';
|
|
28
|
+
breakoutEvent.postMoveCallAnalyzer = originalPostMoveCallAnalyzer;
|
|
27
29
|
|
|
28
30
|
});
|
|
29
31
|
describe('postMoveCallAnalyzer', () => {
|
|
30
32
|
it('send metric as expected', () => {
|
|
31
33
|
const submitClientEvent = sinon.stub();
|
|
32
|
-
const eventInfo = {
|
|
34
|
+
const eventInfo = {
|
|
35
|
+
currentSession: newSession,
|
|
36
|
+
meeting: mockMeeting,
|
|
37
|
+
breakoutMoveId,
|
|
38
|
+
llmLatency: {
|
|
39
|
+
clientLLMDatachannelResponseTime: 10,
|
|
40
|
+
clientLLMWebSocketConnectTime: 20,
|
|
41
|
+
},
|
|
42
|
+
llmWebsocketUrl: 'wss://example.com/ws',
|
|
43
|
+
};
|
|
33
44
|
breakoutEvent.postMoveCallAnalyzer('client.breakout-session.join.response', eventInfo, submitClientEvent);
|
|
34
45
|
assert.calledWithMatch(submitClientEvent, {
|
|
35
46
|
name: 'client.breakout-session.join.response',
|
|
36
47
|
payload: {
|
|
48
|
+
llmLatency: {
|
|
49
|
+
clientLLMDatachannelResponseTime: 10,
|
|
50
|
+
clientLLMWebSocketConnectTime: 20,
|
|
51
|
+
},
|
|
37
52
|
identifiers: {
|
|
38
53
|
breakoutMoveId: 'breakoutMoveId',
|
|
39
54
|
breakoutSessionId: 'sessionId',
|
|
40
55
|
breakoutGroupId: 'groupId',
|
|
56
|
+
llmWebsocketUrl: 'wss://example.com/ws',
|
|
41
57
|
},
|
|
42
58
|
},
|
|
43
59
|
options: {meetingId: 'activeMeetingId'},
|
|
@@ -79,10 +95,112 @@ describe('plugin-meetings', () => {
|
|
|
79
95
|
sinon.stub(submitClientEvent, 'bind').returns(webex.internal.newMetrics.submitClientEvent);
|
|
80
96
|
|
|
81
97
|
breakoutEvent.postMoveCallAnalyzer = sinon.stub();
|
|
82
|
-
const eventInfo = {
|
|
98
|
+
const eventInfo = {
|
|
99
|
+
newSession,
|
|
100
|
+
mockMeeting,
|
|
101
|
+
breakoutMoveId,
|
|
102
|
+
llmLatency: {clientLLMDatachannelResponseTime: 10, clientLLMWebSocketConnectTime: 20},
|
|
103
|
+
};
|
|
83
104
|
breakoutEvent.onBreakoutJoinResponse(eventInfo, submitClientEvent);
|
|
84
105
|
assert.calledWith(breakoutEvent.postMoveCallAnalyzer, 'client.breakout-session.join.response', eventInfo, submitClientEvent);
|
|
85
106
|
});
|
|
107
|
+
|
|
108
|
+
it('emits join response metric without llmLatency', () => {
|
|
109
|
+
const submitClientEvent = sinon.stub();
|
|
110
|
+
|
|
111
|
+
breakoutEvent.postMoveCallAnalyzer(
|
|
112
|
+
'client.breakout-session.join.response',
|
|
113
|
+
{currentSession: newSession, meeting: mockMeeting, breakoutMoveId},
|
|
114
|
+
submitClientEvent
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
assert.calledOnceWithExactly(submitClientEvent, {
|
|
118
|
+
name: 'client.breakout-session.join.response',
|
|
119
|
+
payload: {
|
|
120
|
+
llmLatency: undefined,
|
|
121
|
+
identifiers: {
|
|
122
|
+
breakoutMoveId: 'breakoutMoveId',
|
|
123
|
+
breakoutSessionId: 'sessionId',
|
|
124
|
+
breakoutGroupId: 'groupId',
|
|
125
|
+
llmWebsocketUrl: undefined,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
options: {meetingId: 'activeMeetingId', rawError: undefined},
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
it('does not emit duplicate join response metric with llmLatency for the same breakoutMoveId', () => {
|
|
133
|
+
const submitClientEvent = sinon.stub();
|
|
134
|
+
const shouldEmitBreakoutJoinResponseMetric = sinon.stub();
|
|
135
|
+
|
|
136
|
+
shouldEmitBreakoutJoinResponseMetric.onFirstCall().returns(true);
|
|
137
|
+
shouldEmitBreakoutJoinResponseMetric.onSecondCall().returns(false);
|
|
138
|
+
|
|
139
|
+
const eventInfo = {
|
|
140
|
+
currentSession: newSession,
|
|
141
|
+
meeting: {
|
|
142
|
+
...mockMeeting,
|
|
143
|
+
shouldEmitBreakoutJoinResponseMetric,
|
|
144
|
+
},
|
|
145
|
+
breakoutMoveId,
|
|
146
|
+
llmLatency: {clientLLMDatachannelResponseTime: 10, clientLLMWebSocketConnectTime: 20},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
breakoutEvent.postMoveCallAnalyzer(
|
|
150
|
+
'client.breakout-session.join.response',
|
|
151
|
+
eventInfo,
|
|
152
|
+
submitClientEvent
|
|
153
|
+
);
|
|
154
|
+
breakoutEvent.postMoveCallAnalyzer(
|
|
155
|
+
'client.breakout-session.join.response',
|
|
156
|
+
eventInfo,
|
|
157
|
+
submitClientEvent
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
assert.calledTwice(shouldEmitBreakoutJoinResponseMetric);
|
|
161
|
+
assert.calledWithExactly(shouldEmitBreakoutJoinResponseMetric, breakoutMoveId, true);
|
|
162
|
+
assert.calledOnce(submitClientEvent);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('allows llmLatency join response after join response without llmLatency', () => {
|
|
166
|
+
const submitClientEvent = sinon.stub();
|
|
167
|
+
const shouldEmitBreakoutJoinResponseMetric = sinon.stub();
|
|
168
|
+
|
|
169
|
+
shouldEmitBreakoutJoinResponseMetric.onFirstCall().returns(true);
|
|
170
|
+
shouldEmitBreakoutJoinResponseMetric.onSecondCall().returns(true);
|
|
171
|
+
|
|
172
|
+
const baseEventInfo = {
|
|
173
|
+
currentSession: newSession,
|
|
174
|
+
meeting: {
|
|
175
|
+
...mockMeeting,
|
|
176
|
+
shouldEmitBreakoutJoinResponseMetric,
|
|
177
|
+
},
|
|
178
|
+
breakoutMoveId,
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
breakoutEvent.postMoveCallAnalyzer(
|
|
182
|
+
'client.breakout-session.join.response',
|
|
183
|
+
baseEventInfo,
|
|
184
|
+
submitClientEvent
|
|
185
|
+
);
|
|
186
|
+
breakoutEvent.postMoveCallAnalyzer(
|
|
187
|
+
'client.breakout-session.join.response',
|
|
188
|
+
{
|
|
189
|
+
...baseEventInfo,
|
|
190
|
+
llmLatency: {clientLLMDatachannelResponseTime: 10, clientLLMWebSocketConnectTime: 20},
|
|
191
|
+
},
|
|
192
|
+
submitClientEvent
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
assert.calledTwice(shouldEmitBreakoutJoinResponseMetric);
|
|
196
|
+
assert.calledWithExactly(shouldEmitBreakoutJoinResponseMetric.firstCall, breakoutMoveId, false);
|
|
197
|
+
assert.calledWithExactly(shouldEmitBreakoutJoinResponseMetric.secondCall, breakoutMoveId, true);
|
|
198
|
+
assert.calledTwice(submitClientEvent);
|
|
199
|
+
assert.deepEqual(submitClientEvent.secondCall.args[0].payload.llmLatency, {
|
|
200
|
+
clientLLMDatachannelResponseTime: 10,
|
|
201
|
+
clientLLMWebSocketConnectTime: 20,
|
|
202
|
+
});
|
|
203
|
+
});
|
|
86
204
|
});
|
|
87
205
|
|
|
88
206
|
});
|
|
@@ -7,8 +7,7 @@ import sinon from 'sinon';
|
|
|
7
7
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
8
8
|
import testUtils from '../../../utils/testUtils';
|
|
9
9
|
import BreakoutEditLockedError from '@webex/plugin-meetings/src/breakouts/edit-lock-error';
|
|
10
|
-
import breakoutEvent from '../../../../src/breakouts/events'
|
|
11
|
-
|
|
10
|
+
import breakoutEvent from '../../../../src/breakouts/events'
|
|
12
11
|
const getBOResponse = (status: string) => {
|
|
13
12
|
return {
|
|
14
13
|
url: 'url',
|
|
@@ -217,6 +216,21 @@ describe('plugin-meetings', () => {
|
|
|
217
216
|
});
|
|
218
217
|
assert.calledThrice(breakouts.queryPreAssignments);
|
|
219
218
|
});
|
|
219
|
+
|
|
220
|
+
it('wires LLM_CONNECT_RESPONSE to handleLLMBreakoutJoinResponseMetric', () => {
|
|
221
|
+
const handleStub = sinon.stub(Breakouts.prototype, 'handleLLMBreakoutJoinResponseMetric');
|
|
222
|
+
const bo = new Breakouts({}, {parent: webex});
|
|
223
|
+
|
|
224
|
+
const eventInfo = {
|
|
225
|
+
meeting: {id: 'meeting-id'},
|
|
226
|
+
llmLatency: {clientLLMWebSocketConnectTime: 1},
|
|
227
|
+
};
|
|
228
|
+
bo.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, eventInfo);
|
|
229
|
+
|
|
230
|
+
assert.calledOnceWithExactly(handleStub, eventInfo);
|
|
231
|
+
|
|
232
|
+
handleStub.restore();
|
|
233
|
+
});
|
|
220
234
|
});
|
|
221
235
|
|
|
222
236
|
describe('#listenToCurrentSessionTypeChange', () => {
|
|
@@ -313,6 +327,7 @@ describe('plugin-meetings', () => {
|
|
|
313
327
|
groupId: 'groupId',
|
|
314
328
|
sessionType: 'sessionType',
|
|
315
329
|
url: 'url',
|
|
330
|
+
resourceLink: 'resource-link',
|
|
316
331
|
name: 'name',
|
|
317
332
|
allowBackToMain: true,
|
|
318
333
|
delayCloseTime: 10,
|
|
@@ -339,6 +354,7 @@ describe('plugin-meetings', () => {
|
|
|
339
354
|
assert.equal(breakouts.currentBreakoutSession.current, true);
|
|
340
355
|
assert.equal(breakouts.currentBreakoutSession.sessionType, 'sessionType');
|
|
341
356
|
assert.equal(breakouts.currentBreakoutSession.url, 'url');
|
|
357
|
+
assert.equal(breakouts.currentBreakoutSession.resourceLink, 'resource-link');
|
|
342
358
|
assert.equal(breakouts.currentBreakoutSession.active, false);
|
|
343
359
|
assert.equal(breakouts.currentBreakoutSession.allowed, false);
|
|
344
360
|
assert.equal(breakouts.currentBreakoutSession.assigned, false);
|
|
@@ -372,6 +388,27 @@ describe('plugin-meetings', () => {
|
|
|
372
388
|
assert.calledOnce(breakouts.clearBreakouts);
|
|
373
389
|
});
|
|
374
390
|
|
|
391
|
+
it('preserves the last non-empty breakoutMoveId when a later update omits it', () => {
|
|
392
|
+
breakouts.updateBreakout({
|
|
393
|
+
sessionId: 'sessionId',
|
|
394
|
+
groupId: 'groupId',
|
|
395
|
+
sessionType: 'BREAKOUT',
|
|
396
|
+
status: 'active',
|
|
397
|
+
breakoutMoveId: 'move-id-1',
|
|
398
|
+
});
|
|
399
|
+
assert.equal(breakouts.breakoutMoveId, 'move-id-1');
|
|
400
|
+
|
|
401
|
+
// a later controls update arrives without a replaces entry -> null move id
|
|
402
|
+
breakouts.updateBreakout({
|
|
403
|
+
sessionId: 'sessionId',
|
|
404
|
+
groupId: 'groupId',
|
|
405
|
+
sessionType: 'BREAKOUT',
|
|
406
|
+
status: 'active',
|
|
407
|
+
breakoutMoveId: null,
|
|
408
|
+
});
|
|
409
|
+
assert.equal(breakouts.breakoutMoveId, 'move-id-1');
|
|
410
|
+
});
|
|
411
|
+
|
|
375
412
|
it('updates the current breakout session, call onBreakoutJoinResponse when session changed', () => {
|
|
376
413
|
breakouts.webex.meetings = {
|
|
377
414
|
getMeetingByType: sinon.stub().returns({
|
|
@@ -429,6 +466,111 @@ describe('plugin-meetings', () => {
|
|
|
429
466
|
});
|
|
430
467
|
});
|
|
431
468
|
|
|
469
|
+
describe('#submitLLMBreakoutJoinResponseMetric', () => {
|
|
470
|
+
let onBreakoutJoinResponseSpy;
|
|
471
|
+
|
|
472
|
+
const setupReadyToEmit = () => {
|
|
473
|
+
breakouts.webex.meetings = {
|
|
474
|
+
getMeetingByType: sinon.stub().returns({id: 'meeting-id'}),
|
|
475
|
+
};
|
|
476
|
+
breakouts.webex.internal.newMetrics = {submitClientEvent: sinon.stub()};
|
|
477
|
+
breakouts.webex.internal.llm.getWebSocketUrl = sinon.stub().returns('wss://llm');
|
|
478
|
+
breakouts.breakoutMoveId = 'moveId';
|
|
479
|
+
breakouts.currentBreakoutSession.set({sessionId: 'sessionId', groupId: 'groupId'});
|
|
480
|
+
breakouts.llmBreakoutJoinResponseInfo = {
|
|
481
|
+
breakoutMoveId: 'moveId',
|
|
482
|
+
meeting: {id: 'meeting-id'},
|
|
483
|
+
llmLatency: {clientLLMWebSocketConnectTime: 1},
|
|
484
|
+
};
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
beforeEach(() => {
|
|
488
|
+
onBreakoutJoinResponseSpy = sinon.stub(breakoutEvent, 'onBreakoutJoinResponse');
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
afterEach(() => {
|
|
492
|
+
onBreakoutJoinResponseSpy.restore();
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
it('emits the join response while an active breakout is in progress', () => {
|
|
496
|
+
setupReadyToEmit();
|
|
497
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.BREAKOUT);
|
|
498
|
+
breakouts.set('status', BREAKOUTS.STATUS.OPEN);
|
|
499
|
+
|
|
500
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
501
|
+
|
|
502
|
+
assert.calledOnce(onBreakoutJoinResponseSpy);
|
|
503
|
+
const eventInfoArg = onBreakoutJoinResponseSpy.getCall(0).args[0];
|
|
504
|
+
assert.equal(eventInfoArg.breakoutMoveId, 'moveId');
|
|
505
|
+
assert.deepEqual(eventInfoArg.llmLatency, {clientLLMWebSocketConnectTime: 1});
|
|
506
|
+
assert.equal(eventInfoArg.llmWebsocketUrl, 'wss://llm');
|
|
507
|
+
assert.equal(eventInfoArg.meeting.id, 'meeting-id');
|
|
508
|
+
assert.equal(eventInfoArg.currentSession.sessionId, 'sessionId');
|
|
509
|
+
assert.equal(eventInfoArg.currentSession.groupId, 'groupId');
|
|
510
|
+
assert.isUndefined(eventInfoArg.error);
|
|
511
|
+
assert.isUndefined(breakouts.llmBreakoutJoinResponseInfo);
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
it('emits the join response after returning to the main session', () => {
|
|
515
|
+
setupReadyToEmit();
|
|
516
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
|
|
517
|
+
breakouts.currentBreakoutSession.set({sessionType: BREAKOUTS.SESSION_TYPES.MAIN});
|
|
518
|
+
|
|
519
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
520
|
+
|
|
521
|
+
assert.calledOnce(onBreakoutJoinResponseSpy);
|
|
522
|
+
const eventInfoArg = onBreakoutJoinResponseSpy.getCall(0).args[0];
|
|
523
|
+
assert.equal(eventInfoArg.breakoutMoveId, 'moveId');
|
|
524
|
+
assert.deepEqual(eventInfoArg.llmLatency, {clientLLMWebSocketConnectTime: 1});
|
|
525
|
+
assert.equal(eventInfoArg.llmWebsocketUrl, 'wss://llm');
|
|
526
|
+
assert.equal(eventInfoArg.meeting.id, 'meeting-id');
|
|
527
|
+
assert.equal(eventInfoArg.currentSession.sessionId, 'sessionId');
|
|
528
|
+
assert.equal(eventInfoArg.currentSession.groupId, 'groupId');
|
|
529
|
+
assert.isUndefined(eventInfoArg.error);
|
|
530
|
+
assert.isUndefined(breakouts.llmBreakoutJoinResponseInfo);
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
it('does not emit without a breakoutMoveId (non-breakout meeting)', () => {
|
|
534
|
+
setupReadyToEmit();
|
|
535
|
+
breakouts.breakoutMoveId = undefined;
|
|
536
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
|
|
537
|
+
|
|
538
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
539
|
+
|
|
540
|
+
assert.notCalled(onBreakoutJoinResponseSpy);
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
it('does not emit when the LLM latency belongs to a different move id', () => {
|
|
544
|
+
setupReadyToEmit();
|
|
545
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
|
|
546
|
+
breakouts.llmBreakoutJoinResponseInfo.breakoutMoveId = 'staleMoveId';
|
|
547
|
+
|
|
548
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
549
|
+
|
|
550
|
+
assert.notCalled(onBreakoutJoinResponseSpy);
|
|
551
|
+
});
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
describe('#handleLLMBreakoutJoinResponseMetric', () => {
|
|
555
|
+
it('stores the LLM connect response with the current breakoutMoveId and tries to emit', () => {
|
|
556
|
+
breakouts.breakoutMoveId = 'moveId';
|
|
557
|
+
breakouts.submitLLMBreakoutJoinResponseMetric = sinon.stub();
|
|
558
|
+
|
|
559
|
+
const eventInfo = {
|
|
560
|
+
meeting: {id: 'meeting-id'},
|
|
561
|
+
llmLatency: {clientLLMWebSocketConnectTime: 1},
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
breakouts.handleLLMBreakoutJoinResponseMetric(eventInfo);
|
|
565
|
+
|
|
566
|
+
assert.deepEqual(breakouts.llmBreakoutJoinResponseInfo, {
|
|
567
|
+
...eventInfo,
|
|
568
|
+
breakoutMoveId: 'moveId',
|
|
569
|
+
});
|
|
570
|
+
assert.calledOnce(breakouts.submitLLMBreakoutJoinResponseMetric);
|
|
571
|
+
});
|
|
572
|
+
});
|
|
573
|
+
|
|
432
574
|
describe('#updateBreakoutSessions', () => {
|
|
433
575
|
const checkBreakout = (breakout, sessionId, state) => {
|
|
434
576
|
assert.deepEqual(breakout.attributes, {
|
|
@@ -498,40 +640,138 @@ describe('plugin-meetings', () => {
|
|
|
498
640
|
});
|
|
499
641
|
});
|
|
500
642
|
|
|
643
|
+
describe('#registerLLMChannel', () => {
|
|
644
|
+
it('registers an LLM channel', () => {
|
|
645
|
+
const mockChannel = {
|
|
646
|
+
isConnected: sinon.stub().returns(true),
|
|
647
|
+
on: sinon.stub(),
|
|
648
|
+
off: sinon.stub(),
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
breakouts.registerLLMChannel(mockChannel);
|
|
652
|
+
|
|
653
|
+
assert.equal(breakouts._llmChannel, mockChannel);
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
it('cleans up previous channel before registering new one', () => {
|
|
657
|
+
const oldChannel = {
|
|
658
|
+
isConnected: sinon.stub().returns(true),
|
|
659
|
+
on: sinon.stub(),
|
|
660
|
+
off: sinon.stub(),
|
|
661
|
+
};
|
|
662
|
+
const newChannel = {
|
|
663
|
+
isConnected: sinon.stub().returns(false),
|
|
664
|
+
on: sinon.stub(),
|
|
665
|
+
off: sinon.stub(),
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
breakouts.registerLLMChannel(oldChannel);
|
|
669
|
+
// After registering connected channel, hasSubscribedToMessage becomes true
|
|
670
|
+
assert.equal(breakouts.hasSubscribedToMessage, true);
|
|
671
|
+
|
|
672
|
+
const stopListeningSpy = sinon.spy(breakouts, 'stopListening');
|
|
673
|
+
breakouts.registerLLMChannel(newChannel);
|
|
674
|
+
|
|
675
|
+
// Should have called stopListening to clean up old channel
|
|
676
|
+
assert.calledWith(stopListeningSpy, oldChannel);
|
|
677
|
+
assert.equal(breakouts._llmChannel, newChannel);
|
|
678
|
+
// Since newChannel is not connected, hasSubscribedToMessage stays false
|
|
679
|
+
assert.equal(breakouts.hasSubscribedToMessage, false);
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
describe('#unregisterLLMChannel', () => {
|
|
684
|
+
it('unregisters the LLM channel', () => {
|
|
685
|
+
const mockChannel = {
|
|
686
|
+
isConnected: sinon.stub().returns(true),
|
|
687
|
+
on: sinon.stub(),
|
|
688
|
+
off: sinon.stub(),
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
breakouts.registerLLMChannel(mockChannel);
|
|
692
|
+
breakouts.hasSubscribedToMessage = true;
|
|
693
|
+
|
|
694
|
+
breakouts.unregisterLLMChannel();
|
|
695
|
+
|
|
696
|
+
assert.equal(breakouts._llmChannel, undefined);
|
|
697
|
+
assert.equal(breakouts.hasSubscribedToMessage, false);
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
it('does nothing if no channel is registered', () => {
|
|
701
|
+
breakouts.unregisterLLMChannel();
|
|
702
|
+
assert.equal(breakouts._llmChannel, undefined);
|
|
703
|
+
});
|
|
704
|
+
});
|
|
705
|
+
|
|
501
706
|
describe('#listenToBroadcastMessages', () => {
|
|
502
|
-
it('do not subscribe message if
|
|
503
|
-
|
|
504
|
-
breakouts.listenTo = sinon.stub();
|
|
707
|
+
it('do not subscribe message if no channel registered', () => {
|
|
708
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
505
709
|
breakouts.locusUrlUpdate('newUrl');
|
|
506
710
|
assert.equal(breakouts.locusUrl, 'newUrl');
|
|
507
|
-
assert.notCalled(
|
|
711
|
+
assert.notCalled(listenToSpy);
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
it('do not subscribe message if channel not connected', () => {
|
|
715
|
+
const mockChannel = {
|
|
716
|
+
isConnected: sinon.stub().returns(false),
|
|
717
|
+
on: sinon.stub(),
|
|
718
|
+
off: sinon.stub(),
|
|
719
|
+
};
|
|
720
|
+
breakouts._llmChannel = mockChannel;
|
|
721
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
722
|
+
breakouts.listenToBroadcastMessages();
|
|
723
|
+
assert.notCalled(listenToSpy);
|
|
508
724
|
});
|
|
509
725
|
|
|
510
726
|
it('do not subscribe message if already done', () => {
|
|
511
|
-
|
|
727
|
+
const mockChannel = {
|
|
728
|
+
isConnected: sinon.stub().returns(true),
|
|
729
|
+
on: sinon.stub(),
|
|
730
|
+
off: sinon.stub(),
|
|
731
|
+
};
|
|
732
|
+
breakouts._llmChannel = mockChannel;
|
|
512
733
|
breakouts.hasSubscribedToMessage = true;
|
|
513
|
-
|
|
514
|
-
breakouts.
|
|
515
|
-
assert.
|
|
516
|
-
|
|
734
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
735
|
+
breakouts.listenToBroadcastMessages();
|
|
736
|
+
assert.notCalled(listenToSpy);
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
it('subscribes to breakout.message events on connected channel', () => {
|
|
740
|
+
const mockChannel = {
|
|
741
|
+
isConnected: sinon.stub().returns(true),
|
|
742
|
+
on: sinon.stub(),
|
|
743
|
+
off: sinon.stub(),
|
|
744
|
+
};
|
|
745
|
+
breakouts._llmChannel = mockChannel;
|
|
746
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
747
|
+
breakouts.listenToBroadcastMessages();
|
|
748
|
+
|
|
749
|
+
assert.calledOnce(listenToSpy);
|
|
750
|
+
assert.calledWith(listenToSpy, mockChannel, 'event:breakout.message', sinon.match.func);
|
|
751
|
+
assert.equal(breakouts.hasSubscribedToMessage, true);
|
|
517
752
|
});
|
|
518
753
|
|
|
519
754
|
it('triggers message event when a message received', () => {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
755
|
+
const mockChannel = {
|
|
756
|
+
isConnected: sinon.stub().returns(true),
|
|
757
|
+
on: sinon.stub(),
|
|
758
|
+
off: sinon.stub(),
|
|
759
|
+
};
|
|
760
|
+
breakouts._llmChannel = mockChannel;
|
|
761
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
762
|
+
breakouts.listenToBroadcastMessages();
|
|
524
763
|
|
|
525
|
-
|
|
764
|
+
// Get the callback passed to listenTo
|
|
765
|
+
const callback = listenToSpy.getCall(0).args[2];
|
|
526
766
|
|
|
527
767
|
let message;
|
|
528
|
-
|
|
529
768
|
breakouts.listenTo(breakouts, BREAKOUTS.EVENTS.MESSAGE, (event) => {
|
|
530
769
|
message = event;
|
|
531
770
|
});
|
|
532
771
|
|
|
533
772
|
breakouts.currentBreakoutSession.sessionId = 'sessionId';
|
|
534
773
|
|
|
774
|
+
// Simulate the LLM channel event
|
|
535
775
|
callback({
|
|
536
776
|
data: {
|
|
537
777
|
senderUserId: 'senderUserId',
|
|
@@ -1485,7 +1725,7 @@ describe('plugin-meetings', () => {
|
|
|
1485
1725
|
state: 'LOCKED',
|
|
1486
1726
|
};
|
|
1487
1727
|
|
|
1488
|
-
await
|
|
1728
|
+
await assert.isRejected(breakouts.lockBreakout(), Error, 'Breakout already locked');
|
|
1489
1729
|
});
|
|
1490
1730
|
|
|
1491
1731
|
it('lock breakout without editLock', async () => {
|
|
@@ -1847,6 +2087,53 @@ describe('plugin-meetings', () => {
|
|
|
1847
2087
|
});
|
|
1848
2088
|
});
|
|
1849
2089
|
|
|
2090
|
+
describe('#removeFromBreakout', () => {
|
|
2091
|
+
it('should make a POST request with correct body and return the result', async () => {
|
|
2092
|
+
breakouts.request = sinon.stub().returns(Promise.resolve('REQUEST_RETURN_VALUE'));
|
|
2093
|
+
breakouts.set('url', 'url');
|
|
2094
|
+
breakouts.set('mainGroupId', 'mainGroupId');
|
|
2095
|
+
breakouts.set('mainSessionId', 'mainSessionId');
|
|
2096
|
+
|
|
2097
|
+
const participants = ['participant1', 'participant2'];
|
|
2098
|
+
const result = await breakouts.removeFromBreakout(participants);
|
|
2099
|
+
|
|
2100
|
+
assert.calledOnceWithExactly(breakouts.request, {
|
|
2101
|
+
method: 'POST',
|
|
2102
|
+
uri: 'url/move',
|
|
2103
|
+
body: {
|
|
2104
|
+
groups: [
|
|
2105
|
+
{
|
|
2106
|
+
id: 'mainGroupId',
|
|
2107
|
+
sessions: [
|
|
2108
|
+
{
|
|
2109
|
+
id: 'mainSessionId',
|
|
2110
|
+
participants,
|
|
2111
|
+
},
|
|
2112
|
+
],
|
|
2113
|
+
},
|
|
2114
|
+
],
|
|
2115
|
+
},
|
|
2116
|
+
});
|
|
2117
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
2118
|
+
});
|
|
2119
|
+
|
|
2120
|
+
it('should throw an error if mainGroupId is missing', () => {
|
|
2121
|
+
breakouts.set('mainSessionId', 'mainSessionId');
|
|
2122
|
+
assert.throws(
|
|
2123
|
+
() => breakouts.removeFromBreakout(['participant1']),
|
|
2124
|
+
'Main group ID and session ID must be available to remove participants from breakout'
|
|
2125
|
+
);
|
|
2126
|
+
});
|
|
2127
|
+
|
|
2128
|
+
it('should throw an error if mainSessionId is missing', () => {
|
|
2129
|
+
breakouts.set('mainGroupId', 'mainGroupId');
|
|
2130
|
+
assert.throws(
|
|
2131
|
+
() => breakouts.removeFromBreakout(['participant1']),
|
|
2132
|
+
'Main group ID and session ID must be available to remove participants from breakout'
|
|
2133
|
+
);
|
|
2134
|
+
});
|
|
2135
|
+
});
|
|
2136
|
+
|
|
1850
2137
|
describe('#triggerReturnToMainEvent', () => {
|
|
1851
2138
|
const checkTrigger = ({breakout, shouldTrigger}) => {
|
|
1852
2139
|
breakouts.trigger = sinon.stub();
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {assert} from '@webex/test-helper-chai';
|
|
2
|
+
import {
|
|
3
|
+
AddMediaFailed,
|
|
4
|
+
MediaConnectionTimedOutError,
|
|
5
|
+
} from '@webex/plugin-meetings/src/common/errors/webex-errors';
|
|
6
|
+
|
|
7
|
+
describe('MediaConnectionTimedOutError', () => {
|
|
8
|
+
[
|
|
9
|
+
{iceConnected: true, message: 'timeout with ice connected'},
|
|
10
|
+
{iceConnected: false, message: 'timeout without ice connected'},
|
|
11
|
+
].forEach(({iceConnected, message}) => {
|
|
12
|
+
it(`stores message and iceConnected=${iceConnected}`, () => {
|
|
13
|
+
const error = new MediaConnectionTimedOutError(message, iceConnected);
|
|
14
|
+
|
|
15
|
+
assert.equal(error.message, message);
|
|
16
|
+
assert.equal(error.iceConnected, iceConnected);
|
|
17
|
+
assert.equal(error.name, 'MediaConnectionTimedOutError');
|
|
18
|
+
assert.instanceOf(error, Error);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('stores the cause when provided', () => {
|
|
23
|
+
const cause = {iceConnected: true};
|
|
24
|
+
const error = new MediaConnectionTimedOutError('timeout', true, cause);
|
|
25
|
+
|
|
26
|
+
assert.equal(error.cause, cause);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('leaves cause undefined when not provided', () => {
|
|
30
|
+
const error = new MediaConnectionTimedOutError('timeout', true);
|
|
31
|
+
|
|
32
|
+
assert.isUndefined(error.cause);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('AddMediaFailed', () => {
|
|
37
|
+
it('stores all options properties', () => {
|
|
38
|
+
const cause = new Error('underlying');
|
|
39
|
+
const error = new AddMediaFailed({
|
|
40
|
+
cause,
|
|
41
|
+
connectionType: 'UDP',
|
|
42
|
+
selectedCandidatePairChanges: 3,
|
|
43
|
+
numTransports: 2,
|
|
44
|
+
iceConnected: true,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
assert.equal(error.cause, cause);
|
|
48
|
+
assert.equal(error.connectionType, 'UDP');
|
|
49
|
+
assert.equal(error.selectedCandidatePairChanges, 3);
|
|
50
|
+
assert.equal(error.numTransports, 2);
|
|
51
|
+
assert.equal(error.iceConnected, true);
|
|
52
|
+
assert.equal(error.message, 'Failed to add media');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('works with default empty options', () => {
|
|
56
|
+
const error = new AddMediaFailed();
|
|
57
|
+
|
|
58
|
+
assert.isUndefined(error.cause);
|
|
59
|
+
assert.isUndefined(error.connectionType);
|
|
60
|
+
assert.isUndefined(error.selectedCandidatePairChanges);
|
|
61
|
+
assert.isUndefined(error.numTransports);
|
|
62
|
+
assert.isUndefined(error.iceConnected);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe('isDtlsHandshakeFailure', () => {
|
|
66
|
+
[
|
|
67
|
+
{iceConnected: true, expected: true},
|
|
68
|
+
{iceConnected: false, expected: false},
|
|
69
|
+
{iceConnected: undefined, expected: false},
|
|
70
|
+
].forEach(({iceConnected, expected}) => {
|
|
71
|
+
it(`returns ${expected} when iceConnected=${iceConnected}`, () => {
|
|
72
|
+
const error = new AddMediaFailed({iceConnected});
|
|
73
|
+
|
|
74
|
+
assert.equal(error.isDtlsHandshakeFailure, expected);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|