@webex/plugin-meetings 3.12.0-webex-services-ready.2 → 3.12.0-webex-services-ready.4
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/dist/aiEnableRequest/index.js +1 -1
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +65 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +193 -23
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/index.js +141 -56
- package/dist/locus-info/index.js.map +1 -1
- package/dist/media/properties.js +3 -5
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/index.js +351 -52
- package/dist/meeting/index.js.map +1 -1
- package/dist/meetings/index.js +25 -0
- package/dist/meetings/index.js.map +1 -1
- package/dist/metrics/constants.js +3 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +51 -3
- package/dist/types/locus-info/index.d.ts +19 -4
- package/dist/types/media/properties.d.ts +5 -2
- package/dist/types/meeting/index.d.ts +63 -1
- package/dist/types/meetings/index.d.ts +8 -0
- package/dist/types/metrics/constants.d.ts +2 -0
- package/dist/webinar/index.js +4 -4
- package/dist/webinar/index.js.map +1 -1
- package/package.json +23 -23
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +79 -1
- package/src/constants.ts +1 -0
- package/src/hashTree/hashTreeParser.ts +254 -18
- package/src/locus-info/index.ts +143 -51
- package/src/media/properties.ts +7 -3
- package/src/meeting/index.ts +329 -25
- package/src/meetings/index.ts +35 -1
- package/src/metrics/constants.ts +2 -0
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +2 -2
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +142 -2
- package/test/unit/spec/hashTree/hashTreeParser.ts +556 -3
- package/test/unit/spec/locus-info/index.js +148 -5
- package/test/unit/spec/media/properties.ts +23 -23
- package/test/unit/spec/meeting/index.js +832 -126
- package/test/unit/spec/meetings/index.js +116 -12
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +3 -3
|
@@ -3,6 +3,7 @@ import sinon from 'sinon';
|
|
|
3
3
|
import {cloneDeep, forEach} from 'lodash';
|
|
4
4
|
import {assert} from '@webex/test-helper-chai';
|
|
5
5
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
6
|
+
import {webexTrackingIdSequenceNumbers} from '@webex/webex-core';
|
|
6
7
|
import testUtils from '../../../utils/testUtils';
|
|
7
8
|
import Meetings from '@webex/plugin-meetings';
|
|
8
9
|
import LocusInfo, {createLocusFromHashTreeMessage, findMeetingForHashTreeMessage} from '@webex/plugin-meetings/src/locus-info';
|
|
@@ -31,6 +32,7 @@ import {
|
|
|
31
32
|
|
|
32
33
|
import {self, selfWithInactivity} from './selfConstant';
|
|
33
34
|
import {MEETING_REMOVED_REASON} from '@webex/plugin-meetings/src/constants';
|
|
35
|
+
import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
|
|
34
36
|
import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
|
|
35
37
|
|
|
36
38
|
describe('plugin-meetings', () => {
|
|
@@ -56,7 +58,7 @@ describe('plugin-meetings', () => {
|
|
|
56
58
|
|
|
57
59
|
beforeEach(() => {
|
|
58
60
|
mockMeeting = {};
|
|
59
|
-
locusInfo = new LocusInfo(updateMeeting, webex, meetingId);
|
|
61
|
+
locusInfo = new LocusInfo({updateMeeting}, webex, meetingId);
|
|
60
62
|
|
|
61
63
|
locusInfo.init(locus);
|
|
62
64
|
|
|
@@ -148,7 +150,9 @@ describe('plugin-meetings', () => {
|
|
|
148
150
|
visibleDataSets,
|
|
149
151
|
},
|
|
150
152
|
webexRequest: sinon.match.func,
|
|
151
|
-
|
|
153
|
+
callbacks: sinon.match({
|
|
154
|
+
locusInfoUpdateCallback: sinon.match.func,
|
|
155
|
+
}),
|
|
152
156
|
debugId: sinon.match.string,
|
|
153
157
|
})
|
|
154
158
|
);
|
|
@@ -158,6 +162,39 @@ describe('plugin-meetings', () => {
|
|
|
158
162
|
assert.isTrue(locusInfo.emitChange);
|
|
159
163
|
});
|
|
160
164
|
|
|
165
|
+
it('passes a generateTrackingId callback that reuses the tracking-id interceptor sequence', async () => {
|
|
166
|
+
webex.sessionId = 'test-session';
|
|
167
|
+
const hashTreeMessage = createHashTreeMessage(['dataset1']);
|
|
168
|
+
|
|
169
|
+
await locusInfo.initialSetup({trigger: 'locus-message', hashTreeMessage});
|
|
170
|
+
|
|
171
|
+
const {generateTrackingId} = HashTreeParserStub.firstCall.args[0].callbacks;
|
|
172
|
+
|
|
173
|
+
// The interceptor for this webex is present in the exposed map -> reuse its sequence.
|
|
174
|
+
const fakeInterceptor = {webex, sequence: 7};
|
|
175
|
+
webexTrackingIdSequenceNumbers.set(fakeInterceptor, 0);
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
assert.equal(generateTrackingId(), 'test-session_7');
|
|
179
|
+
} finally {
|
|
180
|
+
webexTrackingIdSequenceNumbers.delete(fakeInterceptor);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it('passes a generateTrackingId callback that falls back to a uuid when no interceptor is registered', async () => {
|
|
185
|
+
webex.sessionId = 'test-session';
|
|
186
|
+
const hashTreeMessage = createHashTreeMessage(['dataset1']);
|
|
187
|
+
|
|
188
|
+
await locusInfo.initialSetup({trigger: 'locus-message', hashTreeMessage});
|
|
189
|
+
|
|
190
|
+
const {generateTrackingId} = HashTreeParserStub.firstCall.args[0].callbacks;
|
|
191
|
+
|
|
192
|
+
assert.match(
|
|
193
|
+
generateTrackingId(),
|
|
194
|
+
/^test-session_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/
|
|
195
|
+
);
|
|
196
|
+
});
|
|
197
|
+
|
|
161
198
|
it('should not initialize the hash tree when triggered from a non-hash tree locus message', async () => {
|
|
162
199
|
const locus = {url: 'http://locus-url.com', participants: []};
|
|
163
200
|
|
|
@@ -198,7 +235,9 @@ describe('plugin-meetings', () => {
|
|
|
198
235
|
},
|
|
199
236
|
metadata,
|
|
200
237
|
webexRequest: sinon.match.func,
|
|
201
|
-
|
|
238
|
+
callbacks: sinon.match({
|
|
239
|
+
locusInfoUpdateCallback: sinon.match.func,
|
|
240
|
+
}),
|
|
202
241
|
debugId: sinon.match.string,
|
|
203
242
|
})
|
|
204
243
|
);
|
|
@@ -279,7 +318,9 @@ describe('plugin-meetings', () => {
|
|
|
279
318
|
dataSets: [],
|
|
280
319
|
},
|
|
281
320
|
webexRequest: sinon.match.func,
|
|
282
|
-
|
|
321
|
+
callbacks: sinon.match({
|
|
322
|
+
locusInfoUpdateCallback: sinon.match.func,
|
|
323
|
+
}),
|
|
283
324
|
debugId: sinon.match.string,
|
|
284
325
|
metadata: null,
|
|
285
326
|
})
|
|
@@ -355,7 +396,7 @@ describe('plugin-meetings', () => {
|
|
|
355
396
|
},
|
|
356
397
|
});
|
|
357
398
|
|
|
358
|
-
locusInfoUpdateCallback = HashTreeParserStub.firstCall.args[0].locusInfoUpdateCallback;
|
|
399
|
+
locusInfoUpdateCallback = HashTreeParserStub.firstCall.args[0].callbacks.locusInfoUpdateCallback;
|
|
359
400
|
|
|
360
401
|
assert.isDefined(locusInfoUpdateCallback);
|
|
361
402
|
|
|
@@ -4887,6 +4928,11 @@ describe('plugin-meetings', () => {
|
|
|
4887
4928
|
options: {
|
|
4888
4929
|
meetingId: locusInfo.meetingId,
|
|
4889
4930
|
},
|
|
4931
|
+
payload: {
|
|
4932
|
+
eventData: {
|
|
4933
|
+
joinInProgress: false,
|
|
4934
|
+
},
|
|
4935
|
+
},
|
|
4890
4936
|
});
|
|
4891
4937
|
});
|
|
4892
4938
|
|
|
@@ -4907,6 +4953,11 @@ describe('plugin-meetings', () => {
|
|
|
4907
4953
|
options: {
|
|
4908
4954
|
meetingId: locusInfo.meetingId,
|
|
4909
4955
|
},
|
|
4956
|
+
payload: {
|
|
4957
|
+
eventData: {
|
|
4958
|
+
joinInProgress: false,
|
|
4959
|
+
},
|
|
4960
|
+
},
|
|
4910
4961
|
});
|
|
4911
4962
|
});
|
|
4912
4963
|
|
|
@@ -4928,6 +4979,11 @@ describe('plugin-meetings', () => {
|
|
|
4928
4979
|
options: {
|
|
4929
4980
|
meetingId: locusInfo.meetingId,
|
|
4930
4981
|
},
|
|
4982
|
+
payload: {
|
|
4983
|
+
eventData: {
|
|
4984
|
+
joinInProgress: false,
|
|
4985
|
+
},
|
|
4986
|
+
},
|
|
4931
4987
|
});
|
|
4932
4988
|
});
|
|
4933
4989
|
});
|
|
@@ -5000,6 +5056,93 @@ describe('plugin-meetings', () => {
|
|
|
5000
5056
|
}
|
|
5001
5057
|
);
|
|
5002
5058
|
});
|
|
5059
|
+
|
|
5060
|
+
describe('destroyMeetingSuspended', () => {
|
|
5061
|
+
it('suppresses DESTROY_MEETING for SELF_REMOVED when suspended', () => {
|
|
5062
|
+
locusInfo.emitScoped = sinon.stub();
|
|
5063
|
+
locusInfo.suspendDestroyMeeting(true);
|
|
5064
|
+
locusInfo.parsedLocus = {
|
|
5065
|
+
fullState: {
|
|
5066
|
+
type: _MEETING_,
|
|
5067
|
+
},
|
|
5068
|
+
self: {
|
|
5069
|
+
removed: true,
|
|
5070
|
+
}
|
|
5071
|
+
};
|
|
5072
|
+
|
|
5073
|
+
locusInfo.isMeetingActive();
|
|
5074
|
+
|
|
5075
|
+
assert.notCalled(locusInfo.emitScoped);
|
|
5076
|
+
assert.calledOnceWithExactly(
|
|
5077
|
+
sendBehavioralMetricStub,
|
|
5078
|
+
BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED,
|
|
5079
|
+
{
|
|
5080
|
+
meetingId: locusInfo.meetingId,
|
|
5081
|
+
reason: 'SELF_REMOVED',
|
|
5082
|
+
}
|
|
5083
|
+
);
|
|
5084
|
+
});
|
|
5085
|
+
|
|
5086
|
+
it('suppresses DESTROY_MEETING for MEETING_INACTIVE_TERMINATING when suspended', () => {
|
|
5087
|
+
locusInfo.emitScoped = sinon.stub();
|
|
5088
|
+
locusInfo.suspendDestroyMeeting(true);
|
|
5089
|
+
locusInfo.parsedLocus = {
|
|
5090
|
+
fullState: {
|
|
5091
|
+
type: _MEETING_,
|
|
5092
|
+
},
|
|
5093
|
+
};
|
|
5094
|
+
locusInfo.fullState = {
|
|
5095
|
+
state: LOCUS.STATE.INACTIVE,
|
|
5096
|
+
};
|
|
5097
|
+
|
|
5098
|
+
locusInfo.isMeetingActive();
|
|
5099
|
+
|
|
5100
|
+
assert.notCalled(locusInfo.emitScoped);
|
|
5101
|
+
assert.notCalled(webex.internal.newMetrics.submitClientEvent);
|
|
5102
|
+
assert.calledOnceWithExactly(
|
|
5103
|
+
sendBehavioralMetricStub,
|
|
5104
|
+
BEHAVIORAL_METRICS.DESTROY_MEETING_WHILE_SUSPENDED,
|
|
5105
|
+
{
|
|
5106
|
+
meetingId: locusInfo.meetingId,
|
|
5107
|
+
reason: 'MEETING_INACTIVE_TERMINATING',
|
|
5108
|
+
}
|
|
5109
|
+
);
|
|
5110
|
+
});
|
|
5111
|
+
|
|
5112
|
+
[
|
|
5113
|
+
{reason: 'CALL_INACTIVE', setup: () => {
|
|
5114
|
+
locusInfo.parsedLocus = {fullState: {type: _CALL_}};
|
|
5115
|
+
locusInfo.fullState = {state: LOCUS.STATE.INACTIVE};
|
|
5116
|
+
}},
|
|
5117
|
+
{reason: 'PARTNER_LEFT', setup: () => {
|
|
5118
|
+
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
|
|
5119
|
+
locusInfo.parsedLocus = {fullState: {type: _CALL_}, self: {state: MEETING_STATE.STATES.JOINED}};
|
|
5120
|
+
}},
|
|
5121
|
+
{reason: 'SELF_LEFT', setup: () => {
|
|
5122
|
+
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
|
|
5123
|
+
locusInfo.parsedLocus = {fullState: {type: _CALL_}, self: {state: MEETING_STATE.STATES.LEFT}};
|
|
5124
|
+
}},
|
|
5125
|
+
].forEach(({reason, setup}) => {
|
|
5126
|
+
it(`sends joinInProgress=true in client event for ${reason} when suspended`, () => {
|
|
5127
|
+
locusInfo.suspendDestroyMeeting(true);
|
|
5128
|
+
setup();
|
|
5129
|
+
|
|
5130
|
+
locusInfo.isMeetingActive();
|
|
5131
|
+
|
|
5132
|
+
assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
|
|
5133
|
+
name: 'client.call.remote-ended',
|
|
5134
|
+
options: {
|
|
5135
|
+
meetingId: locusInfo.meetingId,
|
|
5136
|
+
},
|
|
5137
|
+
payload: {
|
|
5138
|
+
eventData: {
|
|
5139
|
+
joinInProgress: true,
|
|
5140
|
+
},
|
|
5141
|
+
},
|
|
5142
|
+
});
|
|
5143
|
+
});
|
|
5144
|
+
});
|
|
5145
|
+
});
|
|
5003
5146
|
});
|
|
5004
5147
|
|
|
5005
5148
|
describe('#updateLocusUrl', () => {
|
|
@@ -419,13 +419,13 @@ describe('MediaProperties', () => {
|
|
|
419
419
|
it('should send a behavioral metric with correct parameters', () => {
|
|
420
420
|
const issueType = 'audio';
|
|
421
421
|
const issueSubType = 'packet-loss';
|
|
422
|
-
const
|
|
422
|
+
const metadata = {correlationId: 'test-correlation-id-123', isMultistream: false};
|
|
423
423
|
|
|
424
|
-
mediaProperties.sendMediaIssueMetric(issueType, issueSubType,
|
|
424
|
+
mediaProperties.sendMediaIssueMetric(issueType, issueSubType, metadata);
|
|
425
425
|
|
|
426
426
|
assert.calledOnce(sendBehavioralMetricStub);
|
|
427
427
|
assert.calledWith(sendBehavioralMetricStub, BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED, {
|
|
428
|
-
|
|
428
|
+
...metadata,
|
|
429
429
|
'audio_packet-loss': 1,
|
|
430
430
|
});
|
|
431
431
|
});
|
|
@@ -433,17 +433,17 @@ describe('MediaProperties', () => {
|
|
|
433
433
|
it('should increment count while being throttled and reset it once metric goes out', () => {
|
|
434
434
|
const issueType = 'video';
|
|
435
435
|
const issueSubType = 'freeze';
|
|
436
|
-
const
|
|
436
|
+
const metadata = {correlationId: 'test-correlation-id', isMultistream: true};
|
|
437
437
|
|
|
438
438
|
// Call multiple times with same issue type/subtype
|
|
439
|
-
mediaProperties.sendMediaIssueMetric(issueType, issueSubType,
|
|
440
|
-
mediaProperties.sendMediaIssueMetric(issueType, issueSubType,
|
|
441
|
-
mediaProperties.sendMediaIssueMetric(issueType, issueSubType,
|
|
439
|
+
mediaProperties.sendMediaIssueMetric(issueType, issueSubType, metadata);
|
|
440
|
+
mediaProperties.sendMediaIssueMetric(issueType, issueSubType, metadata);
|
|
441
|
+
mediaProperties.sendMediaIssueMetric(issueType, issueSubType, metadata);
|
|
442
442
|
|
|
443
443
|
// First call should go through immediately, subsequent calls are throttled
|
|
444
444
|
assert.calledOnce(sendBehavioralMetricStub);
|
|
445
445
|
assert.calledWith(sendBehavioralMetricStub, BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED, {
|
|
446
|
-
|
|
446
|
+
...metadata,
|
|
447
447
|
video_freeze: 1, // Only the first call goes through due to throttling
|
|
448
448
|
});
|
|
449
449
|
sendBehavioralMetricStub.resetHistory();
|
|
@@ -456,29 +456,29 @@ describe('MediaProperties', () => {
|
|
|
456
456
|
sendBehavioralMetricStub,
|
|
457
457
|
BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED,
|
|
458
458
|
{
|
|
459
|
-
|
|
459
|
+
...metadata,
|
|
460
460
|
video_freeze: 2,
|
|
461
461
|
}
|
|
462
462
|
);
|
|
463
463
|
});
|
|
464
464
|
|
|
465
465
|
it('should track different issue types separately in counters', () => {
|
|
466
|
-
const
|
|
466
|
+
const metadata = {correlationId: 'test-correlation-id', isMultistream: false};
|
|
467
467
|
|
|
468
468
|
// Send different issue types
|
|
469
|
-
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss',
|
|
470
|
-
mediaProperties.sendMediaIssueMetric('video', 'freeze',
|
|
471
|
-
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss',
|
|
472
|
-
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss',
|
|
473
|
-
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss',
|
|
474
|
-
mediaProperties.sendMediaIssueMetric('video', 'freeze',
|
|
469
|
+
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss', metadata);
|
|
470
|
+
mediaProperties.sendMediaIssueMetric('video', 'freeze', metadata);
|
|
471
|
+
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss', metadata);
|
|
472
|
+
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss', metadata);
|
|
473
|
+
mediaProperties.sendMediaIssueMetric('audio', 'packet-loss', metadata);
|
|
474
|
+
mediaProperties.sendMediaIssueMetric('video', 'freeze', metadata);
|
|
475
475
|
|
|
476
476
|
// First call should go through immediately, subsequent calls are throttled
|
|
477
477
|
assert.calledOnceWithExactly(
|
|
478
478
|
sendBehavioralMetricStub,
|
|
479
479
|
BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED,
|
|
480
480
|
{
|
|
481
|
-
|
|
481
|
+
...metadata,
|
|
482
482
|
'audio_packet-loss': 1,
|
|
483
483
|
}
|
|
484
484
|
);
|
|
@@ -495,7 +495,7 @@ describe('MediaProperties', () => {
|
|
|
495
495
|
sendBehavioralMetricStub,
|
|
496
496
|
BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED,
|
|
497
497
|
{
|
|
498
|
-
|
|
498
|
+
...metadata,
|
|
499
499
|
video_freeze: 2,
|
|
500
500
|
'audio_packet-loss': 3,
|
|
501
501
|
}
|
|
@@ -505,18 +505,18 @@ describe('MediaProperties', () => {
|
|
|
505
505
|
it('should flush throttled metrics when unsetPeerConnection is called', () => {
|
|
506
506
|
const issueType = 'share';
|
|
507
507
|
const issueSubType = 'connection-lost';
|
|
508
|
-
const
|
|
508
|
+
const metadata = {correlationId: 'test-correlation-id', isMultistream: true};
|
|
509
509
|
|
|
510
510
|
// Send metrics multiple times
|
|
511
|
-
mediaProperties.sendMediaIssueMetric(issueType, issueSubType,
|
|
512
|
-
mediaProperties.sendMediaIssueMetric(issueType, issueSubType,
|
|
511
|
+
mediaProperties.sendMediaIssueMetric(issueType, issueSubType, metadata);
|
|
512
|
+
mediaProperties.sendMediaIssueMetric(issueType, issueSubType, metadata);
|
|
513
513
|
|
|
514
514
|
// First call should go through immediately
|
|
515
515
|
assert.calledOnceWithExactly(
|
|
516
516
|
sendBehavioralMetricStub,
|
|
517
517
|
BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED,
|
|
518
518
|
{
|
|
519
|
-
|
|
519
|
+
...metadata,
|
|
520
520
|
'share_connection-lost': 1,
|
|
521
521
|
}
|
|
522
522
|
);
|
|
@@ -529,7 +529,7 @@ describe('MediaProperties', () => {
|
|
|
529
529
|
sendBehavioralMetricStub,
|
|
530
530
|
BEHAVIORAL_METRICS.MEDIA_ISSUE_DETECTED,
|
|
531
531
|
{
|
|
532
|
-
|
|
532
|
+
...metadata,
|
|
533
533
|
'share_connection-lost': 1,
|
|
534
534
|
}
|
|
535
535
|
);
|