@webex/plugin-meetings 3.12.0 → 3.13.0-next.10
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/.sdd/manifest.json +1312 -0
- package/.sdd/templates/.source.json +30 -0
- package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
- package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
- package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
- package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
- package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
- package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
- package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
- package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
- package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
- package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
- package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
- package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
- package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
- package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
- package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
- package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
- package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
- package/.sdd/templates/component-repo/template-map.json +112 -0
- package/AGENTS.md +135 -0
- package/ai-docs/ARCHITECTURE.md +208 -0
- package/ai-docs/CONTRACTS.md +267 -0
- package/ai-docs/DATA_MODEL.md +64 -0
- package/ai-docs/GETTING_STARTED.md +73 -0
- package/ai-docs/GLOSSARY.md +56 -0
- package/ai-docs/REVIEW_CHECKLIST.md +45 -0
- package/ai-docs/RULES.md +79 -0
- package/ai-docs/SECURITY.md +74 -0
- package/ai-docs/SERVICE_STATE.md +59 -0
- package/ai-docs/SPEC_INDEX.md +85 -0
- package/ai-docs/TEST_INDEX.md +45 -0
- package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
- package/ai-docs/patterns/defensive-error-propagation.md +55 -0
- package/ai-docs/patterns/event-scope-emission.md +46 -0
- package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
- package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
- package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
- package/assets/README.md +28 -0
- package/assets/e2ee-0.0.1.js +2 -0
- package/assets/e2ee-0.0.1.wasm +0 -0
- package/babel.config.js +17 -1
- package/dist/aiEnableRequest/index.js +15 -2
- package/dist/aiEnableRequest/index.js.map +1 -1
- package/dist/annotation/index.js +55 -19
- package/dist/annotation/index.js.map +1 -1
- package/dist/assets/e2ee-0.0.1.js +2 -0
- package/dist/assets/e2ee-0.0.1.wasm +0 -0
- 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 +128 -7
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +54 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/wasm-loader.js +174 -0
- package/dist/common/wasm-loader.js.map +1 -0
- package/dist/config.js +5 -2
- package/dist/config.js.map +1 -1
- package/dist/constants.js +39 -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/e2ee/E2eeManager.js +91 -0
- package/dist/e2ee/E2eeManager.js.map +1 -0
- package/dist/e2ee/E2eeSignaling.js +200 -0
- package/dist/e2ee/E2eeSignaling.js.map +1 -0
- package/dist/e2ee/MediaEncryptionService.js +75 -0
- package/dist/e2ee/MediaEncryptionService.js.map +1 -0
- package/dist/e2ee/mls.js +558 -0
- package/dist/e2ee/mls.js.map +1 -0
- package/dist/e2ee/types.js +59 -0
- package/dist/e2ee/types.js.map +1 -0
- package/dist/e2ee/wasm.d.js +7 -0
- package/dist/e2ee/wasm.d.js.map +1 -0
- package/dist/hashTree/constants.js +13 -1
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1245 -404
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/utils.js +42 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/interceptors/dataChannelAuthToken.js +58 -16
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
- package/dist/interceptors/locusRetry.js +24 -9
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interpretation/index.js +55 -12
- 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 +4 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +914 -196
- 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/types.js +20 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +229 -166
- 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 +4 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1931 -887
- 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 +5 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/util.js +42 -3
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting/voicea-meeting.js +2 -1
- package/dist/meeting/voicea-meeting.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +12 -5
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +342 -129
- 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 +10 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +30 -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 +11 -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 +62 -15
- 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 +32 -4
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +127 -3
- 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/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/annotation/index.d.ts +19 -0
- package/dist/types/common/errors/webex-errors.d.ts +36 -2
- package/dist/types/common/wasm-loader.d.ts +55 -0
- package/dist/types/config.d.ts +5 -2
- package/dist/types/constants.d.ts +15 -2
- 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/e2ee/E2eeManager.d.ts +23 -0
- package/dist/types/e2ee/E2eeSignaling.d.ts +94 -0
- package/dist/types/e2ee/MediaEncryptionService.d.ts +27 -0
- package/dist/types/e2ee/mls.d.ts +191 -0
- package/dist/types/e2ee/types.d.ts +104 -0
- package/dist/types/hashTree/constants.d.ts +2 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +230 -18
- package/dist/types/hashTree/utils.d.ts +18 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +151 -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 +66 -49
- package/dist/types/media/properties.d.ts +6 -2
- package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
- package/dist/types/meeting/index.d.ts +247 -13
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +1 -0
- package/dist/types/meeting/util.d.ts +12 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
- package/dist/types/meetings/index.d.ts +44 -19
- 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 +1 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +9 -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 +10 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
- package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
- package/dist/types/multistream/sendSlotManager.d.ts +28 -2
- 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 +3 -0
- package/dist/webinar/index.js +539 -245
- package/dist/webinar/index.js.map +1 -1
- package/package.json +26 -24
- package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
- package/src/aiEnableRequest/index.ts +16 -0
- package/src/annotation/ai-docs/annotation-spec.md +236 -0
- package/src/annotation/index.ts +61 -29
- package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +145 -3
- package/src/common/errors/webex-errors.ts +56 -3
- package/src/common/wasm-loader.ts +124 -0
- package/src/config.ts +9 -3
- package/src/constants.ts +23 -4
- package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
- 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/e2ee/E2eeManager.ts +58 -0
- package/src/e2ee/E2eeSignaling.ts +215 -0
- package/src/e2ee/MediaEncryptionService.ts +41 -0
- package/src/e2ee/mls.ts +548 -0
- package/src/e2ee/types.ts +114 -0
- package/src/e2ee/wasm.d.ts +153 -0
- package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
- package/src/hashTree/constants.ts +16 -0
- package/src/hashTree/hashTreeParser.ts +1021 -214
- package/src/hashTree/utils.ts +36 -0
- package/src/index.ts +7 -0
- package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
- package/src/interceptors/dataChannelAuthToken.ts +59 -12
- package/src/interceptors/locusRetry.ts +26 -5
- package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
- package/src/interpretation/index.ts +65 -10
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
- package/src/locus-info/controlsUtils.ts +3 -1
- package/src/locus-info/index.ts +907 -184
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/types.ts +33 -1
- package/src/media/MediaConnectionAwaiter.ts +229 -196
- package/src/media/ai-docs/media-spec.md +267 -0
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +8 -3
- package/src/meeting/ai-docs/meeting-spec.md +404 -0
- package/src/meeting/in-meeting-actions.ts +8 -0
- package/src/meeting/index.ts +1237 -254
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +11 -0
- package/src/meeting/util.ts +53 -8
- package/src/meeting/voicea-meeting.ts +1 -1
- package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
- package/src/meeting-info/meeting-info-v2.ts +11 -4
- package/src/meetings/ai-docs/meetings-spec.md +298 -0
- package/src/meetings/index.ts +242 -80
- 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/ai-docs/member-spec.md +196 -0
- package/src/member/index.ts +10 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +29 -0
- package/src/members/ai-docs/members-spec.md +256 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/ai-docs/metrics-spec.md +185 -0
- package/src/metrics/constants.ts +11 -0
- package/src/multistream/ai-docs/multistream-spec.md +295 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +119 -28
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +23 -1
- package/src/multistream/sendSlotManager.ts +112 -4
- package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
- package/src/reachability/ai-docs/reachability-spec.md +261 -0
- 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/ai-docs/reactions-spec.md +198 -0
- package/src/reactions/reactions.type.ts +3 -0
- package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
- package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/ai-docs/roap-spec.md +241 -0
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/ai-docs/webinar-spec.md +243 -0
- package/src/webinar/index.ts +333 -73
- package/test/unit/spec/aiEnableRequest/index.ts +86 -0
- package/test/unit/spec/annotation/index.ts +214 -182
- 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 +336 -15
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/common/wasm-loader.ts +171 -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/e2ee/E2eeManager.ts +82 -0
- package/test/unit/spec/e2ee/E2eeSignaling.ts +172 -0
- package/test/unit/spec/e2ee/MediaEncryptionService.ts +43 -0
- package/test/unit/spec/e2ee/mls.ts +765 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +3126 -238
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +179 -1
- package/test/unit/spec/interceptors/locusRetry.ts +234 -5
- package/test/unit/spec/interpretation/index.ts +119 -4
- package/test/unit/spec/locus-info/controlsUtils.js +172 -57
- package/test/unit/spec/locus-info/index.js +1880 -136
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +479 -17
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +26 -26
- package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
- package/test/unit/spec/meeting/index.js +3697 -501
- 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 +12 -0
- package/test/unit/spec/meeting/utils.js +206 -16
- package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
- package/test/unit/spec/meeting-info/index.js +2 -3
- package/test/unit/spec/meeting-info/meetinginfov2.js +88 -11
- package/test/unit/spec/meetings/index.js +606 -53
- 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 +7 -0
- package/test/unit/spec/member/util.js +89 -0
- 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 +501 -37
- package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +165 -38
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- 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 +982 -328
|
@@ -26,6 +26,7 @@ describe('plugin-meetings', () => {
|
|
|
26
26
|
breakout.sessionId = 'sessionId';
|
|
27
27
|
breakout.sessionType = 'BREAKOUT';
|
|
28
28
|
breakout.url = 'url';
|
|
29
|
+
breakout.resourceLink = 'resource-link';
|
|
29
30
|
breakout.collection = {
|
|
30
31
|
parent: {
|
|
31
32
|
meetingId: 'activeMeetingId',
|
|
@@ -45,6 +46,7 @@ describe('plugin-meetings', () => {
|
|
|
45
46
|
describe('initialize', () => {
|
|
46
47
|
it('creates the object correctly', () => {
|
|
47
48
|
assert.instanceOf(breakout.breakoutRequest, BreakoutRequest);
|
|
49
|
+
assert.equal(breakout.resourceLink, 'resource-link');
|
|
48
50
|
});
|
|
49
51
|
});
|
|
50
52
|
|
|
@@ -217,10 +219,14 @@ describe('plugin-meetings', () => {
|
|
|
217
219
|
locusParticipantsUpdate: sinon.stub(),
|
|
218
220
|
};
|
|
219
221
|
|
|
220
|
-
const locusData = {
|
|
222
|
+
const locusData = {participants: [{id: 'participant-1'}], sequence: {entries: [123]}};
|
|
221
223
|
const result = breakout.parseRoster(locusData);
|
|
222
224
|
|
|
223
|
-
assert.calledOnceWithExactly(breakout.members.locusParticipantsUpdate,
|
|
225
|
+
assert.calledOnceWithExactly(breakout.members.locusParticipantsUpdate, {
|
|
226
|
+
participants: [{id: 'participant-1'}],
|
|
227
|
+
isReplace: true,
|
|
228
|
+
});
|
|
229
|
+
assert.equal(breakout.breakoutRosterLocus, locusData);
|
|
224
230
|
assert.equal(result, undefined);
|
|
225
231
|
});
|
|
226
232
|
it('not call locusParticipantsUpdate if sequence is expired', () => {
|
|
@@ -228,7 +234,7 @@ describe('plugin-meetings', () => {
|
|
|
228
234
|
locusParticipantsUpdate: sinon.stub(),
|
|
229
235
|
};
|
|
230
236
|
breakout.isNeedHandleRoster = sinon.stub().returns(false);
|
|
231
|
-
const locusData = {
|
|
237
|
+
const locusData = {participants: [{id: 'participant-1'}], sequence: {entries: [123]}};
|
|
232
238
|
breakout.parseRoster(locusData);
|
|
233
239
|
|
|
234
240
|
assert.notCalled(breakout.members.locusParticipantsUpdate);
|
|
@@ -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',
|
|
@@ -89,6 +88,7 @@ describe('plugin-meetings', () => {
|
|
|
89
88
|
webex = new MockWebex({});
|
|
90
89
|
webex.internal.llm.on = sinon.stub();
|
|
91
90
|
webex.internal.llm.isConnected = sinon.stub();
|
|
91
|
+
webex.internal.llm.getLocusUrl = sinon.stub().returns('newUrl');
|
|
92
92
|
webex.internal.mercury.on = sinon.stub();
|
|
93
93
|
breakouts = new Breakouts({}, {parent: webex});
|
|
94
94
|
breakouts.groupId = 'groupId';
|
|
@@ -217,6 +217,21 @@ describe('plugin-meetings', () => {
|
|
|
217
217
|
});
|
|
218
218
|
assert.calledThrice(breakouts.queryPreAssignments);
|
|
219
219
|
});
|
|
220
|
+
|
|
221
|
+
it('wires LLM_CONNECT_RESPONSE to handleLLMBreakoutJoinResponseMetric', () => {
|
|
222
|
+
const handleStub = sinon.stub(Breakouts.prototype, 'handleLLMBreakoutJoinResponseMetric');
|
|
223
|
+
const bo = new Breakouts({}, {parent: webex});
|
|
224
|
+
|
|
225
|
+
const eventInfo = {
|
|
226
|
+
meeting: {id: 'meeting-id'},
|
|
227
|
+
llmLatency: {clientLLMWebSocketConnectTime: 1},
|
|
228
|
+
};
|
|
229
|
+
bo.trigger(BREAKOUTS.EVENTS.LLM_CONNECT_RESPONSE, eventInfo);
|
|
230
|
+
|
|
231
|
+
assert.calledOnceWithExactly(handleStub, eventInfo);
|
|
232
|
+
|
|
233
|
+
handleStub.restore();
|
|
234
|
+
});
|
|
220
235
|
});
|
|
221
236
|
|
|
222
237
|
describe('#listenToCurrentSessionTypeChange', () => {
|
|
@@ -313,6 +328,7 @@ describe('plugin-meetings', () => {
|
|
|
313
328
|
groupId: 'groupId',
|
|
314
329
|
sessionType: 'sessionType',
|
|
315
330
|
url: 'url',
|
|
331
|
+
resourceLink: 'resource-link',
|
|
316
332
|
name: 'name',
|
|
317
333
|
allowBackToMain: true,
|
|
318
334
|
delayCloseTime: 10,
|
|
@@ -339,6 +355,7 @@ describe('plugin-meetings', () => {
|
|
|
339
355
|
assert.equal(breakouts.currentBreakoutSession.current, true);
|
|
340
356
|
assert.equal(breakouts.currentBreakoutSession.sessionType, 'sessionType');
|
|
341
357
|
assert.equal(breakouts.currentBreakoutSession.url, 'url');
|
|
358
|
+
assert.equal(breakouts.currentBreakoutSession.resourceLink, 'resource-link');
|
|
342
359
|
assert.equal(breakouts.currentBreakoutSession.active, false);
|
|
343
360
|
assert.equal(breakouts.currentBreakoutSession.allowed, false);
|
|
344
361
|
assert.equal(breakouts.currentBreakoutSession.assigned, false);
|
|
@@ -372,6 +389,27 @@ describe('plugin-meetings', () => {
|
|
|
372
389
|
assert.calledOnce(breakouts.clearBreakouts);
|
|
373
390
|
});
|
|
374
391
|
|
|
392
|
+
it('preserves the last non-empty breakoutMoveId when a later update omits it', () => {
|
|
393
|
+
breakouts.updateBreakout({
|
|
394
|
+
sessionId: 'sessionId',
|
|
395
|
+
groupId: 'groupId',
|
|
396
|
+
sessionType: 'BREAKOUT',
|
|
397
|
+
status: 'active',
|
|
398
|
+
breakoutMoveId: 'move-id-1',
|
|
399
|
+
});
|
|
400
|
+
assert.equal(breakouts.breakoutMoveId, 'move-id-1');
|
|
401
|
+
|
|
402
|
+
// a later controls update arrives without a replaces entry -> null move id
|
|
403
|
+
breakouts.updateBreakout({
|
|
404
|
+
sessionId: 'sessionId',
|
|
405
|
+
groupId: 'groupId',
|
|
406
|
+
sessionType: 'BREAKOUT',
|
|
407
|
+
status: 'active',
|
|
408
|
+
breakoutMoveId: null,
|
|
409
|
+
});
|
|
410
|
+
assert.equal(breakouts.breakoutMoveId, 'move-id-1');
|
|
411
|
+
});
|
|
412
|
+
|
|
375
413
|
it('updates the current breakout session, call onBreakoutJoinResponse when session changed', () => {
|
|
376
414
|
breakouts.webex.meetings = {
|
|
377
415
|
getMeetingByType: sinon.stub().returns({
|
|
@@ -429,6 +467,111 @@ describe('plugin-meetings', () => {
|
|
|
429
467
|
});
|
|
430
468
|
});
|
|
431
469
|
|
|
470
|
+
describe('#submitLLMBreakoutJoinResponseMetric', () => {
|
|
471
|
+
let onBreakoutJoinResponseSpy;
|
|
472
|
+
|
|
473
|
+
const setupReadyToEmit = () => {
|
|
474
|
+
breakouts.webex.meetings = {
|
|
475
|
+
getMeetingByType: sinon.stub().returns({id: 'meeting-id'}),
|
|
476
|
+
};
|
|
477
|
+
breakouts.webex.internal.newMetrics = {submitClientEvent: sinon.stub()};
|
|
478
|
+
breakouts.webex.internal.llm.getWebSocketUrl = sinon.stub().returns('wss://llm');
|
|
479
|
+
breakouts.breakoutMoveId = 'moveId';
|
|
480
|
+
breakouts.currentBreakoutSession.set({sessionId: 'sessionId', groupId: 'groupId'});
|
|
481
|
+
breakouts.llmBreakoutJoinResponseInfo = {
|
|
482
|
+
breakoutMoveId: 'moveId',
|
|
483
|
+
meeting: {id: 'meeting-id'},
|
|
484
|
+
llmLatency: {clientLLMWebSocketConnectTime: 1},
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
beforeEach(() => {
|
|
489
|
+
onBreakoutJoinResponseSpy = sinon.stub(breakoutEvent, 'onBreakoutJoinResponse');
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
afterEach(() => {
|
|
493
|
+
onBreakoutJoinResponseSpy.restore();
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
it('emits the join response while an active breakout is in progress', () => {
|
|
497
|
+
setupReadyToEmit();
|
|
498
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.BREAKOUT);
|
|
499
|
+
breakouts.set('status', BREAKOUTS.STATUS.OPEN);
|
|
500
|
+
|
|
501
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
502
|
+
|
|
503
|
+
assert.calledOnce(onBreakoutJoinResponseSpy);
|
|
504
|
+
const eventInfoArg = onBreakoutJoinResponseSpy.getCall(0).args[0];
|
|
505
|
+
assert.equal(eventInfoArg.breakoutMoveId, 'moveId');
|
|
506
|
+
assert.deepEqual(eventInfoArg.llmLatency, {clientLLMWebSocketConnectTime: 1});
|
|
507
|
+
assert.equal(eventInfoArg.llmWebsocketUrl, 'wss://llm');
|
|
508
|
+
assert.equal(eventInfoArg.meeting.id, 'meeting-id');
|
|
509
|
+
assert.equal(eventInfoArg.currentSession.sessionId, 'sessionId');
|
|
510
|
+
assert.equal(eventInfoArg.currentSession.groupId, 'groupId');
|
|
511
|
+
assert.isUndefined(eventInfoArg.error);
|
|
512
|
+
assert.isUndefined(breakouts.llmBreakoutJoinResponseInfo);
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
it('emits the join response after returning to the main session', () => {
|
|
516
|
+
setupReadyToEmit();
|
|
517
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
|
|
518
|
+
breakouts.currentBreakoutSession.set({sessionType: BREAKOUTS.SESSION_TYPES.MAIN});
|
|
519
|
+
|
|
520
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
521
|
+
|
|
522
|
+
assert.calledOnce(onBreakoutJoinResponseSpy);
|
|
523
|
+
const eventInfoArg = onBreakoutJoinResponseSpy.getCall(0).args[0];
|
|
524
|
+
assert.equal(eventInfoArg.breakoutMoveId, 'moveId');
|
|
525
|
+
assert.deepEqual(eventInfoArg.llmLatency, {clientLLMWebSocketConnectTime: 1});
|
|
526
|
+
assert.equal(eventInfoArg.llmWebsocketUrl, 'wss://llm');
|
|
527
|
+
assert.equal(eventInfoArg.meeting.id, 'meeting-id');
|
|
528
|
+
assert.equal(eventInfoArg.currentSession.sessionId, 'sessionId');
|
|
529
|
+
assert.equal(eventInfoArg.currentSession.groupId, 'groupId');
|
|
530
|
+
assert.isUndefined(eventInfoArg.error);
|
|
531
|
+
assert.isUndefined(breakouts.llmBreakoutJoinResponseInfo);
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
it('does not emit without a breakoutMoveId (non-breakout meeting)', () => {
|
|
535
|
+
setupReadyToEmit();
|
|
536
|
+
breakouts.breakoutMoveId = undefined;
|
|
537
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
|
|
538
|
+
|
|
539
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
540
|
+
|
|
541
|
+
assert.notCalled(onBreakoutJoinResponseSpy);
|
|
542
|
+
});
|
|
543
|
+
|
|
544
|
+
it('does not emit when the LLM latency belongs to a different move id', () => {
|
|
545
|
+
setupReadyToEmit();
|
|
546
|
+
breakouts.set('sessionType', BREAKOUTS.SESSION_TYPES.MAIN);
|
|
547
|
+
breakouts.llmBreakoutJoinResponseInfo.breakoutMoveId = 'staleMoveId';
|
|
548
|
+
|
|
549
|
+
breakouts.submitLLMBreakoutJoinResponseMetric();
|
|
550
|
+
|
|
551
|
+
assert.notCalled(onBreakoutJoinResponseSpy);
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
describe('#handleLLMBreakoutJoinResponseMetric', () => {
|
|
556
|
+
it('stores the LLM connect response with the current breakoutMoveId and tries to emit', () => {
|
|
557
|
+
breakouts.breakoutMoveId = 'moveId';
|
|
558
|
+
breakouts.submitLLMBreakoutJoinResponseMetric = sinon.stub();
|
|
559
|
+
|
|
560
|
+
const eventInfo = {
|
|
561
|
+
meeting: {id: 'meeting-id'},
|
|
562
|
+
llmLatency: {clientLLMWebSocketConnectTime: 1},
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
breakouts.handleLLMBreakoutJoinResponseMetric(eventInfo);
|
|
566
|
+
|
|
567
|
+
assert.deepEqual(breakouts.llmBreakoutJoinResponseInfo, {
|
|
568
|
+
...eventInfo,
|
|
569
|
+
breakoutMoveId: 'moveId',
|
|
570
|
+
});
|
|
571
|
+
assert.calledOnce(breakouts.submitLLMBreakoutJoinResponseMetric);
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
|
|
432
575
|
describe('#updateBreakoutSessions', () => {
|
|
433
576
|
const checkBreakout = (breakout, sessionId, state) => {
|
|
434
577
|
assert.deepEqual(breakout.attributes, {
|
|
@@ -498,40 +641,147 @@ describe('plugin-meetings', () => {
|
|
|
498
641
|
});
|
|
499
642
|
});
|
|
500
643
|
|
|
644
|
+
describe('#registerLLMChannel', () => {
|
|
645
|
+
it('registers an LLM channel', () => {
|
|
646
|
+
const mockChannel = {
|
|
647
|
+
isConnected: sinon.stub().returns(true),
|
|
648
|
+
on: sinon.stub(),
|
|
649
|
+
off: sinon.stub(),
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
breakouts.registerLLMChannel(mockChannel);
|
|
653
|
+
|
|
654
|
+
assert.equal(breakouts._llmChannel, mockChannel);
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
it('cleans up previous channel before registering new one', () => {
|
|
658
|
+
const oldChannel = {
|
|
659
|
+
isConnected: sinon.stub().returns(true),
|
|
660
|
+
on: sinon.stub(),
|
|
661
|
+
off: sinon.stub(),
|
|
662
|
+
};
|
|
663
|
+
const newChannel = {
|
|
664
|
+
isConnected: sinon.stub().returns(false),
|
|
665
|
+
on: sinon.stub(),
|
|
666
|
+
off: sinon.stub(),
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
breakouts.registerLLMChannel(oldChannel);
|
|
670
|
+
// After registering connected channel, hasSubscribedToMessage becomes true
|
|
671
|
+
assert.equal(breakouts.hasSubscribedToMessage, true);
|
|
672
|
+
|
|
673
|
+
const stopListeningSpy = sinon.spy(breakouts, 'stopListening');
|
|
674
|
+
breakouts.registerLLMChannel(newChannel);
|
|
675
|
+
|
|
676
|
+
// Should have called stopListening to clean up old channel
|
|
677
|
+
assert.calledWith(stopListeningSpy, oldChannel);
|
|
678
|
+
assert.equal(breakouts._llmChannel, newChannel);
|
|
679
|
+
// Since newChannel is not connected, hasSubscribedToMessage stays false
|
|
680
|
+
assert.equal(breakouts.hasSubscribedToMessage, false);
|
|
681
|
+
});
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
describe('#unregisterLLMChannel', () => {
|
|
685
|
+
it('unregisters the LLM channel', () => {
|
|
686
|
+
const mockChannel = {
|
|
687
|
+
isConnected: sinon.stub().returns(true),
|
|
688
|
+
on: sinon.stub(),
|
|
689
|
+
off: sinon.stub(),
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
breakouts.registerLLMChannel(mockChannel);
|
|
693
|
+
breakouts.hasSubscribedToMessage = true;
|
|
694
|
+
|
|
695
|
+
breakouts.unregisterLLMChannel();
|
|
696
|
+
|
|
697
|
+
assert.equal(breakouts._llmChannel, undefined);
|
|
698
|
+
assert.equal(breakouts.hasSubscribedToMessage, false);
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
it('does nothing if no channel is registered', () => {
|
|
702
|
+
breakouts.unregisterLLMChannel();
|
|
703
|
+
assert.equal(breakouts._llmChannel, undefined);
|
|
704
|
+
});
|
|
705
|
+
});
|
|
706
|
+
|
|
501
707
|
describe('#listenToBroadcastMessages', () => {
|
|
502
|
-
it('do not subscribe message if
|
|
503
|
-
|
|
504
|
-
breakouts.listenTo = sinon.stub();
|
|
708
|
+
it('do not subscribe message if no channel registered', () => {
|
|
709
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
505
710
|
breakouts.locusUrlUpdate('newUrl');
|
|
506
711
|
assert.equal(breakouts.locusUrl, 'newUrl');
|
|
507
|
-
assert.notCalled(
|
|
712
|
+
assert.notCalled(listenToSpy);
|
|
508
713
|
});
|
|
509
714
|
|
|
510
|
-
it('do not subscribe message if
|
|
715
|
+
it('do not subscribe message if channel not connected', () => {
|
|
716
|
+
const mockChannel = {
|
|
717
|
+
isConnected: sinon.stub().returns(false),
|
|
718
|
+
on: sinon.stub(),
|
|
719
|
+
off: sinon.stub(),
|
|
720
|
+
};
|
|
721
|
+
breakouts._llmChannel = mockChannel;
|
|
722
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
723
|
+
breakouts.listenToBroadcastMessages();
|
|
724
|
+
assert.notCalled(listenToSpy);
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
it('do not subscribe message if the connected llm does not belong to this meeting', () => {
|
|
511
728
|
webex.internal.llm.isConnected = sinon.stub().returns(true);
|
|
512
|
-
|
|
729
|
+
webex.internal.llm.getLocusUrl = sinon.stub().returns('anotherMeetingLocusUrl');
|
|
513
730
|
breakouts.listenTo = sinon.stub();
|
|
514
731
|
breakouts.locusUrlUpdate('newUrl');
|
|
515
732
|
assert.equal(breakouts.locusUrl, 'newUrl');
|
|
516
733
|
assert.notCalled(breakouts.listenTo);
|
|
517
734
|
});
|
|
518
735
|
|
|
736
|
+
it('do not subscribe message if already done', () => {
|
|
737
|
+
const mockChannel = {
|
|
738
|
+
isConnected: sinon.stub().returns(true),
|
|
739
|
+
on: sinon.stub(),
|
|
740
|
+
off: sinon.stub(),
|
|
741
|
+
};
|
|
742
|
+
breakouts._llmChannel = mockChannel;
|
|
743
|
+
breakouts.hasSubscribedToMessage = true;
|
|
744
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
745
|
+
breakouts.listenToBroadcastMessages();
|
|
746
|
+
assert.notCalled(listenToSpy);
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
it('subscribes to breakout.message events on connected channel', () => {
|
|
750
|
+
const mockChannel = {
|
|
751
|
+
isConnected: sinon.stub().returns(true),
|
|
752
|
+
on: sinon.stub(),
|
|
753
|
+
off: sinon.stub(),
|
|
754
|
+
};
|
|
755
|
+
breakouts._llmChannel = mockChannel;
|
|
756
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
757
|
+
breakouts.listenToBroadcastMessages();
|
|
758
|
+
|
|
759
|
+
assert.calledOnce(listenToSpy);
|
|
760
|
+
assert.calledWith(listenToSpy, mockChannel, 'event:breakout.message', sinon.match.func);
|
|
761
|
+
assert.equal(breakouts.hasSubscribedToMessage, true);
|
|
762
|
+
});
|
|
763
|
+
|
|
519
764
|
it('triggers message event when a message received', () => {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
765
|
+
const mockChannel = {
|
|
766
|
+
isConnected: sinon.stub().returns(true),
|
|
767
|
+
on: sinon.stub(),
|
|
768
|
+
off: sinon.stub(),
|
|
769
|
+
};
|
|
770
|
+
breakouts._llmChannel = mockChannel;
|
|
771
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
772
|
+
breakouts.listenToBroadcastMessages();
|
|
524
773
|
|
|
525
|
-
|
|
774
|
+
// Get the callback passed to listenTo
|
|
775
|
+
const callback = listenToSpy.getCall(0).args[2];
|
|
526
776
|
|
|
527
777
|
let message;
|
|
528
|
-
|
|
529
778
|
breakouts.listenTo(breakouts, BREAKOUTS.EVENTS.MESSAGE, (event) => {
|
|
530
779
|
message = event;
|
|
531
780
|
});
|
|
532
781
|
|
|
533
782
|
breakouts.currentBreakoutSession.sessionId = 'sessionId';
|
|
534
783
|
|
|
784
|
+
// Simulate the LLM channel event
|
|
535
785
|
callback({
|
|
536
786
|
data: {
|
|
537
787
|
senderUserId: 'senderUserId',
|
|
@@ -547,6 +797,30 @@ describe('plugin-meetings', () => {
|
|
|
547
797
|
sessionId: 'sessionId',
|
|
548
798
|
});
|
|
549
799
|
});
|
|
800
|
+
|
|
801
|
+
it('re-checks the subscription when the llm emits online', () => {
|
|
802
|
+
const onlineCall = webex.internal.llm.on.getCalls().find((c) => c.args[0] === 'online');
|
|
803
|
+
assert.exists(onlineCall, 'expected an online listener to be registered');
|
|
804
|
+
const onlineHandler = onlineCall.args[1];
|
|
805
|
+
|
|
806
|
+
// Set up _llmChannel so listenToBroadcastMessages can subscribe
|
|
807
|
+
const mockChannel = {
|
|
808
|
+
isConnected: sinon.stub().returns(true),
|
|
809
|
+
on: sinon.stub(),
|
|
810
|
+
off: sinon.stub(),
|
|
811
|
+
};
|
|
812
|
+
breakouts._llmChannel = mockChannel;
|
|
813
|
+
|
|
814
|
+
const listenToSpy = sinon.spy(breakouts, 'listenTo');
|
|
815
|
+
|
|
816
|
+
onlineHandler.call(breakouts);
|
|
817
|
+
|
|
818
|
+
const call = listenToSpy
|
|
819
|
+
.getCalls()
|
|
820
|
+
.find((c) => c.args[0] === mockChannel && c.args[1] === 'event:breakout.message');
|
|
821
|
+
assert.exists(call, 'expected broadcast message subscription after online');
|
|
822
|
+
assert.isTrue(breakouts.hasSubscribedToMessage);
|
|
823
|
+
});
|
|
550
824
|
});
|
|
551
825
|
|
|
552
826
|
describe('#updateCanManageBreakouts', () => {
|
|
@@ -1485,7 +1759,7 @@ describe('plugin-meetings', () => {
|
|
|
1485
1759
|
state: 'LOCKED',
|
|
1486
1760
|
};
|
|
1487
1761
|
|
|
1488
|
-
await
|
|
1762
|
+
await assert.isRejected(breakouts.lockBreakout(), Error, 'Breakout already locked');
|
|
1489
1763
|
});
|
|
1490
1764
|
|
|
1491
1765
|
it('lock breakout without editLock', async () => {
|
|
@@ -1847,6 +2121,53 @@ describe('plugin-meetings', () => {
|
|
|
1847
2121
|
});
|
|
1848
2122
|
});
|
|
1849
2123
|
|
|
2124
|
+
describe('#removeFromBreakout', () => {
|
|
2125
|
+
it('should make a POST request with correct body and return the result', async () => {
|
|
2126
|
+
breakouts.request = sinon.stub().returns(Promise.resolve('REQUEST_RETURN_VALUE'));
|
|
2127
|
+
breakouts.set('url', 'url');
|
|
2128
|
+
breakouts.set('mainGroupId', 'mainGroupId');
|
|
2129
|
+
breakouts.set('mainSessionId', 'mainSessionId');
|
|
2130
|
+
|
|
2131
|
+
const participants = ['participant1', 'participant2'];
|
|
2132
|
+
const result = await breakouts.removeFromBreakout(participants);
|
|
2133
|
+
|
|
2134
|
+
assert.calledOnceWithExactly(breakouts.request, {
|
|
2135
|
+
method: 'POST',
|
|
2136
|
+
uri: 'url/move',
|
|
2137
|
+
body: {
|
|
2138
|
+
groups: [
|
|
2139
|
+
{
|
|
2140
|
+
id: 'mainGroupId',
|
|
2141
|
+
sessions: [
|
|
2142
|
+
{
|
|
2143
|
+
id: 'mainSessionId',
|
|
2144
|
+
participants,
|
|
2145
|
+
},
|
|
2146
|
+
],
|
|
2147
|
+
},
|
|
2148
|
+
],
|
|
2149
|
+
},
|
|
2150
|
+
});
|
|
2151
|
+
assert.equal(result, 'REQUEST_RETURN_VALUE');
|
|
2152
|
+
});
|
|
2153
|
+
|
|
2154
|
+
it('should throw an error if mainGroupId is missing', () => {
|
|
2155
|
+
breakouts.set('mainSessionId', 'mainSessionId');
|
|
2156
|
+
assert.throws(
|
|
2157
|
+
() => breakouts.removeFromBreakout(['participant1']),
|
|
2158
|
+
'Main group ID and session ID must be available to remove participants from breakout'
|
|
2159
|
+
);
|
|
2160
|
+
});
|
|
2161
|
+
|
|
2162
|
+
it('should throw an error if mainSessionId is missing', () => {
|
|
2163
|
+
breakouts.set('mainGroupId', 'mainGroupId');
|
|
2164
|
+
assert.throws(
|
|
2165
|
+
() => breakouts.removeFromBreakout(['participant1']),
|
|
2166
|
+
'Main group ID and session ID must be available to remove participants from breakout'
|
|
2167
|
+
);
|
|
2168
|
+
});
|
|
2169
|
+
});
|
|
2170
|
+
|
|
1850
2171
|
describe('#triggerReturnToMainEvent', () => {
|
|
1851
2172
|
const checkTrigger = ({breakout, shouldTrigger}) => {
|
|
1852
2173
|
breakouts.trigger = sinon.stub();
|