@webex/plugin-meetings 3.12.0 → 3.13.0-next.2
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/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/config.js +4 -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/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 +322 -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/config.d.ts +4 -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/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 +40 -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/config.ts +8 -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/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 +296 -0
- package/src/meetings/index.ts +224 -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/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -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/meetinginfov2.js +88 -11
- package/test/unit/spec/meetings/index.js +586 -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
|
@@ -6,6 +6,7 @@ import {MediaType} from '@webex/internal-media-core';
|
|
|
6
6
|
import {
|
|
7
7
|
Configuration,
|
|
8
8
|
Event,
|
|
9
|
+
getRemoteMediaManagerConfigForLogging,
|
|
9
10
|
RemoteMediaManager,
|
|
10
11
|
VideoLayoutChangedEventData,
|
|
11
12
|
} from '@webex/plugin-meetings/src/multistream/remoteMediaManager';
|
|
@@ -120,6 +121,34 @@ const DefaultTestConfiguration: Configuration = {
|
|
|
120
121
|
},
|
|
121
122
|
};
|
|
122
123
|
|
|
124
|
+
describe('getRemoteMediaManagerConfigForLogging', () => {
|
|
125
|
+
it('returns undefined when no configuration is provided', () => {
|
|
126
|
+
assert.isUndefined(getRemoteMediaManagerConfigForLogging());
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('replaces layouts with their count and initial layout without mutating the configuration', () => {
|
|
130
|
+
const config = cloneDeep(DefaultTestConfiguration);
|
|
131
|
+
const originalConfig = cloneDeep(config);
|
|
132
|
+
|
|
133
|
+
const result = getRemoteMediaManagerConfigForLogging(config);
|
|
134
|
+
|
|
135
|
+
assert.deepEqual(result, {
|
|
136
|
+
...config,
|
|
137
|
+
video: {
|
|
138
|
+
...config.video,
|
|
139
|
+
layouts: {
|
|
140
|
+
count: Object.keys(config.video.layouts).length,
|
|
141
|
+
initial: {
|
|
142
|
+
id: config.video.initialLayoutId,
|
|
143
|
+
definition: config.video.layouts[config.video.initialLayoutId],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
assert.deepEqual(config, originalConfig);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
123
152
|
describe('RemoteMediaManager', () => {
|
|
124
153
|
let remoteMediaManager;
|
|
125
154
|
let fakeReceiveSlotManager;
|
|
@@ -663,6 +692,23 @@ describe('RemoteMediaManager', () => {
|
|
|
663
692
|
});
|
|
664
693
|
|
|
665
694
|
describe('constructor', () => {
|
|
695
|
+
it('logs the compact remote media manager configuration', () => {
|
|
696
|
+
logger.log.resetHistory();
|
|
697
|
+
|
|
698
|
+
new RemoteMediaManager(
|
|
699
|
+
fakeReceiveSlotManager,
|
|
700
|
+
fakeMediaRequestManagers,
|
|
701
|
+
DefaultTestConfiguration
|
|
702
|
+
);
|
|
703
|
+
|
|
704
|
+
assert.calledOnceWithExactly(
|
|
705
|
+
logger.log,
|
|
706
|
+
`RemoteMediaManager#constructor --> RemoteMediaManager created with config: ${JSON.stringify(
|
|
707
|
+
getRemoteMediaManagerConfigForLogging(DefaultTestConfiguration)
|
|
708
|
+
)}`
|
|
709
|
+
);
|
|
710
|
+
});
|
|
711
|
+
|
|
666
712
|
it('throws if the initial layout in the config is invalid', () => {
|
|
667
713
|
const config = cloneDeep(DefaultTestConfiguration);
|
|
668
714
|
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import 'jsdom-global/register';
|
|
2
2
|
import SendSlotManager from '@webex/plugin-meetings/src/multistream/sendSlotManager';
|
|
3
|
-
import { LocalStream, MediaType, MultistreamRoapMediaConnection } from "@webex/internal-media-core";
|
|
4
|
-
import {expect} from '@webex/test-helper-chai';
|
|
3
|
+
import { LocalStream, MediaType, MultistreamRoapMediaConnection, MediaCodecMimeType } from "@webex/internal-media-core";
|
|
4
|
+
import {assert, expect} from '@webex/test-helper-chai';
|
|
5
5
|
import sinon from 'sinon';
|
|
6
|
+
import Metrics from '@webex/plugin-meetings/src/metrics';
|
|
7
|
+
import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
|
|
6
8
|
|
|
7
9
|
describe('SendSlotsManager', () => {
|
|
8
10
|
let sendSlotsManager: SendSlotManager;
|
|
9
11
|
const LoggerProxy = {
|
|
10
12
|
logger: {
|
|
11
13
|
info: sinon.stub(),
|
|
14
|
+
warn: sinon.stub(),
|
|
15
|
+
error: sinon.stub(),
|
|
12
16
|
},
|
|
13
17
|
};
|
|
14
18
|
|
|
15
19
|
beforeEach(() => {
|
|
16
20
|
sendSlotsManager = new SendSlotManager(LoggerProxy);
|
|
21
|
+
sinon.stub(Metrics, 'sendBehavioralMetric');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
sinon.restore();
|
|
17
26
|
});
|
|
18
27
|
|
|
19
28
|
describe('createSlot', () => {
|
|
@@ -29,13 +38,13 @@ describe('SendSlotsManager', () => {
|
|
|
29
38
|
it('should create a slot for the given mediaType', () => {
|
|
30
39
|
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
31
40
|
|
|
32
|
-
|
|
41
|
+
assert.calledWith(mediaConnection.createSendSlot, mediaType, true);
|
|
33
42
|
});
|
|
34
43
|
|
|
35
44
|
it('should create a slot for the given mediaType & active state', () => {
|
|
36
45
|
sendSlotsManager.createSlot(mediaConnection, mediaType, false);
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
assert.calledWith(mediaConnection.createSendSlot, mediaType, false);
|
|
39
48
|
});
|
|
40
49
|
|
|
41
50
|
it('should throw an error if a slot for the given mediaType already exists', () => {
|
|
@@ -86,14 +95,12 @@ describe('SendSlotsManager', () => {
|
|
|
86
95
|
|
|
87
96
|
await sendSlotsManager.publishStream(mediaType, stream);
|
|
88
97
|
|
|
89
|
-
|
|
98
|
+
assert.calledWith(slot.publishStream, stream);
|
|
90
99
|
});
|
|
91
100
|
|
|
92
|
-
it('should throw an error if a slot for the given mediaType does not exist', (
|
|
93
|
-
sendSlotsManager.publishStream(mediaType, stream)
|
|
94
|
-
|
|
95
|
-
done();
|
|
96
|
-
});
|
|
101
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
102
|
+
await expect(sendSlotsManager.publishStream(mediaType, stream))
|
|
103
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
97
104
|
});
|
|
98
105
|
});
|
|
99
106
|
|
|
@@ -116,14 +123,12 @@ describe('SendSlotsManager', () => {
|
|
|
116
123
|
|
|
117
124
|
await sendSlotsManager.unpublishStream(mediaType);
|
|
118
125
|
|
|
119
|
-
|
|
126
|
+
assert.called(slot.unpublishStream);
|
|
120
127
|
});
|
|
121
128
|
|
|
122
|
-
it('should throw an error if a slot for the given mediaType does not exist',(
|
|
123
|
-
sendSlotsManager.unpublishStream(mediaType)
|
|
124
|
-
|
|
125
|
-
done();
|
|
126
|
-
});
|
|
129
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
130
|
+
await expect(sendSlotsManager.unpublishStream(mediaType))
|
|
131
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
127
132
|
});
|
|
128
133
|
});
|
|
129
134
|
|
|
@@ -147,7 +152,7 @@ describe('SendSlotsManager', () => {
|
|
|
147
152
|
|
|
148
153
|
await sendSlotsManager.setNamedMediaGroups(mediaType, groups);
|
|
149
154
|
|
|
150
|
-
|
|
155
|
+
assert.calledWith(slot.setNamedMediaGroups, groups);
|
|
151
156
|
});
|
|
152
157
|
|
|
153
158
|
it('should throw an error if the given mediaType is not audio', () => {
|
|
@@ -169,16 +174,16 @@ describe('SendSlotsManager', () => {
|
|
|
169
174
|
} as MultistreamRoapMediaConnection;
|
|
170
175
|
});
|
|
171
176
|
|
|
172
|
-
it('should set the active state of the sendSlot for the given mediaType',
|
|
177
|
+
it('should set the active state of the sendSlot for the given mediaType', () => {
|
|
173
178
|
const slot = {
|
|
174
|
-
|
|
179
|
+
active: false,
|
|
175
180
|
};
|
|
176
181
|
mediaConnection.createSendSlot.returns(slot);
|
|
177
182
|
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
178
183
|
|
|
179
|
-
|
|
184
|
+
sendSlotsManager.setActive(mediaType, true);
|
|
180
185
|
|
|
181
|
-
expect(slot.
|
|
186
|
+
expect(slot.active).to.be.true;
|
|
182
187
|
});
|
|
183
188
|
|
|
184
189
|
it('should throw an error if a slot for the given mediaType does not exist', () => {
|
|
@@ -197,7 +202,7 @@ describe('SendSlotsManager', () => {
|
|
|
197
202
|
} as MultistreamRoapMediaConnection;
|
|
198
203
|
});
|
|
199
204
|
|
|
200
|
-
it('should
|
|
205
|
+
it('should delegate to slot.setCodecParameters, log deprecation warning and send deprecation metric', async () => {
|
|
201
206
|
const slot = {
|
|
202
207
|
setCodecParameters: sinon.stub().resolves(),
|
|
203
208
|
};
|
|
@@ -206,14 +211,17 @@ describe('SendSlotsManager', () => {
|
|
|
206
211
|
|
|
207
212
|
await sendSlotsManager.setCodecParameters(mediaType, codecParameters);
|
|
208
213
|
|
|
209
|
-
|
|
214
|
+
assert.calledWith(slot.setCodecParameters, codecParameters);
|
|
215
|
+
assert.called(LoggerProxy.logger.warn);
|
|
216
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
217
|
+
BEHAVIORAL_METRICS.DEPRECATED_SET_CODEC_PARAMETERS_USED,
|
|
218
|
+
{ mediaType, codecParameters }
|
|
219
|
+
);
|
|
210
220
|
});
|
|
211
221
|
|
|
212
|
-
it('should throw an error if a slot for the given mediaType does not exist', (
|
|
213
|
-
sendSlotsManager.setCodecParameters(mediaType, codecParameters)
|
|
214
|
-
|
|
215
|
-
done();
|
|
216
|
-
});
|
|
222
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
223
|
+
await expect(sendSlotsManager.setCodecParameters(mediaType, codecParameters))
|
|
224
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
217
225
|
});
|
|
218
226
|
});
|
|
219
227
|
|
|
@@ -227,36 +235,131 @@ describe('SendSlotsManager', () => {
|
|
|
227
235
|
} as MultistreamRoapMediaConnection;
|
|
228
236
|
});
|
|
229
237
|
|
|
230
|
-
it('should
|
|
238
|
+
it('should delegate to slot.deleteCodecParameters, log deprecation warning and send deprecation metric', async () => {
|
|
231
239
|
const slot = {
|
|
232
240
|
deleteCodecParameters: sinon.stub().resolves(),
|
|
233
241
|
};
|
|
234
242
|
mediaConnection.createSendSlot.returns(slot);
|
|
235
243
|
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
236
244
|
|
|
237
|
-
await sendSlotsManager.deleteCodecParameters(mediaType,[]);
|
|
245
|
+
await sendSlotsManager.deleteCodecParameters(mediaType, []);
|
|
246
|
+
|
|
247
|
+
assert.calledWith(slot.deleteCodecParameters, []);
|
|
248
|
+
assert.called(LoggerProxy.logger.warn);
|
|
249
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
250
|
+
BEHAVIORAL_METRICS.DEPRECATED_DELETE_CODEC_PARAMETERS_USED,
|
|
251
|
+
{ mediaType, parameters: [] }
|
|
252
|
+
);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
256
|
+
await expect(sendSlotsManager.deleteCodecParameters(mediaType, []))
|
|
257
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
describe('setCustomCodecParameters', () => {
|
|
262
|
+
let mediaConnection;
|
|
263
|
+
const mediaType = MediaType.AudioMain;
|
|
264
|
+
const codecMimeType = MediaCodecMimeType.OPUS;
|
|
265
|
+
const parameters = { maxaveragebitrate: '64000' };
|
|
266
|
+
|
|
267
|
+
beforeEach(() => {
|
|
268
|
+
mediaConnection = {
|
|
269
|
+
createSendSlot: sinon.stub(),
|
|
270
|
+
} as MultistreamRoapMediaConnection;
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it('should set custom codec parameters on the sendSlot for the given mediaType and codec, log info and send metric', async () => {
|
|
274
|
+
const slot = {
|
|
275
|
+
setCustomCodecParameters: sinon.stub().resolves(),
|
|
276
|
+
};
|
|
277
|
+
mediaConnection.createSendSlot.returns(slot);
|
|
278
|
+
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
279
|
+
|
|
280
|
+
await sendSlotsManager.setCustomCodecParameters(mediaType, codecMimeType, parameters);
|
|
281
|
+
|
|
282
|
+
assert.calledWith(slot.setCustomCodecParameters, codecMimeType, parameters);
|
|
283
|
+
assert.called(LoggerProxy.logger.info);
|
|
284
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
285
|
+
BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED,
|
|
286
|
+
{ mediaType, codecMimeType, parameters }
|
|
287
|
+
);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
291
|
+
await expect(sendSlotsManager.setCustomCodecParameters(mediaType, codecMimeType, parameters))
|
|
292
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('should throw and log error when setCustomCodecParameters fails', async () => {
|
|
296
|
+
const error = new Error('codec parameter failure');
|
|
297
|
+
const slot = {
|
|
298
|
+
setCustomCodecParameters: sinon.stub().rejects(error),
|
|
299
|
+
};
|
|
300
|
+
mediaConnection.createSendSlot.returns(slot);
|
|
301
|
+
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
302
|
+
|
|
303
|
+
await expect(sendSlotsManager.setCustomCodecParameters(mediaType, codecMimeType, parameters))
|
|
304
|
+
.to.be.rejectedWith('codec parameter failure');
|
|
238
305
|
|
|
239
|
-
|
|
306
|
+
assert.called(LoggerProxy.logger.error);
|
|
307
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
308
|
+
BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED,
|
|
309
|
+
{ mediaType, codecMimeType, parameters }
|
|
310
|
+
);
|
|
240
311
|
});
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
describe('markCustomCodecParametersForDeletion', () => {
|
|
315
|
+
let mediaConnection;
|
|
316
|
+
const mediaType = MediaType.AudioMain;
|
|
317
|
+
const codecMimeType = MediaCodecMimeType.OPUS;
|
|
318
|
+
const parameters = ['maxaveragebitrate', 'maxplaybackrate'];
|
|
319
|
+
|
|
320
|
+
beforeEach(() => {
|
|
321
|
+
mediaConnection = {
|
|
322
|
+
createSendSlot: sinon.stub(),
|
|
323
|
+
} as MultistreamRoapMediaConnection;
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('should mark custom codec parameters for deletion on the sendSlot for the given mediaType and codec, log info and send metric', async () => {
|
|
327
|
+
const slot = {
|
|
328
|
+
markCustomCodecParametersForDeletion: sinon.stub().resolves(),
|
|
329
|
+
};
|
|
330
|
+
mediaConnection.createSendSlot.returns(slot);
|
|
331
|
+
sendSlotsManager.createSlot(mediaConnection, mediaType);
|
|
332
|
+
|
|
333
|
+
await sendSlotsManager.markCustomCodecParametersForDeletion(mediaType, codecMimeType, parameters);
|
|
241
334
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
335
|
+
assert.calledWith(slot.markCustomCodecParametersForDeletion, codecMimeType, parameters);
|
|
336
|
+
assert.called(LoggerProxy.logger.info);
|
|
337
|
+
assert.calledWith(Metrics.sendBehavioralMetric as sinon.SinonStub,
|
|
338
|
+
BEHAVIORAL_METRICS.MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED,
|
|
339
|
+
{ mediaType, codecMimeType, parameters }
|
|
340
|
+
);
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
it('should throw an error if a slot for the given mediaType does not exist', async () => {
|
|
344
|
+
await expect(sendSlotsManager.markCustomCodecParametersForDeletion(mediaType, codecMimeType, parameters))
|
|
345
|
+
.to.be.rejectedWith(`Slot for ${mediaType} does not exist`);
|
|
247
346
|
});
|
|
248
347
|
});
|
|
249
348
|
|
|
250
349
|
describe('reset', () => {
|
|
251
350
|
let mediaConnection;
|
|
351
|
+
let mockSlot: {unpublishStream: sinon.SinonStub};
|
|
252
352
|
|
|
253
353
|
beforeEach(() => {
|
|
354
|
+
mockSlot = {
|
|
355
|
+
unpublishStream: sinon.stub().resolves(),
|
|
356
|
+
};
|
|
254
357
|
mediaConnection = {
|
|
255
|
-
createSendSlot: sinon.stub().returns(
|
|
358
|
+
createSendSlot: sinon.stub().returns(mockSlot),
|
|
256
359
|
} as MultistreamRoapMediaConnection;
|
|
257
360
|
});
|
|
258
361
|
|
|
259
|
-
it('should reset the send slot manager', () => {
|
|
362
|
+
it('should unpublish and reset the send slot manager', () => {
|
|
260
363
|
const AudioSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.AudioMain);
|
|
261
364
|
const VideoSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.VideoMain);
|
|
262
365
|
const AudioSlidesSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.AudioSlides);
|
|
@@ -265,11 +368,35 @@ describe('SendSlotsManager', () => {
|
|
|
265
368
|
expect(sendSlotsManager.getSlot(MediaType.VideoMain)).to.equal(VideoSlot);
|
|
266
369
|
expect(sendSlotsManager.getSlot(MediaType.AudioSlides)).to.equal(AudioSlidesSlot);
|
|
267
370
|
expect(sendSlotsManager.getSlot(MediaType.VideoSlides)).to.equal(VideoSlidesSlot);
|
|
371
|
+
|
|
268
372
|
sendSlotsManager.reset();
|
|
373
|
+
|
|
269
374
|
expect(() => sendSlotsManager.getSlot(MediaType.AudioMain)).to.throw();
|
|
270
375
|
expect(() => sendSlotsManager.getSlot(MediaType.VideoMain)).to.throw();
|
|
271
376
|
expect(() => sendSlotsManager.getSlot(MediaType.AudioSlides)).to.throw();
|
|
272
377
|
expect(() => sendSlotsManager.getSlot(MediaType.VideoSlides)).to.throw();
|
|
378
|
+
|
|
379
|
+
// every slot must be unpublished (detaching its stream listeners) before being
|
|
380
|
+
// discarded, otherwise it stays subscribed to a stream that may be reused later
|
|
381
|
+
assert.callCount(mockSlot.unpublishStream, 4);
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it('logs a warning and still clears the slots when unpublishStream rejects', async () => {
|
|
385
|
+
const error = new Error('cannot unpublish: peer connection is closed');
|
|
386
|
+
mockSlot.unpublishStream.rejects(error);
|
|
387
|
+
|
|
388
|
+
sendSlotsManager.createSlot(mediaConnection, MediaType.AudioMain);
|
|
389
|
+
|
|
390
|
+
sendSlotsManager.reset();
|
|
391
|
+
|
|
392
|
+
// allow the rejected unpublishStream promise's .catch() handler to run
|
|
393
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
394
|
+
|
|
395
|
+
expect(() => sendSlotsManager.getSlot(MediaType.AudioMain)).to.throw();
|
|
396
|
+
assert.calledWith(
|
|
397
|
+
LoggerProxy.logger.warn,
|
|
398
|
+
`SendSlotsManager->reset#Failed to unpublish stream for ${MediaType.AudioMain} while resetting: ${error.message}`
|
|
399
|
+
);
|
|
273
400
|
});
|
|
274
401
|
});
|
|
275
402
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'jsdom-global/register';
|
|
1
2
|
import {assert} from '@webex/test-helper-chai';
|
|
2
3
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
3
4
|
import { CapabilityState, WebCapabilities } from '@webex/web-capabilities';
|
|
@@ -63,6 +64,13 @@ describe('isAnyPublicClusterReachable', () => {
|
|
|
63
64
|
);
|
|
64
65
|
});
|
|
65
66
|
|
|
67
|
+
it('returns false when only xtls is reachable', async () => {
|
|
68
|
+
await checkIsClusterReachable(
|
|
69
|
+
{x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}, xtls: {result: 'reachable'}}},
|
|
70
|
+
false
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
|
|
66
74
|
it('returns false when both tcp and udp are unreachable', async () => {
|
|
67
75
|
await checkIsClusterReachable(
|
|
68
76
|
{x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}}},
|
|
@@ -70,6 +78,13 @@ describe('isAnyPublicClusterReachable', () => {
|
|
|
70
78
|
);
|
|
71
79
|
});
|
|
72
80
|
|
|
81
|
+
it('returns false when udp, tcp and xtls are all unreachable', async () => {
|
|
82
|
+
await checkIsClusterReachable(
|
|
83
|
+
{x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}, xtls: {result: 'unreachable'}}},
|
|
84
|
+
false
|
|
85
|
+
);
|
|
86
|
+
});
|
|
87
|
+
|
|
73
88
|
it('returns false when reachability result is empty', async () => {
|
|
74
89
|
await checkIsClusterReachable({x: {}}, false);
|
|
75
90
|
});
|
|
@@ -145,6 +160,75 @@ describe('isAnyPublicClusterReachable', () => {
|
|
|
145
160
|
});
|
|
146
161
|
});
|
|
147
162
|
|
|
163
|
+
describe('isAnyClusterReachableViaProtocol', () => {
|
|
164
|
+
let webex;
|
|
165
|
+
|
|
166
|
+
beforeEach(() => {
|
|
167
|
+
webex = new MockWebex();
|
|
168
|
+
sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
afterEach(() => {
|
|
172
|
+
sinon.restore();
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
const checkReachableViaProtocol = async (
|
|
176
|
+
mockStorage: any,
|
|
177
|
+
protocol: 'udp' | 'tcp' | 'xtls',
|
|
178
|
+
expectedValue: boolean
|
|
179
|
+
) => {
|
|
180
|
+
if (mockStorage) {
|
|
181
|
+
await webex.boundedStorage.put(
|
|
182
|
+
'Reachability',
|
|
183
|
+
'reachability.result',
|
|
184
|
+
JSON.stringify(mockStorage)
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
const reachability = new Reachability(webex);
|
|
188
|
+
|
|
189
|
+
const result = await reachability.isAnyClusterReachableViaProtocol(protocol);
|
|
190
|
+
|
|
191
|
+
assert.equal(result, expectedValue);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
['udp', 'tcp', 'xtls'].forEach((protocol: 'udp' | 'tcp' | 'xtls') => {
|
|
195
|
+
it(`returns true when at least one cluster is reachable via ${protocol}`, async () => {
|
|
196
|
+
await checkReachableViaProtocol(
|
|
197
|
+
{
|
|
198
|
+
clusterA: {[protocol]: {result: 'reachable'}},
|
|
199
|
+
clusterB: {[protocol]: {result: 'unreachable'}},
|
|
200
|
+
},
|
|
201
|
+
protocol,
|
|
202
|
+
true
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it(`returns false when no cluster is reachable via ${protocol}`, async () => {
|
|
207
|
+
await checkReachableViaProtocol(
|
|
208
|
+
{
|
|
209
|
+
clusterA: {[protocol]: {result: 'unreachable'}},
|
|
210
|
+
clusterB: {[protocol]: {result: 'unreachable'}},
|
|
211
|
+
},
|
|
212
|
+
protocol,
|
|
213
|
+
false
|
|
214
|
+
);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('returns false when storage read throws an error', async () => {
|
|
219
|
+
// don't put anything in storage so .get() rejects
|
|
220
|
+
const reachability = new Reachability(webex);
|
|
221
|
+
|
|
222
|
+
const result = await reachability.isAnyClusterReachableViaProtocol('xtls');
|
|
223
|
+
|
|
224
|
+
assert.equal(result, false);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it('returns false when stored data is empty', async () => {
|
|
228
|
+
await checkReachableViaProtocol({}, 'xtls', false);
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
148
232
|
describe('isWebexMediaBackendUnreachable', () => {
|
|
149
233
|
let webex;
|
|
150
234
|
|
|
@@ -510,10 +594,7 @@ describe('gatherReachability', () => {
|
|
|
510
594
|
return mockInstance;
|
|
511
595
|
});
|
|
512
596
|
|
|
513
|
-
webex.config.meetings.
|
|
514
|
-
enableTcpReachability: false,
|
|
515
|
-
enableTlsReachability: false,
|
|
516
|
-
};
|
|
597
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: false};
|
|
517
598
|
});
|
|
518
599
|
|
|
519
600
|
afterEach(() => {
|
|
@@ -1229,10 +1310,7 @@ describe('gatherReachability', () => {
|
|
|
1229
1310
|
expectedMetrics,
|
|
1230
1311
|
}) =>
|
|
1231
1312
|
it(`works correctly for the case: ${title}`, async () => {
|
|
1232
|
-
webex.config.meetings.
|
|
1233
|
-
enableTcpReachability: true,
|
|
1234
|
-
enableTlsReachability: true,
|
|
1235
|
-
};
|
|
1313
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1236
1314
|
|
|
1237
1315
|
// the metrics related to ipver and trigger are not tested in these tests and are all the same, so setting them up here
|
|
1238
1316
|
const expectedMetricsFull = {
|
|
@@ -1367,10 +1445,7 @@ describe('gatherReachability', () => {
|
|
|
1367
1445
|
});
|
|
1368
1446
|
|
|
1369
1447
|
it(`starts ip network version detection and includes the results in the metrics`, async () => {
|
|
1370
|
-
webex.config.meetings.
|
|
1371
|
-
enableTcpReachability: true,
|
|
1372
|
-
enableTlsReachability: true,
|
|
1373
|
-
};
|
|
1448
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1374
1449
|
webex.internal.device.ipNetworkDetector = {
|
|
1375
1450
|
supportsIpV4: true,
|
|
1376
1451
|
supportsIpV6: true,
|
|
@@ -1447,10 +1522,7 @@ describe('gatherReachability', () => {
|
|
|
1447
1522
|
});
|
|
1448
1523
|
|
|
1449
1524
|
it('keeps updating reachability results after the 3s public cloud timeout expires', async () => {
|
|
1450
|
-
webex.config.meetings.
|
|
1451
|
-
enableTcpReachability: true,
|
|
1452
|
-
enableTlsReachability: true,
|
|
1453
|
-
};
|
|
1525
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1454
1526
|
|
|
1455
1527
|
const reachability = new Reachability(webex);
|
|
1456
1528
|
|
|
@@ -1546,10 +1618,7 @@ describe('gatherReachability', () => {
|
|
|
1546
1618
|
});
|
|
1547
1619
|
|
|
1548
1620
|
it('handles clientMediaIpsUpdated event by updating clientMediaIps in results', async () => {
|
|
1549
|
-
webex.config.meetings.
|
|
1550
|
-
enableTcpReachability: true,
|
|
1551
|
-
enableTlsReachability: true,
|
|
1552
|
-
};
|
|
1621
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1553
1622
|
|
|
1554
1623
|
const reachability = new Reachability(webex);
|
|
1555
1624
|
|
|
@@ -1634,10 +1703,7 @@ describe('gatherReachability', () => {
|
|
|
1634
1703
|
});
|
|
1635
1704
|
|
|
1636
1705
|
it('starts ClusterReachability on each media cluster', async () => {
|
|
1637
|
-
webex.config.meetings.
|
|
1638
|
-
enableTcpReachability: true,
|
|
1639
|
-
enableTlsReachability: true,
|
|
1640
|
-
};
|
|
1706
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1641
1707
|
|
|
1642
1708
|
const getClustersResult = {
|
|
1643
1709
|
clusters: {
|
|
@@ -1686,10 +1752,7 @@ describe('gatherReachability', () => {
|
|
|
1686
1752
|
});
|
|
1687
1753
|
|
|
1688
1754
|
it('does not do TCP reachability if it is disabled in config', async () => {
|
|
1689
|
-
webex.config.meetings.
|
|
1690
|
-
enableTcpReachability: false,
|
|
1691
|
-
enableTlsReachability: true,
|
|
1692
|
-
};
|
|
1755
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: true};
|
|
1693
1756
|
|
|
1694
1757
|
const getClustersResult = {
|
|
1695
1758
|
clusters: {
|
|
@@ -1720,10 +1783,7 @@ describe('gatherReachability', () => {
|
|
|
1720
1783
|
});
|
|
1721
1784
|
|
|
1722
1785
|
it('does not do TLS reachability if it is disabled in config', async () => {
|
|
1723
|
-
webex.config.meetings.
|
|
1724
|
-
enableTcpReachability: true,
|
|
1725
|
-
enableTlsReachability: false,
|
|
1726
|
-
};
|
|
1786
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: true, tls: false};
|
|
1727
1787
|
|
|
1728
1788
|
const getClustersResult = {
|
|
1729
1789
|
clusters: {
|
|
@@ -1755,10 +1815,7 @@ describe('gatherReachability', () => {
|
|
|
1755
1815
|
});
|
|
1756
1816
|
|
|
1757
1817
|
it('does not do TCP or TLS reachability if it is disabled in config', async () => {
|
|
1758
|
-
webex.config.meetings.
|
|
1759
|
-
enableTcpReachability: false,
|
|
1760
|
-
enableTlsReachability: false,
|
|
1761
|
-
};
|
|
1818
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: false};
|
|
1762
1819
|
|
|
1763
1820
|
const getClustersResult = {
|
|
1764
1821
|
clusters: {
|
|
@@ -1789,12 +1846,40 @@ describe('gatherReachability', () => {
|
|
|
1789
1846
|
}, undefined);
|
|
1790
1847
|
});
|
|
1791
1848
|
|
|
1792
|
-
it('
|
|
1793
|
-
webex.config.meetings.
|
|
1794
|
-
|
|
1795
|
-
|
|
1849
|
+
it('does UDP, TCP and TLS reachability by default (enableReachabilityChecks=true)', async () => {
|
|
1850
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1851
|
+
|
|
1852
|
+
const getClustersResult = {
|
|
1853
|
+
clusters: {
|
|
1854
|
+
'cluster name': {
|
|
1855
|
+
udp: ['testUDP1', 'testUDP2'],
|
|
1856
|
+
tcp: ['testTCP1', 'testTCP2'],
|
|
1857
|
+
xtls: ['testXTLS1', 'testXTLS2'],
|
|
1858
|
+
isVideoMesh: false,
|
|
1859
|
+
},
|
|
1860
|
+
},
|
|
1861
|
+
joinCookie: {id: 'id'},
|
|
1796
1862
|
};
|
|
1797
1863
|
|
|
1864
|
+
const reachability = new Reachability(webex);
|
|
1865
|
+
|
|
1866
|
+
reachability.reachabilityRequest.getClusters = sinon.stub().returns(getClustersResult);
|
|
1867
|
+
|
|
1868
|
+
const promise = reachability.gatherReachability('test');
|
|
1869
|
+
await simulateTimeout();
|
|
1870
|
+
await promise;
|
|
1871
|
+
|
|
1872
|
+
assert.calledOnceWithExactly(clusterReachabilityCtorStub, 'cluster name', {
|
|
1873
|
+
isVideoMesh: false,
|
|
1874
|
+
udp: ['testUDP1', 'testUDP2'],
|
|
1875
|
+
tcp: ['testTCP1', 'testTCP2'],
|
|
1876
|
+
xtls: ['testXTLS1', 'testXTLS2'],
|
|
1877
|
+
}, undefined);
|
|
1878
|
+
});
|
|
1879
|
+
|
|
1880
|
+
it('retry of getClusters is succesfull', async () => {
|
|
1881
|
+
webex.config.meetings.enableReachabilityChecks = {tcp: true, tls: false};
|
|
1882
|
+
|
|
1798
1883
|
const getClustersResult = {
|
|
1799
1884
|
clusters: {
|
|
1800
1885
|
'cluster name': {
|
|
@@ -1866,10 +1951,7 @@ describe('gatherReachability', () => {
|
|
|
1866
1951
|
};
|
|
1867
1952
|
|
|
1868
1953
|
beforeEach(() => {
|
|
1869
|
-
webex.config.meetings.
|
|
1870
|
-
enableTcpReachability: true,
|
|
1871
|
-
enableTlsReachability: true,
|
|
1872
|
-
};
|
|
1954
|
+
webex.config.meetings.enableReachabilityChecks = true;
|
|
1873
1955
|
|
|
1874
1956
|
receivedEvents = {
|
|
1875
1957
|
done: 0,
|
|
@@ -2133,7 +2215,7 @@ describe('gatherReachability', () => {
|
|
|
2133
2215
|
receivedEvents[event] = receivedEvents[event] + 1 || 1;
|
|
2134
2216
|
});
|
|
2135
2217
|
};
|
|
2136
|
-
|
|
2218
|
+
|
|
2137
2219
|
it('works as expected', async () => {
|
|
2138
2220
|
setListener('reachability:stopped');
|
|
2139
2221
|
setListener('reachability:done');
|
|
@@ -2948,4 +3030,4 @@ describe('isSubnetReachable', () => {
|
|
|
2948
3030
|
it(`returns false if the subnet is unreachable`, () => {
|
|
2949
3031
|
assert(!reachability.isSubnetReachable('11'));
|
|
2950
3032
|
});
|
|
2951
|
-
});
|
|
3033
|
+
});
|