@webex/plugin-meetings 3.12.0 → 3.13.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import {HashTreeObject, ObjectType} from '../../../../src/hashTree/types';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
deleteNestedObjectsWithHtMeta,
|
|
4
|
+
isSelf,
|
|
5
|
+
sleep,
|
|
6
|
+
sortByInitPriority,
|
|
7
|
+
} from '../../../../src/hashTree/utils';
|
|
8
|
+
import {DataSetNames, DATA_SET_INIT_PRIORITY} from '../../../../src/hashTree/constants';
|
|
9
|
+
import sinon from 'sinon';
|
|
3
10
|
|
|
4
11
|
import {assert} from '@webex/test-helper-chai';
|
|
5
12
|
|
|
@@ -137,4 +144,121 @@ describe('Hash Tree Utils', () => {
|
|
|
137
144
|
assert.isFalse(isSelf(participantObject));
|
|
138
145
|
});
|
|
139
146
|
});
|
|
147
|
+
|
|
148
|
+
describe('#sortByInitPriority', () => {
|
|
149
|
+
[
|
|
150
|
+
{
|
|
151
|
+
description: 'places "main" and "self" first when both appear',
|
|
152
|
+
input: ['atd-active', 'main', 'atd-unmuted', 'self'],
|
|
153
|
+
expected: ['main', 'self', 'atd-active', 'atd-unmuted'],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
description: 'preserves original order of non-priority items',
|
|
157
|
+
input: ['atd-unmuted', 'atd-active', 'self'],
|
|
158
|
+
expected: ['self', 'atd-unmuted', 'atd-active'],
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
description: 'returns items unchanged when no priority items present',
|
|
162
|
+
input: ['atd-active', 'atd-unmuted'],
|
|
163
|
+
expected: ['atd-active', 'atd-unmuted'],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
description: 'reorders when only priority items present',
|
|
167
|
+
input: ['self', 'main'],
|
|
168
|
+
expected: ['main', 'self'],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
description: 'handles empty list',
|
|
172
|
+
input: [],
|
|
173
|
+
expected: [],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
description: 'handles only some priority items present',
|
|
177
|
+
input: ['atd-active', 'main'],
|
|
178
|
+
expected: ['main', 'atd-active'],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
description: 'handles single non-priority item',
|
|
182
|
+
input: ['atd-active'],
|
|
183
|
+
expected: ['atd-active'],
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
description: 'handles single priority item',
|
|
187
|
+
input: ['self'],
|
|
188
|
+
expected: ['self'],
|
|
189
|
+
},
|
|
190
|
+
].forEach(({description, input, expected}) => {
|
|
191
|
+
it(description, () => {
|
|
192
|
+
const items = input.map((name) => ({name}));
|
|
193
|
+
|
|
194
|
+
const result = sortByInitPriority(items, DATA_SET_INIT_PRIORITY);
|
|
195
|
+
|
|
196
|
+
assert.deepEqual(
|
|
197
|
+
result.map((i) => i.name),
|
|
198
|
+
expected
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('should not mutate the original array', () => {
|
|
204
|
+
const items = [{name: DataSetNames.ATD_ACTIVE}, {name: DataSetNames.SELF}];
|
|
205
|
+
const originalOrder = items.map((i) => i.name);
|
|
206
|
+
|
|
207
|
+
sortByInitPriority(items, DATA_SET_INIT_PRIORITY);
|
|
208
|
+
|
|
209
|
+
assert.deepEqual(
|
|
210
|
+
items.map((i) => i.name),
|
|
211
|
+
originalOrder
|
|
212
|
+
);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('should preserve extra properties on items', () => {
|
|
216
|
+
const items = [
|
|
217
|
+
{name: DataSetNames.ATD_ACTIVE, url: 'url1'},
|
|
218
|
+
{name: DataSetNames.SELF, url: 'url2'},
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
const result = sortByInitPriority(items, DATA_SET_INIT_PRIORITY);
|
|
222
|
+
|
|
223
|
+
assert.deepEqual(result, [
|
|
224
|
+
{name: DataSetNames.SELF, url: 'url2'},
|
|
225
|
+
{name: DataSetNames.ATD_ACTIVE, url: 'url1'},
|
|
226
|
+
]);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
describe('#sleep', () => {
|
|
231
|
+
let clock;
|
|
232
|
+
|
|
233
|
+
beforeEach(() => {
|
|
234
|
+
clock = sinon.useFakeTimers();
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
afterEach(() => {
|
|
238
|
+
clock.restore();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
[0, -1, -100].forEach((ms) => {
|
|
242
|
+
it(`resolves immediately when ms is ${ms}`, async () => {
|
|
243
|
+
const result = sleep(ms);
|
|
244
|
+
|
|
245
|
+
assert.instanceOf(result, Promise);
|
|
246
|
+
await result;
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('resolves after the specified delay', async () => {
|
|
251
|
+
let resolved = false;
|
|
252
|
+
|
|
253
|
+
sleep(500).then(() => { resolved = true; });
|
|
254
|
+
|
|
255
|
+
assert.isFalse(resolved);
|
|
256
|
+
|
|
257
|
+
await clock.tickAsync(499);
|
|
258
|
+
assert.isFalse(resolved);
|
|
259
|
+
|
|
260
|
+
await clock.tickAsync(1);
|
|
261
|
+
assert.isTrue(resolved);
|
|
262
|
+
});
|
|
263
|
+
});
|
|
140
264
|
});
|
|
@@ -6,7 +6,10 @@ import {WebexHttpError} from '@webex/webex-core';
|
|
|
6
6
|
import DataChannelAuthTokenInterceptor from '@webex/plugin-meetings/src/interceptors/dataChannelAuthToken';
|
|
7
7
|
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
8
8
|
import * as utils from '@webex/plugin-meetings/src/interceptors/utils';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
DATA_CHANNEL_AUTH_HEADER,
|
|
11
|
+
MAX_RETRY,
|
|
12
|
+
} from '@webex/plugin-meetings/src/interceptors/constant';
|
|
10
13
|
|
|
11
14
|
describe('plugin-meetings', () => {
|
|
12
15
|
describe('Interceptors', () => {
|
|
@@ -178,6 +181,28 @@ describe('plugin-meetings', () => {
|
|
|
178
181
|
expect(result).to.equal('mock-response');
|
|
179
182
|
});
|
|
180
183
|
|
|
184
|
+
it('passes request URL to _refreshDataChannelToken', async () => {
|
|
185
|
+
const psOptions = {
|
|
186
|
+
headers: {[DATA_CHANNEL_AUTH_HEADER]: 'old-token'},
|
|
187
|
+
method: 'POST',
|
|
188
|
+
uri: 'https://locus.example.com/practiceSession/datachannel',
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
interceptor._refreshDataChannelToken.resolves('new-token');
|
|
192
|
+
webex.request.resolves('mock-response');
|
|
193
|
+
|
|
194
|
+
const promise = interceptor.refreshTokenAndRetryWithDelay(psOptions);
|
|
195
|
+
|
|
196
|
+
clock.tick(2000);
|
|
197
|
+
|
|
198
|
+
await promise;
|
|
199
|
+
|
|
200
|
+
sinon.assert.calledOnceWithExactly(
|
|
201
|
+
interceptor._refreshDataChannelToken,
|
|
202
|
+
psOptions.uri
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
|
|
181
206
|
it('rejects when refreshDataChannelToken fails', async () => {
|
|
182
207
|
interceptor._refreshDataChannelToken.rejects(new Error('refresh failed'));
|
|
183
208
|
|
|
@@ -205,6 +230,159 @@ describe('plugin-meetings', () => {
|
|
|
205
230
|
);
|
|
206
231
|
});
|
|
207
232
|
});
|
|
233
|
+
|
|
234
|
+
describe('refreshDataChannelToken routing (factory dispatcher)', () => {
|
|
235
|
+
let llmMock;
|
|
236
|
+
let meetingA;
|
|
237
|
+
let meetingsMock;
|
|
238
|
+
let dispatcherInterceptor;
|
|
239
|
+
|
|
240
|
+
const PS_DATACHANNEL_URL = 'https://board-a.wbx2.com/datachannel/api/v1/locus/cHJhY3RpY2Vfc2Vzc2lvbl9sb2N1cw==/registrations';
|
|
241
|
+
const DEFAULT_DATACHANNEL_URL = 'https://board-a.wbx2.com/datachannel/api/v1/locus/aHR0cHM6Ly9sb2N1cy1hLndieDIuY29t/registrations';
|
|
242
|
+
|
|
243
|
+
beforeEach(() => {
|
|
244
|
+
meetingA = {
|
|
245
|
+
id: 'meeting-a',
|
|
246
|
+
refreshDataChannelToken: sinon.stub().resolves({
|
|
247
|
+
body: {
|
|
248
|
+
datachannelToken: 'token-from-meeting-a',
|
|
249
|
+
dataChannelTokenType: 'llm-practice-session',
|
|
250
|
+
},
|
|
251
|
+
}),
|
|
252
|
+
setLLMChannelDataToken: sinon.stub(),
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
llmMock = {
|
|
256
|
+
isDataChannelTokenEnabled: sinon.stub().resolves(true),
|
|
257
|
+
getChannelByDatachannelUrl: sinon.stub().returns(undefined),
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
meetingsMock = {
|
|
261
|
+
getAllMeetings: sinon.stub().returns({}),
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const context = {
|
|
265
|
+
internal: {llm: llmMock},
|
|
266
|
+
meetings: meetingsMock,
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
dispatcherInterceptor = Reflect.apply(DataChannelAuthTokenInterceptor.create, context, []);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('routes request URL to matching channel', async () => {
|
|
273
|
+
const mockChannel = {
|
|
274
|
+
refreshDataChannelToken: sinon.stub().resolves({
|
|
275
|
+
body: {
|
|
276
|
+
datachannelToken: 'token-from-channel',
|
|
277
|
+
dataChannelTokenType: 'llm-practice-session',
|
|
278
|
+
},
|
|
279
|
+
}),
|
|
280
|
+
setDatachannelToken: sinon.stub(),
|
|
281
|
+
};
|
|
282
|
+
llmMock.getChannelByDatachannelUrl.withArgs(PS_DATACHANNEL_URL).returns(mockChannel);
|
|
283
|
+
|
|
284
|
+
const token = await dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL);
|
|
285
|
+
|
|
286
|
+
expect(token).to.equal('token-from-channel');
|
|
287
|
+
sinon.assert.calledOnceWithExactly(
|
|
288
|
+
llmMock.getChannelByDatachannelUrl,
|
|
289
|
+
PS_DATACHANNEL_URL
|
|
290
|
+
);
|
|
291
|
+
sinon.assert.calledOnceWithExactly(mockChannel.refreshDataChannelToken);
|
|
292
|
+
sinon.assert.calledOnceWithExactly(mockChannel.setDatachannelToken, 'token-from-channel');
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('falls back to meeting lookup when no channel matches', async () => {
|
|
296
|
+
llmMock.getChannelByDatachannelUrl.returns(undefined);
|
|
297
|
+
|
|
298
|
+
// Import the static method for matching datachannel URLs
|
|
299
|
+
const LLMChannel = require('@webex/internal-plugin-llm').default;
|
|
300
|
+
sinon
|
|
301
|
+
.stub(LLMChannel, 'matchesDatachannelRequestUrl')
|
|
302
|
+
.callsFake((requestUrl, datachannelUrl) => {
|
|
303
|
+
return requestUrl === PS_DATACHANNEL_URL && datachannelUrl === PS_DATACHANNEL_URL;
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
meetingsMock.getAllMeetings.returns({
|
|
307
|
+
'meeting-a': {
|
|
308
|
+
...meetingA,
|
|
309
|
+
locusInfo: {
|
|
310
|
+
info: {
|
|
311
|
+
practiceSessionDatachannelUrl: PS_DATACHANNEL_URL,
|
|
312
|
+
datachannelUrl: DEFAULT_DATACHANNEL_URL,
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
const token = await dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL);
|
|
319
|
+
|
|
320
|
+
expect(token).to.equal('token-from-meeting-a');
|
|
321
|
+
sinon.assert.calledOnceWithExactly(meetingA.refreshDataChannelToken);
|
|
322
|
+
sinon.assert.calledOnceWithExactly(
|
|
323
|
+
meetingA.setLLMChannelDataToken,
|
|
324
|
+
'token-from-meeting-a'
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
LLMChannel.matchesDatachannelRequestUrl.restore();
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
it('throws when no channel or meeting matches', async () => {
|
|
331
|
+
llmMock.getChannelByDatachannelUrl.returns(undefined);
|
|
332
|
+
meetingsMock.getAllMeetings.returns({});
|
|
333
|
+
|
|
334
|
+
await assert.isRejected(
|
|
335
|
+
dispatcherInterceptor._refreshDataChannelToken(
|
|
336
|
+
'https://unknown-datachannel.example.com/registrations'
|
|
337
|
+
),
|
|
338
|
+
/No LLM channel or meeting found for request URL/
|
|
339
|
+
);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('throws when channel refresh returns no payload', async () => {
|
|
343
|
+
const mockChannel = {
|
|
344
|
+
refreshDataChannelToken: sinon.stub().resolves(null),
|
|
345
|
+
setDatachannelToken: sinon.stub(),
|
|
346
|
+
};
|
|
347
|
+
llmMock.getChannelByDatachannelUrl.returns(mockChannel);
|
|
348
|
+
|
|
349
|
+
await assert.isRejected(
|
|
350
|
+
dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL),
|
|
351
|
+
/DataChannel token refresh returned no payload/
|
|
352
|
+
);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it('throws when meeting refresh returns no payload', async () => {
|
|
356
|
+
llmMock.getChannelByDatachannelUrl.returns(undefined);
|
|
357
|
+
|
|
358
|
+
const LLMChannel = require('@webex/internal-plugin-llm').default;
|
|
359
|
+
sinon.stub(LLMChannel, 'matchesDatachannelRequestUrl').returns(true);
|
|
360
|
+
|
|
361
|
+
const meetingWithNoPayload = {
|
|
362
|
+
id: 'meeting-b',
|
|
363
|
+
refreshDataChannelToken: sinon.stub().resolves(null),
|
|
364
|
+
setLLMChannelDataToken: sinon.stub(),
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
meetingsMock.getAllMeetings.returns({
|
|
368
|
+
'meeting-b': {
|
|
369
|
+
...meetingWithNoPayload,
|
|
370
|
+
locusInfo: {
|
|
371
|
+
info: {
|
|
372
|
+
datachannelUrl: PS_DATACHANNEL_URL,
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
await assert.isRejected(
|
|
379
|
+
dispatcherInterceptor._refreshDataChannelToken(PS_DATACHANNEL_URL),
|
|
380
|
+
/DataChannel token refresh returned no payload/
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
LLMChannel.matchesDatachannelRequestUrl.restore();
|
|
384
|
+
});
|
|
385
|
+
});
|
|
208
386
|
});
|
|
209
387
|
});
|
|
210
388
|
});
|
|
@@ -36,6 +36,27 @@ describe('plugin-meetings', () => {
|
|
|
36
36
|
uri: `https://locus-test.webex.com/locus/api/v1/loci/call`,
|
|
37
37
|
body: 'foo'
|
|
38
38
|
};
|
|
39
|
+
|
|
40
|
+
const hashTreeOptions = {
|
|
41
|
+
method: 'GET',
|
|
42
|
+
headers: {
|
|
43
|
+
trackingid: 'test',
|
|
44
|
+
'retry-after': 1000,
|
|
45
|
+
},
|
|
46
|
+
uri: `https://locus-test.webex.com/locus/api/v1/loci/12345/session/abc/datasets/main/hashtree`,
|
|
47
|
+
body: undefined,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const syncOptions = {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
headers: {
|
|
53
|
+
trackingid: 'test',
|
|
54
|
+
'retry-after': 1000,
|
|
55
|
+
},
|
|
56
|
+
uri: `https://locus-test.webex.com/locus/api/v1/loci/12345/session/abc/datasets/main/sync`,
|
|
57
|
+
body: 'foo',
|
|
58
|
+
};
|
|
59
|
+
|
|
39
60
|
const reason1 = new WebexHttpError.MethodNotAllowed({
|
|
40
61
|
statusCode: 403,
|
|
41
62
|
options: {
|
|
@@ -68,14 +89,223 @@ describe('plugin-meetings', () => {
|
|
|
68
89
|
});
|
|
69
90
|
|
|
70
91
|
it('calls handleRetryRequestLocusServiceError with correct retry time when locus service unavailable error', () => {
|
|
71
|
-
|
|
72
|
-
|
|
92
|
+
interceptor.webex.request = sinon.stub().returns(Promise.resolve());
|
|
93
|
+
const handleRetryStub = sinon.stub(
|
|
94
|
+
interceptor,
|
|
95
|
+
'handleRetryRequestLocusServiceError'
|
|
96
|
+
);
|
|
97
|
+
handleRetryStub.returns(Promise.resolve());
|
|
98
|
+
|
|
99
|
+
return interceptor.onResponseError(options, reason2).then(() => {
|
|
100
|
+
expect(handleRetryStub.calledWith(options, 1000)).to.be.true;
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
[429, 500, 502, 503, 504].forEach((statusCode) => {
|
|
105
|
+
it(`does not retry /hashtree requests on ${statusCode}`, () => {
|
|
106
|
+
const reason = new WebexHttpError.MethodNotAllowed({
|
|
107
|
+
statusCode,
|
|
108
|
+
options: {
|
|
109
|
+
headers: {trackingid: 'test', 'retry-after': 1000},
|
|
110
|
+
uri: hashTreeOptions.uri,
|
|
111
|
+
},
|
|
112
|
+
body: {error: `Fake ${statusCode}`},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const handleRetryStub = sinon.stub(
|
|
116
|
+
interceptor,
|
|
117
|
+
'handleRetryRequestLocusServiceError'
|
|
118
|
+
);
|
|
119
|
+
handleRetryStub.returns(Promise.resolve());
|
|
120
|
+
|
|
121
|
+
return interceptor.onResponseError(hashTreeOptions, reason).then(
|
|
122
|
+
() => assert.fail('Expected promise to be rejected'),
|
|
123
|
+
(err) => {
|
|
124
|
+
expect(err).to.equal(reason);
|
|
125
|
+
expect(handleRetryStub.called).to.be.false;
|
|
126
|
+
handleRetryStub.restore();
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it(`does not retry /sync requests on ${statusCode}`, () => {
|
|
132
|
+
const reason = new WebexHttpError.MethodNotAllowed({
|
|
133
|
+
statusCode,
|
|
134
|
+
options: {
|
|
135
|
+
headers: {trackingid: 'test', 'retry-after': 1000},
|
|
136
|
+
uri: syncOptions.uri,
|
|
137
|
+
},
|
|
138
|
+
body: {error: `Fake ${statusCode}`},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const handleRetryStub = sinon.stub(
|
|
142
|
+
interceptor,
|
|
143
|
+
'handleRetryRequestLocusServiceError'
|
|
144
|
+
);
|
|
73
145
|
handleRetryStub.returns(Promise.resolve());
|
|
74
146
|
|
|
75
|
-
return interceptor.onResponseError(
|
|
76
|
-
|
|
147
|
+
return interceptor.onResponseError(syncOptions, reason).then(
|
|
148
|
+
() => assert.fail('Expected promise to be rejected'),
|
|
149
|
+
(err) => {
|
|
150
|
+
expect(err).to.equal(reason);
|
|
151
|
+
expect(handleRetryStub.called).to.be.false;
|
|
152
|
+
handleRetryStub.restore();
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('still retries other locus requests on 429', () => {
|
|
159
|
+
const reason429 = new WebexHttpError.MethodNotAllowed({
|
|
160
|
+
statusCode: 429,
|
|
161
|
+
options: {
|
|
162
|
+
headers: {trackingid: 'test', 'retry-after': 1000},
|
|
163
|
+
uri: options.uri,
|
|
164
|
+
},
|
|
165
|
+
body: {error: 'Too Many Requests'},
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
interceptor.webex.request = sinon.stub().returns(Promise.resolve());
|
|
169
|
+
const handleRetryStub = sinon.stub(
|
|
170
|
+
interceptor,
|
|
171
|
+
'handleRetryRequestLocusServiceError'
|
|
172
|
+
);
|
|
173
|
+
handleRetryStub.returns(Promise.resolve());
|
|
174
|
+
|
|
175
|
+
return interceptor.onResponseError(options, reason429).then(() => {
|
|
176
|
+
expect(handleRetryStub.calledOnce).to.be.true;
|
|
177
|
+
handleRetryStub.restore();
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('still retries other locus requests on 503', () => {
|
|
182
|
+
interceptor.webex.request = sinon.stub().returns(Promise.resolve());
|
|
183
|
+
const handleRetryStub = sinon.stub(
|
|
184
|
+
interceptor,
|
|
185
|
+
'handleRetryRequestLocusServiceError'
|
|
186
|
+
);
|
|
187
|
+
handleRetryStub.returns(Promise.resolve());
|
|
77
188
|
|
|
189
|
+
return interceptor.onResponseError(options, reason2).then(() => {
|
|
190
|
+
expect(handleRetryStub.calledOnce).to.be.true;
|
|
191
|
+
handleRetryStub.restore();
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
[
|
|
196
|
+
[429, WebexHttpError.TooManyRequests],
|
|
197
|
+
[503, WebexHttpError.ServiceUnavailable],
|
|
198
|
+
].forEach(([statusCode, ErrorType]) => {
|
|
199
|
+
it(`rejects the HTTP ${statusCode} error after a locus retry is exhausted`, async () => {
|
|
200
|
+
const reason = new ErrorType({
|
|
201
|
+
statusCode,
|
|
202
|
+
options: {
|
|
203
|
+
headers: {trackingid: 'test', 'retry-after': 1000},
|
|
204
|
+
uri: options.uri,
|
|
205
|
+
},
|
|
206
|
+
body: {message: 'Locus request failed'},
|
|
207
|
+
});
|
|
208
|
+
const handleRetryStub = sinon
|
|
209
|
+
.stub(interceptor, 'handleRetryRequestLocusServiceError')
|
|
210
|
+
.resolves();
|
|
211
|
+
|
|
212
|
+
await interceptor.onResponseError(options, reason);
|
|
213
|
+
|
|
214
|
+
return interceptor.onResponseError(options, reason).then(
|
|
215
|
+
() => assert.fail('Expected promise to be rejected'),
|
|
216
|
+
(error) => {
|
|
217
|
+
expect(error).to.equal(reason);
|
|
218
|
+
handleRetryStub.restore();
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
describe('URI parsing edge cases', () => {
|
|
225
|
+
const make503Reason = (uri) =>
|
|
226
|
+
new WebexHttpError.MethodNotAllowed({
|
|
227
|
+
statusCode: 503,
|
|
228
|
+
options: {headers: {trackingid: 'test', 'retry-after': 1000}, uri},
|
|
229
|
+
body: {error: 'Service Unavailable'},
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
const makeOptions = (uri) => ({
|
|
233
|
+
method: 'GET',
|
|
234
|
+
headers: {trackingid: 'test', 'retry-after': 1000},
|
|
235
|
+
uri,
|
|
236
|
+
body: undefined,
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
[
|
|
240
|
+
'https://locus.webex.com/locus/api/v1/loci/123/session/abc/datasets/main/hashtree?rootHash=xyz',
|
|
241
|
+
'https://locus.webex.com/locus/api/v1/loci/123/session/abc/datasets/main/sync?seq=5',
|
|
242
|
+
].forEach((uri) => {
|
|
243
|
+
it(`skips retry even with query params: ${uri.split('/').pop()}`, () => {
|
|
244
|
+
const opts = makeOptions(uri);
|
|
245
|
+
const reason = make503Reason(uri);
|
|
246
|
+
const stub = sinon
|
|
247
|
+
.stub(interceptor, 'handleRetryRequestLocusServiceError')
|
|
248
|
+
.returns(Promise.resolve());
|
|
249
|
+
|
|
250
|
+
return interceptor.onResponseError(opts, reason).then(
|
|
251
|
+
() => assert.fail('Expected promise to be rejected'),
|
|
252
|
+
(err) => {
|
|
253
|
+
expect(err).to.equal(reason);
|
|
254
|
+
expect(stub.called).to.be.false;
|
|
255
|
+
stub.restore();
|
|
256
|
+
}
|
|
257
|
+
);
|
|
78
258
|
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
[
|
|
262
|
+
'https://locus.webex.com/locus/api/v1/loci/123/hashtree-v2',
|
|
263
|
+
'https://locus.webex.com/locus/api/v1/loci/123/syncData',
|
|
264
|
+
'https://locus.webex.com/locus/api/v1/loci/123/async',
|
|
265
|
+
'https://locus.webex.com/locus/api/v1/loci/123/hashtree/metadata',
|
|
266
|
+
].forEach((uri) => {
|
|
267
|
+
it(`still retries when path only partially matches: ${uri
|
|
268
|
+
.split('/')
|
|
269
|
+
.pop()}`, () => {
|
|
270
|
+
const opts = makeOptions(uri);
|
|
271
|
+
const reason = make503Reason(uri);
|
|
272
|
+
interceptor.webex.request = sinon.stub().returns(Promise.resolve());
|
|
273
|
+
const stub = sinon
|
|
274
|
+
.stub(interceptor, 'handleRetryRequestLocusServiceError')
|
|
275
|
+
.returns(Promise.resolve());
|
|
276
|
+
|
|
277
|
+
return interceptor.onResponseError(opts, reason).then(() => {
|
|
278
|
+
expect(stub.calledOnce).to.be.true;
|
|
279
|
+
stub.restore();
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('still retries when /hashtree is on a non-locus host', () => {
|
|
285
|
+
const uri = 'https://other-service.webex.com/api/v1/hashtree';
|
|
286
|
+
const opts = makeOptions(uri);
|
|
287
|
+
const reason = make503Reason(uri);
|
|
288
|
+
|
|
289
|
+
return interceptor.onResponseError(opts, reason).then(
|
|
290
|
+
() => assert.fail('Expected promise to be rejected'),
|
|
291
|
+
(err) => {
|
|
292
|
+
expect(err).to.equal(reason);
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it('still retries when URI is malformed', () => {
|
|
298
|
+
const uri = 'not-a-valid-url';
|
|
299
|
+
const opts = makeOptions(uri);
|
|
300
|
+
const reason = make503Reason(uri);
|
|
301
|
+
|
|
302
|
+
return interceptor.onResponseError(opts, reason).then(
|
|
303
|
+
() => assert.fail('Expected promise to be rejected'),
|
|
304
|
+
(err) => {
|
|
305
|
+
expect(err).to.equal(reason);
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
});
|
|
79
309
|
});
|
|
80
310
|
});
|
|
81
311
|
|
|
@@ -129,4 +359,3 @@ describe('plugin-meetings', () => {
|
|
|
129
359
|
});
|
|
130
360
|
});
|
|
131
361
|
});
|
|
132
|
-
|