@webex/plugin-meetings 3.12.0-webex-services-ready.3 → 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
|
@@ -892,7 +892,10 @@ describe('plugin-meetings', () => {
|
|
|
892
892
|
});
|
|
893
893
|
|
|
894
894
|
it('should transfer host using the current locus when the target member is in the current session', async () => {
|
|
895
|
-
sinon
|
|
895
|
+
sinon
|
|
896
|
+
.stub(meeting.members.membersCollection, 'get')
|
|
897
|
+
.withArgs(uuid2)
|
|
898
|
+
.returns({isInMeeting: true});
|
|
896
899
|
meeting.members.transferHostToMember = sinon.stub().resolves(test1);
|
|
897
900
|
|
|
898
901
|
await meeting.transfer(uuid2, false);
|
|
@@ -901,7 +904,10 @@ describe('plugin-meetings', () => {
|
|
|
901
904
|
});
|
|
902
905
|
|
|
903
906
|
it('should transfer host using breakout locus when the target member is joined in a breakout session', async () => {
|
|
904
|
-
sinon
|
|
907
|
+
sinon
|
|
908
|
+
.stub(meeting.members.membersCollection, 'get')
|
|
909
|
+
.withArgs(uuid2)
|
|
910
|
+
.returns({isInMeeting: false});
|
|
905
911
|
meeting.members.transferHostToMember = sinon.stub().resolves(test1);
|
|
906
912
|
meeting.breakouts.breakouts = {
|
|
907
913
|
models: [
|
|
@@ -927,7 +933,10 @@ describe('plugin-meetings', () => {
|
|
|
927
933
|
});
|
|
928
934
|
|
|
929
935
|
it('should not use breakout locus when the breakout member is not in meeting', async () => {
|
|
930
|
-
sinon
|
|
936
|
+
sinon
|
|
937
|
+
.stub(meeting.members.membersCollection, 'get')
|
|
938
|
+
.withArgs(uuid2)
|
|
939
|
+
.returns({isInMeeting: false});
|
|
931
940
|
meeting.members.transferHostToMember = sinon.stub().resolves(test1);
|
|
932
941
|
meeting.breakouts.breakouts = {
|
|
933
942
|
models: [
|
|
@@ -944,7 +953,12 @@ describe('plugin-meetings', () => {
|
|
|
944
953
|
|
|
945
954
|
await meeting.transfer(uuid2, false);
|
|
946
955
|
|
|
947
|
-
assert.calledOnceWithExactly(
|
|
956
|
+
assert.calledOnceWithExactly(
|
|
957
|
+
meeting.members.transferHostToMember,
|
|
958
|
+
uuid2,
|
|
959
|
+
false,
|
|
960
|
+
undefined
|
|
961
|
+
);
|
|
948
962
|
});
|
|
949
963
|
});
|
|
950
964
|
describe('#getMembers', () => {
|
|
@@ -976,6 +990,8 @@ describe('plugin-meetings', () => {
|
|
|
976
990
|
let addMediaInternalStub;
|
|
977
991
|
let supportsRTCPeerConnectionStub;
|
|
978
992
|
|
|
993
|
+
let suspendDestroyMeetingStub;
|
|
994
|
+
|
|
979
995
|
beforeEach(() => {
|
|
980
996
|
supportsRTCPeerConnectionStub = sinon
|
|
981
997
|
.stub(WebCapabilities, 'supportsRTCPeerConnection')
|
|
@@ -996,6 +1012,7 @@ describe('plugin-meetings', () => {
|
|
|
996
1012
|
.stub(meeting.roap, 'handleTurnDiscoveryHttpResponse')
|
|
997
1013
|
.resolves({turnServerInfo: fakeTurnServerInfo, turnDiscoverySkippedReason: undefined});
|
|
998
1014
|
abortTurnDiscoveryStub = sinon.stub(meeting.roap, 'abortTurnDiscovery');
|
|
1015
|
+
suspendDestroyMeetingStub = sinon.stub(meeting.locusInfo, 'suspendDestroyMeeting');
|
|
999
1016
|
});
|
|
1000
1017
|
|
|
1001
1018
|
it('should work as expected', async () => {
|
|
@@ -1031,6 +1048,11 @@ describe('plugin-meetings', () => {
|
|
|
1031
1048
|
retryCount: 0,
|
|
1032
1049
|
prevJoinResponse: undefined,
|
|
1033
1050
|
});
|
|
1051
|
+
|
|
1052
|
+
// suspendDestroyMeeting should be called with true at start and false on success
|
|
1053
|
+
assert.calledTwice(suspendDestroyMeetingStub);
|
|
1054
|
+
assert.calledWith(suspendDestroyMeetingStub.firstCall, true);
|
|
1055
|
+
assert.calledWith(suspendDestroyMeetingStub.secondCall, false);
|
|
1034
1056
|
});
|
|
1035
1057
|
|
|
1036
1058
|
it("should not call handleTurnDiscoveryHttpResponse if we don't send a TURN discovery request with join", async () => {
|
|
@@ -1150,6 +1172,13 @@ describe('plugin-meetings', () => {
|
|
|
1150
1172
|
firstError: undefined,
|
|
1151
1173
|
prevError: undefined,
|
|
1152
1174
|
});
|
|
1175
|
+
|
|
1176
|
+
// suspendDestroyMeeting(true) called at start of each attempt, (false) only on final failure
|
|
1177
|
+
// 1st attempt: suspendDestroyMeeting(true), 2nd attempt (retry): suspendDestroyMeeting(true), final failure: suspendDestroyMeeting(false)
|
|
1178
|
+
assert.calledThrice(suspendDestroyMeetingStub);
|
|
1179
|
+
assert.calledWith(suspendDestroyMeetingStub.firstCall, true);
|
|
1180
|
+
assert.calledWith(suspendDestroyMeetingStub.secondCall, true);
|
|
1181
|
+
assert.calledWith(suspendDestroyMeetingStub.thirdCall, false);
|
|
1153
1182
|
});
|
|
1154
1183
|
|
|
1155
1184
|
it('should re-join on retry when join() fails on first attempt, and throw the first error if join fails again', async () => {
|
|
@@ -1717,15 +1746,13 @@ describe('plugin-meetings', () => {
|
|
|
1717
1746
|
const icePhaseCallbacks = [];
|
|
1718
1747
|
const addMediaInternalResults = [];
|
|
1719
1748
|
|
|
1720
|
-
meeting.addMediaInternal = sinon
|
|
1721
|
-
|
|
1722
|
-
.callsFake((icePhaseCallback) => {
|
|
1723
|
-
const defer = new Defer();
|
|
1749
|
+
meeting.addMediaInternal = sinon.stub().callsFake((icePhaseCallback) => {
|
|
1750
|
+
const defer = new Defer();
|
|
1724
1751
|
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1752
|
+
icePhaseCallbacks.push(icePhaseCallback);
|
|
1753
|
+
addMediaInternalResults.push(defer);
|
|
1754
|
+
return defer.promise;
|
|
1755
|
+
});
|
|
1729
1756
|
|
|
1730
1757
|
const leaveStub = sinon.stub(meeting, 'leave').resolves();
|
|
1731
1758
|
|
|
@@ -1946,7 +1973,9 @@ describe('plugin-meetings', () => {
|
|
|
1946
1973
|
meeting.isMultistream = true;
|
|
1947
1974
|
const dtlsError = new AddMediaFailed({iceConnected: true, connectionType: 'UDP'});
|
|
1948
1975
|
|
|
1949
|
-
webex.meetings.reachability.isAnyClusterReachableViaProtocol = sinon
|
|
1976
|
+
webex.meetings.reachability.isAnyClusterReachableViaProtocol = sinon
|
|
1977
|
+
.stub()
|
|
1978
|
+
.resolves(true);
|
|
1950
1979
|
|
|
1951
1980
|
addMediaInternalStub.onFirstCall().rejects(dtlsError);
|
|
1952
1981
|
addMediaInternalStub.onSecondCall().resolves(test4);
|
|
@@ -2000,7 +2029,9 @@ describe('plugin-meetings', () => {
|
|
|
2000
2029
|
meeting.isMultistream = isMultistream;
|
|
2001
2030
|
return Promise.resolve(fakeJoinResult);
|
|
2002
2031
|
});
|
|
2003
|
-
webex.meetings.reachability.isAnyClusterReachableViaProtocol = sinon
|
|
2032
|
+
webex.meetings.reachability.isAnyClusterReachableViaProtocol = sinon
|
|
2033
|
+
.stub()
|
|
2034
|
+
.resolves(tlsReachable);
|
|
2004
2035
|
|
|
2005
2036
|
addMediaInternalStub.onFirstCall().rejects(prevError);
|
|
2006
2037
|
addMediaInternalStub.onSecondCall().resolves(test4);
|
|
@@ -2043,9 +2074,97 @@ describe('plugin-meetings', () => {
|
|
|
2043
2074
|
Errors.WebrtcApiNotAvailableError
|
|
2044
2075
|
);
|
|
2045
2076
|
|
|
2077
|
+
assert.notCalled(suspendDestroyMeetingStub);
|
|
2046
2078
|
assert.notCalled(meeting.join);
|
|
2047
2079
|
assert.notCalled(meeting.addMediaInternal);
|
|
2048
2080
|
});
|
|
2081
|
+
|
|
2082
|
+
[
|
|
2083
|
+
{description: '409 error from join()', statusCode: 409, useCause: false},
|
|
2084
|
+
{description: '403 error from join()', statusCode: 403, useCause: false},
|
|
2085
|
+
{
|
|
2086
|
+
description: '409 error in cause (e.g. AddMediaFailed)',
|
|
2087
|
+
statusCode: 409,
|
|
2088
|
+
useCause: true,
|
|
2089
|
+
},
|
|
2090
|
+
{
|
|
2091
|
+
description: '403 error in cause (e.g. AddMediaFailed)',
|
|
2092
|
+
statusCode: 403,
|
|
2093
|
+
useCause: true,
|
|
2094
|
+
},
|
|
2095
|
+
].forEach(({description, statusCode, useCause}) => {
|
|
2096
|
+
it(`should re-join on retry when ${description}`, async () => {
|
|
2097
|
+
const error = useCause
|
|
2098
|
+
? Object.assign(new Error('wrapped error'), {cause: {statusCode}})
|
|
2099
|
+
: Object.assign(new Error('locus error'), {statusCode});
|
|
2100
|
+
|
|
2101
|
+
meeting.addMediaInternal = sinon
|
|
2102
|
+
.stub()
|
|
2103
|
+
.onFirstCall()
|
|
2104
|
+
.rejects(error)
|
|
2105
|
+
.onSecondCall()
|
|
2106
|
+
.resolves(test4);
|
|
2107
|
+
|
|
2108
|
+
const result = await meeting.joinWithMedia({joinOptions, mediaOptions});
|
|
2109
|
+
|
|
2110
|
+
assert.deepEqual(result, {
|
|
2111
|
+
join: fakeJoinResult,
|
|
2112
|
+
media: test4,
|
|
2113
|
+
multistreamEnabled: true,
|
|
2114
|
+
});
|
|
2115
|
+
|
|
2116
|
+
// join() should be called twice — once for the first attempt, once for the re-join
|
|
2117
|
+
assert.calledTwice(meeting.join);
|
|
2118
|
+
assert.calledTwice(generateTurnDiscoveryRequestMessageStub);
|
|
2119
|
+
});
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2122
|
+
it('should allow up to JOIN_WITH_MEDIA_RETRY_MAX_COUNT retries for 409 errors', async () => {
|
|
2123
|
+
const error409 = Object.assign(new Error('locus dropped us'), {statusCode: 409});
|
|
2124
|
+
|
|
2125
|
+
meeting.addMediaInternal = sinon.stub().rejects(error409);
|
|
2126
|
+
meeting.join = sinon.stub().callsFake(() => Promise.resolve(fakeJoinResult));
|
|
2127
|
+
sinon.stub(meeting, 'leave').resolves();
|
|
2128
|
+
|
|
2129
|
+
await assert.isRejected(meeting.joinWithMedia({joinOptions, mediaOptions}));
|
|
2130
|
+
|
|
2131
|
+
// JOIN_WITH_MEDIA_RETRY_MAX_COUNT is 2, so we expect 3 attempts total (initial + 2 retries)
|
|
2132
|
+
assert.callCount(meeting.join, 3);
|
|
2133
|
+
assert.callCount(meeting.addMediaInternal, 3);
|
|
2134
|
+
});
|
|
2135
|
+
|
|
2136
|
+
it('should not retry on 1-1 calls', async () => {
|
|
2137
|
+
const addMediaError = new Error('addMedia error');
|
|
2138
|
+
|
|
2139
|
+
sinon.stub(MeetingsUtil, 'isOneOnOneCall').returns(true);
|
|
2140
|
+
|
|
2141
|
+
meeting.addMediaInternal = sinon.stub().rejects(addMediaError);
|
|
2142
|
+
sinon.stub(meeting, 'leave').resolves();
|
|
2143
|
+
|
|
2144
|
+
await assert.isRejected(
|
|
2145
|
+
meeting.joinWithMedia({joinOptions, mediaOptions}),
|
|
2146
|
+
addMediaError
|
|
2147
|
+
);
|
|
2148
|
+
|
|
2149
|
+
// should not retry - only 1 attempt
|
|
2150
|
+
assert.calledOnce(meeting.join);
|
|
2151
|
+
assert.calledOnce(meeting.addMediaInternal);
|
|
2152
|
+
assert.calledOnceWithExactly(
|
|
2153
|
+
Metrics.sendBehavioralMetric,
|
|
2154
|
+
BEHAVIORAL_METRICS.JOIN_WITH_MEDIA_FAILURE,
|
|
2155
|
+
{
|
|
2156
|
+
correlation_id: meeting.correlationId,
|
|
2157
|
+
locus_id: meeting.locusUrl.split('/').pop(),
|
|
2158
|
+
reason: addMediaError.message,
|
|
2159
|
+
stack: addMediaError.stack,
|
|
2160
|
+
leaveErrorReason: undefined,
|
|
2161
|
+
isRetry: false,
|
|
2162
|
+
},
|
|
2163
|
+
{
|
|
2164
|
+
type: addMediaError.name,
|
|
2165
|
+
}
|
|
2166
|
+
);
|
|
2167
|
+
});
|
|
2049
2168
|
});
|
|
2050
2169
|
describe('#isTranscriptionSupported', () => {
|
|
2051
2170
|
it('should return false if the feature is not supported for the meeting', () => {
|
|
@@ -2621,7 +2740,8 @@ describe('plugin-meetings', () => {
|
|
|
2621
2740
|
|
|
2622
2741
|
[
|
|
2623
2742
|
{
|
|
2624
|
-
title:
|
|
2743
|
+
title:
|
|
2744
|
+
'should skip a reaction when the default relay route does not match the LLM binding',
|
|
2625
2745
|
isPracticeSessionConnected: false,
|
|
2626
2746
|
route: 'wrong-default-route',
|
|
2627
2747
|
defaultBinding: 'default-route',
|
|
@@ -2730,7 +2850,7 @@ describe('plugin-meetings', () => {
|
|
|
2730
2850
|
describe('#handleLLMOnline', () => {
|
|
2731
2851
|
beforeEach(() => {
|
|
2732
2852
|
webex.internal.llm.off = sinon.stub();
|
|
2733
|
-
webex.internal.voicea.
|
|
2853
|
+
webex.internal.voicea.getKeepTranscriptionSubscribed = sinon.stub().returns(false);
|
|
2734
2854
|
webex.internal.voicea.updateSubchannelSubscriptions = sinon.stub();
|
|
2735
2855
|
});
|
|
2736
2856
|
|
|
@@ -2748,7 +2868,7 @@ describe('plugin-meetings', () => {
|
|
|
2748
2868
|
});
|
|
2749
2869
|
|
|
2750
2870
|
it('restores transcription subscription when caption intent is enabled', () => {
|
|
2751
|
-
webex.internal.voicea.
|
|
2871
|
+
webex.internal.voicea.getKeepTranscriptionSubscribed.returns(true);
|
|
2752
2872
|
|
|
2753
2873
|
meeting.handleLLMOnline();
|
|
2754
2874
|
|
|
@@ -2758,7 +2878,7 @@ describe('plugin-meetings', () => {
|
|
|
2758
2878
|
});
|
|
2759
2879
|
|
|
2760
2880
|
it('does not restore transcription subscription when caption intent is disabled', () => {
|
|
2761
|
-
webex.internal.voicea.
|
|
2881
|
+
webex.internal.voicea.getKeepTranscriptionSubscribed.returns(false);
|
|
2762
2882
|
|
|
2763
2883
|
meeting.handleLLMOnline();
|
|
2764
2884
|
|
|
@@ -3098,6 +3218,221 @@ describe('plugin-meetings', () => {
|
|
|
3098
3218
|
);
|
|
3099
3219
|
});
|
|
3100
3220
|
|
|
3221
|
+
it('emits breakout join response metric only once per breakoutMoveId', async () => {
|
|
3222
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3223
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3224
|
+
sinon.stub(meeting.webex.internal.llm, 'registerAndConnect').resolves({
|
|
3225
|
+
clientLLMDatachannelResponseTime: 10,
|
|
3226
|
+
clientLLMWebSocketConnectTime: 20,
|
|
3227
|
+
});
|
|
3228
|
+
|
|
3229
|
+
meeting.meetingInfo.enableConvergedArchitecture = true;
|
|
3230
|
+
meeting.breakouts.set('breakoutMoveId', 'move-id-1');
|
|
3231
|
+
meeting.breakouts.set('sessionType', 'BREAKOUT');
|
|
3232
|
+
meeting.breakouts.set('status', 'OPEN');
|
|
3233
|
+
meeting.breakouts.set('currentBreakoutSession', {
|
|
3234
|
+
sessionId: 'session-id-1',
|
|
3235
|
+
groupId: 'group-id-1',
|
|
3236
|
+
});
|
|
3237
|
+
|
|
3238
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3239
|
+
meeting.updateLLMConnection.restore();
|
|
3240
|
+
|
|
3241
|
+
await meeting.updateLLMConnection();
|
|
3242
|
+
await meeting.updateLLMConnection();
|
|
3243
|
+
|
|
3244
|
+
const joinResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3245
|
+
.getCalls()
|
|
3246
|
+
.filter((call) => call.args[0]?.name === 'client.breakout-session.join.response');
|
|
3247
|
+
|
|
3248
|
+
assert.lengthOf(joinResponseCalls, 1);
|
|
3249
|
+
assert.equal(joinResponseCalls[0].args[0].options.meetingId, meeting.id);
|
|
3250
|
+
});
|
|
3251
|
+
|
|
3252
|
+
it('does not emit breakout join response metric when breakout session is missing', async () => {
|
|
3253
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3254
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3255
|
+
sinon.stub(meeting.webex.internal.llm, 'registerAndConnect').resolves({
|
|
3256
|
+
clientLLMDatachannelResponseTime: 10,
|
|
3257
|
+
clientLLMWebSocketConnectTime: 20,
|
|
3258
|
+
});
|
|
3259
|
+
|
|
3260
|
+
meeting.meetingInfo.enableConvergedArchitecture = true;
|
|
3261
|
+
meeting.breakouts.set('breakoutMoveId', 'move-id-1');
|
|
3262
|
+
|
|
3263
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3264
|
+
meeting.updateLLMConnection.restore();
|
|
3265
|
+
|
|
3266
|
+
await meeting.updateLLMConnection();
|
|
3267
|
+
|
|
3268
|
+
const joinResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3269
|
+
.getCalls()
|
|
3270
|
+
.filter((call) => call.args[0]?.name === 'client.breakout-session.join.response');
|
|
3271
|
+
|
|
3272
|
+
assert.lengthOf(joinResponseCalls, 0);
|
|
3273
|
+
});
|
|
3274
|
+
|
|
3275
|
+
it('does not emit failed breakout join response metric when breakout session is missing', async () => {
|
|
3276
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3277
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3278
|
+
sinon
|
|
3279
|
+
.stub(meeting.webex.internal.llm, 'registerAndConnect')
|
|
3280
|
+
.rejects(new Error('failed to connect LLM'));
|
|
3281
|
+
|
|
3282
|
+
meeting.meetingInfo.enableConvergedArchitecture = true;
|
|
3283
|
+
meeting.breakouts.set('breakoutMoveId', 'move-id-1');
|
|
3284
|
+
|
|
3285
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3286
|
+
meeting.updateLLMConnection.restore();
|
|
3287
|
+
|
|
3288
|
+
try {
|
|
3289
|
+
await meeting.updateLLMConnection();
|
|
3290
|
+
assert.fail('Expected updateLLMConnection to reject');
|
|
3291
|
+
} catch (error) {
|
|
3292
|
+
assert.equal(error.message, 'failed to connect LLM');
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
const joinResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3296
|
+
.getCalls()
|
|
3297
|
+
.filter((call) => call.args[0]?.name === 'client.breakout-session.join.response');
|
|
3298
|
+
|
|
3299
|
+
assert.lengthOf(joinResponseCalls, 0);
|
|
3300
|
+
});
|
|
3301
|
+
|
|
3302
|
+
it('emits llm breakout join response metric after suppressing join response without llmLatency', async () => {
|
|
3303
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3304
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3305
|
+
sinon.stub(meeting.webex.internal.llm, 'registerAndConnect').resolves({
|
|
3306
|
+
clientLLMDatachannelResponseTime: 10,
|
|
3307
|
+
clientLLMWebSocketConnectTime: 20,
|
|
3308
|
+
});
|
|
3309
|
+
|
|
3310
|
+
meeting.config.enableAutomaticLLM = true;
|
|
3311
|
+
meeting.meetingInfo.enableConvergedArchitecture = true;
|
|
3312
|
+
meeting.breakouts.set('breakoutMoveId', 'move-id-1');
|
|
3313
|
+
meeting.breakouts.set('sessionType', 'BREAKOUT');
|
|
3314
|
+
meeting.breakouts.set('status', 'OPEN');
|
|
3315
|
+
meeting.breakouts.set('currentBreakoutSession', {
|
|
3316
|
+
sessionId: 'session-id-1',
|
|
3317
|
+
groupId: 'group-id-1',
|
|
3318
|
+
});
|
|
3319
|
+
|
|
3320
|
+
assert.isFalse(meeting.shouldEmitBreakoutJoinResponseMetric('move-id-1'));
|
|
3321
|
+
|
|
3322
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3323
|
+
meeting.updateLLMConnection.restore();
|
|
3324
|
+
|
|
3325
|
+
await meeting.updateLLMConnection();
|
|
3326
|
+
|
|
3327
|
+
const joinResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3328
|
+
.getCalls()
|
|
3329
|
+
.filter((call) => call.args[0]?.name === 'client.breakout-session.join.response');
|
|
3330
|
+
|
|
3331
|
+
assert.lengthOf(joinResponseCalls, 1);
|
|
3332
|
+
assert.deepEqual(joinResponseCalls[0].args[0].payload.llmLatency, {
|
|
3333
|
+
clientLLMDatachannelResponseTime: 10,
|
|
3334
|
+
clientLLMWebSocketConnectTime: 20,
|
|
3335
|
+
});
|
|
3336
|
+
});
|
|
3337
|
+
|
|
3338
|
+
it('emits breakout join response metric with llmLatency when returning to main session', async () => {
|
|
3339
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3340
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3341
|
+
sinon.stub(meeting.webex.internal.llm, 'registerAndConnect').resolves({
|
|
3342
|
+
clientLLMDatachannelResponseTime: 10,
|
|
3343
|
+
clientLLMWebSocketConnectTime: 20,
|
|
3344
|
+
});
|
|
3345
|
+
|
|
3346
|
+
meeting.meetingInfo.enableConvergedArchitecture = true;
|
|
3347
|
+
meeting.breakouts.set('breakoutMoveId', 'move-id-1');
|
|
3348
|
+
meeting.breakouts.set('sessionType', 'MAIN');
|
|
3349
|
+
meeting.breakouts.set('status', 'OPEN');
|
|
3350
|
+
meeting.breakouts.set('currentBreakoutSession', {
|
|
3351
|
+
sessionId: 'session-id-1',
|
|
3352
|
+
groupId: 'group-id-1',
|
|
3353
|
+
});
|
|
3354
|
+
|
|
3355
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3356
|
+
meeting.updateLLMConnection.restore();
|
|
3357
|
+
|
|
3358
|
+
await meeting.updateLLMConnection();
|
|
3359
|
+
|
|
3360
|
+
const joinResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3361
|
+
.getCalls()
|
|
3362
|
+
.filter((call) => call.args[0]?.name === 'client.breakout-session.join.response');
|
|
3363
|
+
|
|
3364
|
+
assert.lengthOf(joinResponseCalls, 1);
|
|
3365
|
+
assert.deepEqual(joinResponseCalls[0].args[0].payload.llmLatency, {
|
|
3366
|
+
clientLLMDatachannelResponseTime: 10,
|
|
3367
|
+
clientLLMWebSocketConnectTime: 20,
|
|
3368
|
+
});
|
|
3369
|
+
});
|
|
3370
|
+
|
|
3371
|
+
it('uses the partial datachannel timing from the error when the websocket connect fails', async () => {
|
|
3372
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3373
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3374
|
+
const connectError = new Error('failed to connect LLM');
|
|
3375
|
+
connectError.timing = {clientLLMDatachannelResponseTime: 42};
|
|
3376
|
+
sinon.stub(meeting.webex.internal.llm, 'registerAndConnect').rejects(connectError);
|
|
3377
|
+
|
|
3378
|
+
meeting.meetingInfo.enableConvergedArchitecture = true;
|
|
3379
|
+
meeting.breakouts.set('breakoutMoveId', 'move-id-1');
|
|
3380
|
+
meeting.breakouts.set('sessionType', 'BREAKOUT');
|
|
3381
|
+
meeting.breakouts.set('status', 'OPEN');
|
|
3382
|
+
meeting.breakouts.set('currentBreakoutSession', {
|
|
3383
|
+
sessionId: 'session-id-1',
|
|
3384
|
+
groupId: 'group-id-1',
|
|
3385
|
+
});
|
|
3386
|
+
|
|
3387
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3388
|
+
meeting.updateLLMConnection.restore();
|
|
3389
|
+
|
|
3390
|
+
try {
|
|
3391
|
+
await meeting.updateLLMConnection();
|
|
3392
|
+
assert.fail('Expected updateLLMConnection to reject');
|
|
3393
|
+
} catch (error) {
|
|
3394
|
+
assert.equal(error, connectError);
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3397
|
+
const joinResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3398
|
+
.getCalls()
|
|
3399
|
+
.filter((call) => call.args[0]?.name === 'client.breakout-session.join.response');
|
|
3400
|
+
|
|
3401
|
+
assert.lengthOf(joinResponseCalls, 1);
|
|
3402
|
+
assert.deepEqual(joinResponseCalls[0].args[0].payload.llmLatency, {
|
|
3403
|
+
clientLLMDatachannelResponseTime: 42,
|
|
3404
|
+
clientLLMWebSocketConnectTime: 0,
|
|
3405
|
+
});
|
|
3406
|
+
});
|
|
3407
|
+
|
|
3408
|
+
it('reports the partial datachannel timing on client.llm.connect.response when the websocket connect fails during initial join', async () => {
|
|
3409
|
+
sinon.stub(meeting, 'isJoined').returns(true);
|
|
3410
|
+
sinon.stub(meeting.webex.internal.llm, 'isConnected').returns(false);
|
|
3411
|
+
const connectError = new Error('failed to connect LLM');
|
|
3412
|
+
connectError.timing = {clientLLMDatachannelResponseTime: 42};
|
|
3413
|
+
sinon.stub(meeting.webex.internal.llm, 'registerAndConnect').rejects(connectError);
|
|
3414
|
+
|
|
3415
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
3416
|
+
meeting.updateLLMConnection.restore();
|
|
3417
|
+
|
|
3418
|
+
try {
|
|
3419
|
+
await meeting.updateLLMConnection({isInitialJoinPhase: true});
|
|
3420
|
+
assert.fail('Expected updateLLMConnection to reject');
|
|
3421
|
+
} catch (error) {
|
|
3422
|
+
assert.equal(error, connectError);
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
const connectResponseCalls = webex.internal.newMetrics.submitClientEvent
|
|
3426
|
+
.getCalls()
|
|
3427
|
+
.filter((call) => call.args[0]?.name === 'client.llm.connect.response');
|
|
3428
|
+
|
|
3429
|
+
assert.lengthOf(connectResponseCalls, 1);
|
|
3430
|
+
assert.deepEqual(connectResponseCalls[0].args[0].payload.llmLatency, {
|
|
3431
|
+
clientLLMDatachannelResponseTime: 42,
|
|
3432
|
+
clientLLMWebSocketConnectTime: 0,
|
|
3433
|
+
});
|
|
3434
|
+
});
|
|
3435
|
+
|
|
3101
3436
|
it('clears the LLM health check timer when disconnecting LLM', async () => {
|
|
3102
3437
|
const isJoinedStub = sinon.stub(meeting, 'isJoined');
|
|
3103
3438
|
sinon.stub(meeting.webex.internal.llm, 'isConnected');
|
|
@@ -3225,7 +3560,6 @@ describe('plugin-meetings', () => {
|
|
|
3225
3560
|
});
|
|
3226
3561
|
});
|
|
3227
3562
|
|
|
3228
|
-
|
|
3229
3563
|
describe('#addMedia', () => {
|
|
3230
3564
|
const muteStateStub = {
|
|
3231
3565
|
handleClientRequest: sinon.stub().returns(Promise.resolve(true)),
|
|
@@ -3940,6 +4274,7 @@ describe('plugin-meetings', () => {
|
|
|
3940
4274
|
unpublishStream: sinon.stub(),
|
|
3941
4275
|
setNamedMediaGroups: sinon.stub(),
|
|
3942
4276
|
});
|
|
4277
|
+
sinon.spy(meeting.sendSlotManager, 'reset');
|
|
3943
4278
|
|
|
3944
4279
|
await meeting.addMedia({
|
|
3945
4280
|
allowMediaInLobby: true,
|
|
@@ -3952,6 +4287,7 @@ describe('plugin-meetings', () => {
|
|
|
3952
4287
|
},
|
|
3953
4288
|
});
|
|
3954
4289
|
|
|
4290
|
+
assert.calledOnce(meeting.sendSlotManager.reset);
|
|
3955
4291
|
assert.notCalled(publishStreamStub);
|
|
3956
4292
|
});
|
|
3957
4293
|
|
|
@@ -3975,6 +4311,7 @@ describe('plugin-meetings', () => {
|
|
|
3975
4311
|
}
|
|
3976
4312
|
return videoSlot;
|
|
3977
4313
|
});
|
|
4314
|
+
sinon.spy(meeting.sendSlotManager, 'reset');
|
|
3978
4315
|
|
|
3979
4316
|
await meeting.addMedia({
|
|
3980
4317
|
allowMediaInLobby: true,
|
|
@@ -3987,6 +4324,7 @@ describe('plugin-meetings', () => {
|
|
|
3987
4324
|
},
|
|
3988
4325
|
});
|
|
3989
4326
|
|
|
4327
|
+
assert.calledOnce(meeting.sendSlotManager.reset);
|
|
3990
4328
|
assert.calledOnceWithExactly(audioSlot.publishStream, fakeMicrophoneStream);
|
|
3991
4329
|
assert.calledOnceWithExactly(videoSlot.publishStream, fakeCameraStream);
|
|
3992
4330
|
});
|
|
@@ -4009,11 +4347,13 @@ describe('plugin-meetings', () => {
|
|
|
4009
4347
|
|
|
4010
4348
|
meeting.meetingState = 'ACTIVE';
|
|
4011
4349
|
meeting.isMultistream = true;
|
|
4350
|
+
sinon.spy(meeting.sendSlotManager, 'reset');
|
|
4012
4351
|
|
|
4013
4352
|
await meeting.addMedia({
|
|
4014
4353
|
mediaSettings: {},
|
|
4015
4354
|
});
|
|
4016
4355
|
|
|
4356
|
+
assert.calledOnce(meeting.sendSlotManager.reset);
|
|
4017
4357
|
// check that rtcMetrics was passed to Media.createMediaConnection
|
|
4018
4358
|
assert.calledOnce(Media.createMediaConnection);
|
|
4019
4359
|
assert.calledWith(
|
|
@@ -4383,12 +4723,14 @@ describe('plugin-meetings', () => {
|
|
|
4383
4723
|
|
|
4384
4724
|
[
|
|
4385
4725
|
{
|
|
4386
|
-
title:
|
|
4726
|
+
title:
|
|
4727
|
+
'should drop iceTransportPolicy=relay when TURN discovery returns no turn server info',
|
|
4387
4728
|
turnServerInfo: undefined,
|
|
4388
4729
|
turnDiscoverySkippedReason: 'reachability',
|
|
4389
4730
|
},
|
|
4390
4731
|
{
|
|
4391
|
-
title:
|
|
4732
|
+
title:
|
|
4733
|
+
'should drop iceTransportPolicy=relay when TURN discovery returns turnServerInfo with empty urls',
|
|
4392
4734
|
turnServerInfo: {urls: [], username: 'u', password: 'p'},
|
|
4393
4735
|
turnDiscoverySkippedReason: undefined,
|
|
4394
4736
|
},
|
|
@@ -4411,9 +4753,9 @@ describe('plugin-meetings', () => {
|
|
|
4411
4753
|
const config = createMediaConnectionStub.firstCall.args[3];
|
|
4412
4754
|
assert.isUndefined(config.iceTransportPolicy);
|
|
4413
4755
|
|
|
4414
|
-
const successCall = Metrics.sendBehavioralMetric
|
|
4415
|
-
(
|
|
4416
|
-
|
|
4756
|
+
const successCall = Metrics.sendBehavioralMetric
|
|
4757
|
+
.getCalls()
|
|
4758
|
+
.find((call) => call.args[0] === BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS);
|
|
4417
4759
|
assert.isDefined(successCall);
|
|
4418
4760
|
assert.equal(successCall.args[1].iceTransportPolicy, 'all');
|
|
4419
4761
|
});
|
|
@@ -4421,46 +4763,48 @@ describe('plugin-meetings', () => {
|
|
|
4421
4763
|
|
|
4422
4764
|
it('should send ADD_MEDIA_SUCCESS metric with iceTransportPolicy=relay when relay is used', async () => {
|
|
4423
4765
|
meeting.roap.doTurnDiscovery = sinon.stub().returns({
|
|
4424
|
-
turnServerInfo: {
|
|
4766
|
+
turnServerInfo: {
|
|
4767
|
+
urls: ['turns:turn-server:443?transport=tcp'],
|
|
4768
|
+
username: 'u',
|
|
4769
|
+
password: 'p',
|
|
4770
|
+
},
|
|
4425
4771
|
turnDiscoverySkippedReason: undefined,
|
|
4426
4772
|
});
|
|
4427
4773
|
|
|
4428
|
-
await meeting.addMediaInternal(
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
undefined,
|
|
4432
|
-
'relay',
|
|
4433
|
-
{mediaSettings: {}}
|
|
4434
|
-
);
|
|
4774
|
+
await meeting.addMediaInternal(() => 'JOIN_MEETING_FINAL', false, undefined, 'relay', {
|
|
4775
|
+
mediaSettings: {},
|
|
4776
|
+
});
|
|
4435
4777
|
|
|
4436
|
-
const successCall = Metrics.sendBehavioralMetric
|
|
4437
|
-
(
|
|
4438
|
-
|
|
4778
|
+
const successCall = Metrics.sendBehavioralMetric
|
|
4779
|
+
.getCalls()
|
|
4780
|
+
.find((call) => call.args[0] === BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS);
|
|
4439
4781
|
assert.isDefined(successCall);
|
|
4440
4782
|
assert.equal(successCall.args[1].iceTransportPolicy, 'relay');
|
|
4441
4783
|
});
|
|
4442
4784
|
|
|
4443
4785
|
it('should send ADD_MEDIA_FAILURE metric with iceTransportPolicy=relay when relay attempt fails', async () => {
|
|
4444
4786
|
meeting.roap.doTurnDiscovery = sinon.stub().returns({
|
|
4445
|
-
turnServerInfo: {
|
|
4787
|
+
turnServerInfo: {
|
|
4788
|
+
urls: ['turns:turn-server:443?transport=tcp'],
|
|
4789
|
+
username: 'u',
|
|
4790
|
+
password: 'p',
|
|
4791
|
+
},
|
|
4446
4792
|
turnDiscoverySkippedReason: undefined,
|
|
4447
4793
|
});
|
|
4448
4794
|
|
|
4449
|
-
meeting.mediaProperties.waitForMediaConnectionConnected = sinon
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
await assert.isRejected(meeting.addMediaInternal(
|
|
4454
|
-
() => 'JOIN_MEETING_FINAL',
|
|
4455
|
-
false,
|
|
4456
|
-
undefined,
|
|
4457
|
-
'relay',
|
|
4458
|
-
{mediaSettings: {}}
|
|
4459
|
-
));
|
|
4795
|
+
meeting.mediaProperties.waitForMediaConnectionConnected = sinon
|
|
4796
|
+
.stub()
|
|
4797
|
+
.rejects(new MediaConnectionTimedOutError('timed out', true));
|
|
4460
4798
|
|
|
4461
|
-
|
|
4462
|
-
(
|
|
4799
|
+
await assert.isRejected(
|
|
4800
|
+
meeting.addMediaInternal(() => 'JOIN_MEETING_FINAL', false, undefined, 'relay', {
|
|
4801
|
+
mediaSettings: {},
|
|
4802
|
+
})
|
|
4463
4803
|
);
|
|
4804
|
+
|
|
4805
|
+
const failureCall = Metrics.sendBehavioralMetric
|
|
4806
|
+
.getCalls()
|
|
4807
|
+
.find((call) => call.args[0] === BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE);
|
|
4464
4808
|
assert.isDefined(failureCall);
|
|
4465
4809
|
assert.equal(failureCall.args[1].iceTransportPolicy, 'relay');
|
|
4466
4810
|
});
|
|
@@ -5864,6 +6208,7 @@ describe('plugin-meetings', () => {
|
|
|
5864
6208
|
member2: unmutedMember,
|
|
5865
6209
|
member3: selfMember,
|
|
5866
6210
|
});
|
|
6211
|
+
meeting.isUserUnadmitted = false;
|
|
5867
6212
|
|
|
5868
6213
|
// Reset the stub to clear any previous calls
|
|
5869
6214
|
TriggerProxy.trigger.resetHistory();
|
|
@@ -5883,8 +6228,46 @@ describe('plugin-meetings', () => {
|
|
|
5883
6228
|
meeting.mediaProperties.sendMediaIssueMetric,
|
|
5884
6229
|
'inbound_audio',
|
|
5885
6230
|
fakeEventData.issueSubType,
|
|
5886
|
-
|
|
6231
|
+
{
|
|
6232
|
+
correlationId: meeting.correlationId,
|
|
6233
|
+
isMultistream: meeting.isMultistream,
|
|
6234
|
+
}
|
|
6235
|
+
);
|
|
6236
|
+
});
|
|
6237
|
+
|
|
6238
|
+
it('should not trigger event or metric when the user is in the lobby', () => {
|
|
6239
|
+
const fakeEventData = {issueSubType: 'DECODE_RESULTS_IN_ZERO_AUDIO_LEVEL'};
|
|
6240
|
+
|
|
6241
|
+
const unmutedMember = {
|
|
6242
|
+
isSelf: false,
|
|
6243
|
+
isPairedWithSelf: false,
|
|
6244
|
+
isAudioMuted: false,
|
|
6245
|
+
};
|
|
6246
|
+
const selfMember = {
|
|
6247
|
+
isSelf: true,
|
|
6248
|
+
isPairedWithSelf: false,
|
|
6249
|
+
isAudioMuted: false,
|
|
6250
|
+
};
|
|
6251
|
+
meeting.members.membersCollection.getAll = sinon.stub().returns({
|
|
6252
|
+
member1: unmutedMember,
|
|
6253
|
+
member2: selfMember,
|
|
6254
|
+
});
|
|
6255
|
+
meeting.isUserUnadmitted = true;
|
|
6256
|
+
|
|
6257
|
+
// Reset the stub to clear any previous calls
|
|
6258
|
+
TriggerProxy.trigger.resetHistory();
|
|
6259
|
+
|
|
6260
|
+
// Emit the event from statsMonitor
|
|
6261
|
+
listeners[StatsMonitorEventNames.INBOUND_AUDIO_ISSUE](fakeEventData);
|
|
6262
|
+
|
|
6263
|
+
assert.neverCalledWith(
|
|
6264
|
+
TriggerProxy.trigger,
|
|
6265
|
+
meeting,
|
|
6266
|
+
sinon.match.object,
|
|
6267
|
+
EVENT_TRIGGERS.MEDIA_INBOUND_AUDIO_ISSUE_DETECTED,
|
|
6268
|
+
fakeEventData
|
|
5887
6269
|
);
|
|
6270
|
+
assert.notCalled(meeting.mediaProperties.sendMediaIssueMetric);
|
|
5888
6271
|
});
|
|
5889
6272
|
});
|
|
5890
6273
|
});
|
|
@@ -10626,7 +11009,9 @@ describe('plugin-meetings', () => {
|
|
|
10626
11009
|
MediaCodecMimeType.OPUS,
|
|
10627
11010
|
['maxaveragebitrate', 'maxplaybackrate']
|
|
10628
11011
|
);
|
|
10629
|
-
assert.notCalled(
|
|
11012
|
+
assert.notCalled(
|
|
11013
|
+
meeting.sendSlotManager.getSlot(MediaType.AudioMain).setCustomCodecParameters
|
|
11014
|
+
);
|
|
10630
11015
|
});
|
|
10631
11016
|
});
|
|
10632
11017
|
|
|
@@ -11354,6 +11739,8 @@ describe('plugin-meetings', () => {
|
|
|
11354
11739
|
});
|
|
11355
11740
|
|
|
11356
11741
|
it('handles REMOTE_SDP_ANSWER_PROCESSED correctly', () => {
|
|
11742
|
+
// capture the start timestamp before any fake timers are installed
|
|
11743
|
+
const localSdpGeneratedTimestamp = Date.now() - 100;
|
|
11357
11744
|
const clock = sinon.useFakeTimers();
|
|
11358
11745
|
sinon.spy(clock, 'clearTimeout');
|
|
11359
11746
|
meeting.deferSDPAnswer = {
|
|
@@ -11361,24 +11748,29 @@ describe('plugin-meetings', () => {
|
|
|
11361
11748
|
};
|
|
11362
11749
|
meeting.sdpResponseTimer = '1234';
|
|
11363
11750
|
|
|
11751
|
+
// latency is computed as Date.now() - the stored local-sdp-generated timestamp,
|
|
11752
|
+
// so it is unaffected by any earlier remote-sdp-received timestamp saved on timeout
|
|
11753
|
+
webex.internal.newMetrics.callDiagnosticLatencies.latencyTimestamps = new Map([
|
|
11754
|
+
['client.media-engine.local-sdp-generated', localSdpGeneratedTimestamp],
|
|
11755
|
+
]);
|
|
11756
|
+
|
|
11364
11757
|
eventListeners[MediaConnectionEventNames.REMOTE_SDP_ANSWER_PROCESSED]();
|
|
11365
11758
|
|
|
11366
11759
|
assert.calledOnce(webex.internal.newMetrics.submitClientEvent);
|
|
11367
11760
|
assert.calledWithMatch(webex.internal.newMetrics.submitClientEvent, {
|
|
11368
11761
|
name: 'client.media-engine.remote-sdp-received',
|
|
11762
|
+
payload: {
|
|
11763
|
+
eventData: {
|
|
11764
|
+
localSDPGenRemoteSDPRecv: sinon.match(
|
|
11765
|
+
(value) => typeof value === 'number' && value >= 100 && value < 5000
|
|
11766
|
+
),
|
|
11767
|
+
},
|
|
11768
|
+
},
|
|
11369
11769
|
options: {meetingId: meeting.id},
|
|
11370
11770
|
});
|
|
11371
11771
|
|
|
11372
|
-
|
|
11373
|
-
assert.
|
|
11374
|
-
Metrics.sendBehavioralMetric,
|
|
11375
|
-
BEHAVIORAL_METRICS.ROAP_OFFER_TO_ANSWER_LATENCY,
|
|
11376
|
-
{
|
|
11377
|
-
correlation_id: meeting.correlationId,
|
|
11378
|
-
meetingId: meeting.id,
|
|
11379
|
-
latency: undefined,
|
|
11380
|
-
}
|
|
11381
|
-
);
|
|
11772
|
+
// the high-volume ROAP_OFFER_TO_ANSWER_LATENCY behavioral metric is no longer sent
|
|
11773
|
+
assert.notCalled(Metrics.sendBehavioralMetric);
|
|
11382
11774
|
|
|
11383
11775
|
assert.calledOnce(meeting.deferSDPAnswer.resolve);
|
|
11384
11776
|
assert.calledOnce(clock.clearTimeout);
|
|
@@ -11386,6 +11778,28 @@ describe('plugin-meetings', () => {
|
|
|
11386
11778
|
assert.equal(meeting.sdpResponseTimer, undefined);
|
|
11387
11779
|
});
|
|
11388
11780
|
|
|
11781
|
+
it('sends undefined localSDPGenRemoteSDPRecv when the local-sdp-generated timestamp is missing', () => {
|
|
11782
|
+
meeting.deferSDPAnswer = {
|
|
11783
|
+
resolve: sinon.stub(),
|
|
11784
|
+
};
|
|
11785
|
+
|
|
11786
|
+
// no local-sdp-generated timestamp stored -> latency cannot be computed
|
|
11787
|
+
webex.internal.newMetrics.callDiagnosticLatencies.latencyTimestamps = new Map();
|
|
11788
|
+
|
|
11789
|
+
eventListeners[MediaConnectionEventNames.REMOTE_SDP_ANSWER_PROCESSED]();
|
|
11790
|
+
|
|
11791
|
+
assert.calledOnce(webex.internal.newMetrics.submitClientEvent);
|
|
11792
|
+
assert.calledWithMatch(webex.internal.newMetrics.submitClientEvent, {
|
|
11793
|
+
name: 'client.media-engine.remote-sdp-received',
|
|
11794
|
+
payload: {
|
|
11795
|
+
eventData: {
|
|
11796
|
+
localSDPGenRemoteSDPRecv: undefined,
|
|
11797
|
+
},
|
|
11798
|
+
},
|
|
11799
|
+
options: {meetingId: meeting.id},
|
|
11800
|
+
});
|
|
11801
|
+
});
|
|
11802
|
+
|
|
11389
11803
|
it('handles LOCAL_SDP_OFFER_GENERATED correctly', () => {
|
|
11390
11804
|
assert.equal(meeting.deferSDPAnswer, undefined);
|
|
11391
11805
|
|
|
@@ -11786,11 +12200,11 @@ describe('plugin-meetings', () => {
|
|
|
11786
12200
|
meeting.updateLLMConnection = sinon.stub();
|
|
11787
12201
|
let resolvePrefetch;
|
|
11788
12202
|
|
|
11789
|
-
meeting.ensureDefaultDatachannelTokenAfterAdmit = sinon
|
|
11790
|
-
|
|
11791
|
-
.returns(new Promise((resolve) => {
|
|
12203
|
+
meeting.ensureDefaultDatachannelTokenAfterAdmit = sinon.stub().returns(
|
|
12204
|
+
new Promise((resolve) => {
|
|
11792
12205
|
resolvePrefetch = resolve;
|
|
11793
|
-
})
|
|
12206
|
+
})
|
|
12207
|
+
);
|
|
11794
12208
|
meeting.rtcMetrics = {
|
|
11795
12209
|
sendNextMetrics: sinon.stub(),
|
|
11796
12210
|
};
|
|
@@ -12364,34 +12778,42 @@ describe('plugin-meetings', () => {
|
|
|
12364
12778
|
},
|
|
12365
12779
|
];
|
|
12366
12780
|
|
|
12367
|
-
recordingTestCases.forEach(
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12781
|
+
recordingTestCases.forEach(
|
|
12782
|
+
({description, state, expectedEvent, expectedRecordingState}) => {
|
|
12783
|
+
it(`listens to CONTROLS_RECORDING_UPDATED - ${description}`, async () => {
|
|
12784
|
+
const modifiedBy = 'user-id-123';
|
|
12785
|
+
const lastModified = '2026-01-01T00:00:00Z';
|
|
12371
12786
|
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12375
|
-
|
|
12376
|
-
|
|
12787
|
+
await meeting.locusInfo.emitScoped(
|
|
12788
|
+
{function: 'test', file: 'test'},
|
|
12789
|
+
LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED,
|
|
12790
|
+
{
|
|
12791
|
+
state,
|
|
12792
|
+
modifiedBy,
|
|
12793
|
+
lastModified,
|
|
12794
|
+
modifiedByServiceAppName: undefined,
|
|
12795
|
+
modifiedByServiceAppId: undefined,
|
|
12796
|
+
}
|
|
12797
|
+
);
|
|
12377
12798
|
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12799
|
+
assert.deepEqual(meeting.recording, {
|
|
12800
|
+
state: expectedRecordingState,
|
|
12801
|
+
modifiedBy,
|
|
12802
|
+
lastModified,
|
|
12803
|
+
modifiedByServiceAppName: undefined,
|
|
12804
|
+
modifiedByServiceAppId: undefined,
|
|
12805
|
+
});
|
|
12385
12806
|
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12807
|
+
assert.calledWith(
|
|
12808
|
+
TriggerProxy.trigger,
|
|
12809
|
+
meeting,
|
|
12810
|
+
{file: 'meeting/index', function: 'setupLocusControlsListener'},
|
|
12811
|
+
expectedEvent,
|
|
12812
|
+
meeting.recording
|
|
12813
|
+
);
|
|
12814
|
+
});
|
|
12815
|
+
}
|
|
12816
|
+
);
|
|
12395
12817
|
|
|
12396
12818
|
it('listens to CONTROLS_RECORDING_UPDATED and includes modifiedByServiceAppName and modifiedByServiceAppId when present', async () => {
|
|
12397
12819
|
const modifiedBy = 'user-id-123';
|
|
@@ -12402,7 +12824,13 @@ describe('plugin-meetings', () => {
|
|
|
12402
12824
|
await meeting.locusInfo.emitScoped(
|
|
12403
12825
|
{function: 'test', file: 'test'},
|
|
12404
12826
|
LOCUSINFO.EVENTS.CONTROLS_RECORDING_UPDATED,
|
|
12405
|
-
{
|
|
12827
|
+
{
|
|
12828
|
+
state: RECORDING_STATE.RECORDING,
|
|
12829
|
+
modifiedBy,
|
|
12830
|
+
lastModified,
|
|
12831
|
+
modifiedByServiceAppName,
|
|
12832
|
+
modifiedByServiceAppId,
|
|
12833
|
+
}
|
|
12406
12834
|
);
|
|
12407
12835
|
|
|
12408
12836
|
assert.deepEqual(meeting.recording, {
|
|
@@ -14486,7 +14914,11 @@ describe('plugin-meetings', () => {
|
|
|
14486
14914
|
meeting.joinedWith = {state: 'any other state'};
|
|
14487
14915
|
webex.internal.llm.getLocusUrl.returns('a url');
|
|
14488
14916
|
|
|
14489
|
-
meeting.locusInfo = {
|
|
14917
|
+
meeting.locusInfo = {
|
|
14918
|
+
syncAllHashTreeDatasets: sinon.stub().resolves(),
|
|
14919
|
+
url: 'a url',
|
|
14920
|
+
info: {datachannelUrl: 'a datachannel url'},
|
|
14921
|
+
};
|
|
14490
14922
|
|
|
14491
14923
|
const result = await meeting.updateLLMConnection();
|
|
14492
14924
|
|
|
@@ -14535,7 +14967,11 @@ describe('plugin-meetings', () => {
|
|
|
14535
14967
|
});
|
|
14536
14968
|
it('connects if not already connected', async () => {
|
|
14537
14969
|
meeting.joinedWith = {state: 'JOINED'};
|
|
14538
|
-
meeting.locusInfo = {
|
|
14970
|
+
meeting.locusInfo = {
|
|
14971
|
+
syncAllHashTreeDatasets: sinon.stub().resolves(),
|
|
14972
|
+
url: 'a url',
|
|
14973
|
+
info: {datachannelUrl: 'a datachannel url'},
|
|
14974
|
+
};
|
|
14539
14975
|
|
|
14540
14976
|
const result = await meeting.updateLLMConnection();
|
|
14541
14977
|
|
|
@@ -14570,10 +15006,15 @@ describe('plugin-meetings', () => {
|
|
|
14570
15006
|
|
|
14571
15007
|
const result = await meeting.updateLLMConnection();
|
|
14572
15008
|
|
|
14573
|
-
assert.calledWithExactly(
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
15009
|
+
assert.calledWithExactly(
|
|
15010
|
+
webex.internal.llm.disconnectLLM,
|
|
15011
|
+
{
|
|
15012
|
+
code: 3050,
|
|
15013
|
+
reason: 'done (permanent)',
|
|
15014
|
+
},
|
|
15015
|
+
'llm-default-session',
|
|
15016
|
+
meeting.id
|
|
15017
|
+
);
|
|
14577
15018
|
|
|
14578
15019
|
assert.calledWithExactly(
|
|
14579
15020
|
webex.internal.llm.registerAndConnect,
|
|
@@ -14624,10 +15065,15 @@ describe('plugin-meetings', () => {
|
|
|
14624
15065
|
|
|
14625
15066
|
const result = await meeting.updateLLMConnection();
|
|
14626
15067
|
|
|
14627
|
-
assert.calledWithExactly(
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
15068
|
+
assert.calledWithExactly(
|
|
15069
|
+
webex.internal.llm.disconnectLLM,
|
|
15070
|
+
{
|
|
15071
|
+
code: 3050,
|
|
15072
|
+
reason: 'done (permanent)',
|
|
15073
|
+
},
|
|
15074
|
+
'llm-default-session',
|
|
15075
|
+
meeting.id
|
|
15076
|
+
);
|
|
14631
15077
|
|
|
14632
15078
|
assert.calledWithExactly(
|
|
14633
15079
|
webex.internal.llm.registerAndConnect,
|
|
@@ -14668,14 +15114,23 @@ describe('plugin-meetings', () => {
|
|
|
14668
15114
|
webex.internal.llm.isConnected.returns(true);
|
|
14669
15115
|
webex.internal.llm.getLocusUrl.returns('a url');
|
|
14670
15116
|
|
|
14671
|
-
meeting.locusInfo = {
|
|
15117
|
+
meeting.locusInfo = {
|
|
15118
|
+
syncAllHashTreeDatasets: sinon.stub().resolves(),
|
|
15119
|
+
url: 'a url',
|
|
15120
|
+
info: {datachannelUrl: 'a datachannel url'},
|
|
15121
|
+
};
|
|
14672
15122
|
|
|
14673
15123
|
const result = await meeting.updateLLMConnection();
|
|
14674
15124
|
|
|
14675
|
-
assert.calledWith(
|
|
14676
|
-
|
|
14677
|
-
|
|
14678
|
-
|
|
15125
|
+
assert.calledWith(
|
|
15126
|
+
webex.internal.llm.disconnectLLM,
|
|
15127
|
+
{
|
|
15128
|
+
code: 3050,
|
|
15129
|
+
reason: 'done (permanent)',
|
|
15130
|
+
},
|
|
15131
|
+
'llm-default-session',
|
|
15132
|
+
meeting.id
|
|
15133
|
+
);
|
|
14679
15134
|
assert.notCalled(webex.internal.llm.registerAndConnect);
|
|
14680
15135
|
assert.equal(result, undefined);
|
|
14681
15136
|
assert.isFalse(
|
|
@@ -14846,7 +15301,6 @@ describe('plugin-meetings', () => {
|
|
|
14846
15301
|
assert.notCalled(meeting.startLLMHealthCheckTimer);
|
|
14847
15302
|
});
|
|
14848
15303
|
|
|
14849
|
-
|
|
14850
15304
|
it('clears stale owner tag in cleanup finally block even when disconnectLLM rejects', async () => {
|
|
14851
15305
|
meeting.joinedWith = {state: 'JOINED'};
|
|
14852
15306
|
webex.internal.llm.isConnected.returns(true);
|
|
@@ -14914,10 +15368,15 @@ describe('plugin-meetings', () => {
|
|
|
14914
15368
|
|
|
14915
15369
|
await meeting.updateLLMConnection();
|
|
14916
15370
|
|
|
14917
|
-
assert.calledOnceWithExactly(
|
|
14918
|
-
|
|
14919
|
-
|
|
14920
|
-
|
|
15371
|
+
assert.calledOnceWithExactly(
|
|
15372
|
+
webex.internal.llm.disconnectLLM,
|
|
15373
|
+
{
|
|
15374
|
+
code: 3050,
|
|
15375
|
+
reason: 'done (permanent)',
|
|
15376
|
+
},
|
|
15377
|
+
'llm-default-session',
|
|
15378
|
+
meeting.id
|
|
15379
|
+
);
|
|
14921
15380
|
assert.calledWithExactly(
|
|
14922
15381
|
webex.internal.llm.registerAndConnect,
|
|
14923
15382
|
'a different url',
|
|
@@ -14937,7 +15396,11 @@ describe('plugin-meetings', () => {
|
|
|
14937
15396
|
meeting.joinedWith = {state: 'JOINED'};
|
|
14938
15397
|
webex.internal.llm.isConnected.returns(false);
|
|
14939
15398
|
webex.internal.llm.getOwnerMeetingId.returns(undefined);
|
|
14940
|
-
meeting.locusInfo = {
|
|
15399
|
+
meeting.locusInfo = {
|
|
15400
|
+
syncAllHashTreeDatasets: sinon.stub().resolves(),
|
|
15401
|
+
url: 'a url',
|
|
15402
|
+
info: {datachannelUrl: 'a datachannel url'},
|
|
15403
|
+
};
|
|
14941
15404
|
|
|
14942
15405
|
await meeting.updateLLMConnection();
|
|
14943
15406
|
|
|
@@ -14961,7 +15424,11 @@ describe('plugin-meetings', () => {
|
|
|
14961
15424
|
webex.internal.llm.getOwnerMeetingId.returns('stale-owner-id');
|
|
14962
15425
|
webex.internal.llm.getDatachannelToken.onFirstCall().returns(undefined);
|
|
14963
15426
|
webex.internal.llm.getDatachannelToken.onSecondCall().returns('recovered-token');
|
|
14964
|
-
meeting.locusInfo = {
|
|
15427
|
+
meeting.locusInfo = {
|
|
15428
|
+
syncAllHashTreeDatasets: sinon.stub().resolves(),
|
|
15429
|
+
url: 'a url',
|
|
15430
|
+
info: {datachannelUrl: 'a datachannel url'},
|
|
15431
|
+
};
|
|
14965
15432
|
|
|
14966
15433
|
await meeting.updateLLMConnection();
|
|
14967
15434
|
|
|
@@ -15013,10 +15480,15 @@ describe('plugin-meetings', () => {
|
|
|
15013
15480
|
it('disconnects llm and removes online and relay listeners during meeting data cleanup', async () => {
|
|
15014
15481
|
await meeting.clearMeetingData();
|
|
15015
15482
|
|
|
15016
|
-
assert.calledOnceWithExactly(
|
|
15017
|
-
|
|
15018
|
-
|
|
15019
|
-
|
|
15483
|
+
assert.calledOnceWithExactly(
|
|
15484
|
+
webex.internal.llm.disconnectLLM,
|
|
15485
|
+
{
|
|
15486
|
+
code: 3050,
|
|
15487
|
+
reason: 'done (permanent)',
|
|
15488
|
+
},
|
|
15489
|
+
'llm-default-session',
|
|
15490
|
+
meeting.id
|
|
15491
|
+
);
|
|
15020
15492
|
assert.calledWithExactly(webex.internal.llm.off, 'online', meeting.handleLLMOnline);
|
|
15021
15493
|
assert.calledWithExactly(
|
|
15022
15494
|
webex.internal.llm.off,
|
|
@@ -15095,10 +15567,15 @@ describe('plugin-meetings', () => {
|
|
|
15095
15567
|
|
|
15096
15568
|
await meeting.clearMeetingData();
|
|
15097
15569
|
|
|
15098
|
-
assert.calledOnceWithExactly(
|
|
15099
|
-
|
|
15100
|
-
|
|
15101
|
-
|
|
15570
|
+
assert.calledOnceWithExactly(
|
|
15571
|
+
webex.internal.llm.disconnectLLM,
|
|
15572
|
+
{
|
|
15573
|
+
code: 3050,
|
|
15574
|
+
reason: 'done (permanent)',
|
|
15575
|
+
},
|
|
15576
|
+
'llm-default-session',
|
|
15577
|
+
meeting.id
|
|
15578
|
+
);
|
|
15102
15579
|
assert.calledOnce(meeting.clearDataChannelToken);
|
|
15103
15580
|
});
|
|
15104
15581
|
|
|
@@ -15107,16 +15584,180 @@ describe('plugin-meetings', () => {
|
|
|
15107
15584
|
|
|
15108
15585
|
await meeting.clearMeetingData();
|
|
15109
15586
|
|
|
15110
|
-
assert.calledOnceWithExactly(
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15587
|
+
assert.calledOnceWithExactly(
|
|
15588
|
+
webex.internal.llm.disconnectLLM,
|
|
15589
|
+
{
|
|
15590
|
+
code: 3050,
|
|
15591
|
+
reason: 'done (permanent)',
|
|
15592
|
+
},
|
|
15593
|
+
'llm-default-session',
|
|
15594
|
+
meeting.id
|
|
15595
|
+
);
|
|
15114
15596
|
assert.calledOnce(meeting.clearDataChannelToken);
|
|
15115
15597
|
});
|
|
15116
15598
|
});
|
|
15117
15599
|
});
|
|
15118
15600
|
});
|
|
15119
15601
|
|
|
15602
|
+
describe('#processLocusLLMEvent', () => {
|
|
15603
|
+
it('routes the LLM event through locusInfo.parse and records the LLM message with the top-level tracking id', () => {
|
|
15604
|
+
const event = {
|
|
15605
|
+
data: {
|
|
15606
|
+
eventType: 'locus.state_message',
|
|
15607
|
+
dataSets: [],
|
|
15608
|
+
},
|
|
15609
|
+
trackingId: 'envelope-tracking-id',
|
|
15610
|
+
};
|
|
15611
|
+
|
|
15612
|
+
meeting.locusInfo.parse = sinon.stub();
|
|
15613
|
+
meeting.onLocusSyncLlmMessage = sinon.stub();
|
|
15614
|
+
|
|
15615
|
+
meeting.processLocusLLMEvent(event);
|
|
15616
|
+
|
|
15617
|
+
// The LLM message is parsed without the tracking id - completion is driven from the
|
|
15618
|
+
// meeting's LLM handler, not threaded through locusInfo.
|
|
15619
|
+
assert.calledOnceWithExactly(meeting.locusInfo.parse, meeting, event.data);
|
|
15620
|
+
// Only the client whose /sync request tracking id matches the tracking id echoed back on
|
|
15621
|
+
// the top-level LLM event envelope records the LLM arrival; onLocusSyncLlmMessage is a
|
|
15622
|
+
// no-op otherwise.
|
|
15623
|
+
assert.calledOnceWithExactly(meeting.onLocusSyncLlmMessage, meeting.id, event.trackingId);
|
|
15624
|
+
});
|
|
15625
|
+
|
|
15626
|
+
it('does not attempt sync completion when the tracking id is missing', () => {
|
|
15627
|
+
const event = {
|
|
15628
|
+
data: {
|
|
15629
|
+
eventType: 'locus.state_message',
|
|
15630
|
+
dataSets: [],
|
|
15631
|
+
},
|
|
15632
|
+
};
|
|
15633
|
+
|
|
15634
|
+
meeting.locusInfo.parse = sinon.stub();
|
|
15635
|
+
meeting.onLocusSyncLlmMessage = sinon.stub();
|
|
15636
|
+
|
|
15637
|
+
meeting.processLocusLLMEvent(event);
|
|
15638
|
+
|
|
15639
|
+
assert.calledOnceWithExactly(meeting.locusInfo.parse, meeting, event.data);
|
|
15640
|
+
assert.notCalled(meeting.onLocusSyncLlmMessage);
|
|
15641
|
+
});
|
|
15642
|
+
});
|
|
15643
|
+
|
|
15644
|
+
describe('#onLocusSyncLlmMessage', () => {
|
|
15645
|
+
it('records the LLM arrival time and then tries to complete the metric', () => {
|
|
15646
|
+
webex.internal.newMetrics.callDiagnosticLatencies.recordLocusSyncMessageReceived =
|
|
15647
|
+
sinon.stub();
|
|
15648
|
+
meeting.tryCompleteLocusSyncLatency = sinon.stub();
|
|
15649
|
+
|
|
15650
|
+
meeting.onLocusSyncLlmMessage('meeting-1', 'sync-tracking-id');
|
|
15651
|
+
|
|
15652
|
+
assert.calledOnceWithExactly(
|
|
15653
|
+
webex.internal.newMetrics.callDiagnosticLatencies.recordLocusSyncMessageReceived,
|
|
15654
|
+
'meeting-1',
|
|
15655
|
+
'sync-tracking-id'
|
|
15656
|
+
);
|
|
15657
|
+
assert.calledOnceWithExactly(
|
|
15658
|
+
meeting.tryCompleteLocusSyncLatency,
|
|
15659
|
+
'meeting-1',
|
|
15660
|
+
'sync-tracking-id'
|
|
15661
|
+
);
|
|
15662
|
+
// the arrival time must be recorded before completion is attempted
|
|
15663
|
+
assert.callOrder(
|
|
15664
|
+
webex.internal.newMetrics.callDiagnosticLatencies.recordLocusSyncMessageReceived,
|
|
15665
|
+
meeting.tryCompleteLocusSyncLatency
|
|
15666
|
+
);
|
|
15667
|
+
});
|
|
15668
|
+
});
|
|
15669
|
+
|
|
15670
|
+
describe('#tryCompleteLocusSyncLatency', () => {
|
|
15671
|
+
beforeEach(() => {
|
|
15672
|
+
meeting.emitLocusSyncCompleteMetric = sinon.stub();
|
|
15673
|
+
});
|
|
15674
|
+
|
|
15675
|
+
it('emits the metric when both milestones are in (completion succeeds)', () => {
|
|
15676
|
+
const completed = {dataSet: 'main', syncLatency: {totalTime: 50}};
|
|
15677
|
+
webex.internal.newMetrics.callDiagnosticLatencies.completeLocusSyncLatency = sinon
|
|
15678
|
+
.stub()
|
|
15679
|
+
.returns(completed);
|
|
15680
|
+
|
|
15681
|
+
meeting.tryCompleteLocusSyncLatency('meeting-1', 'sync-tracking-id');
|
|
15682
|
+
|
|
15683
|
+
assert.calledOnceWithExactly(
|
|
15684
|
+
webex.internal.newMetrics.callDiagnosticLatencies.completeLocusSyncLatency,
|
|
15685
|
+
'meeting-1',
|
|
15686
|
+
'sync-tracking-id'
|
|
15687
|
+
);
|
|
15688
|
+
assert.calledOnceWithExactly(meeting.emitLocusSyncCompleteMetric, 'meeting-1', completed);
|
|
15689
|
+
});
|
|
15690
|
+
|
|
15691
|
+
it('does not emit when completion returns undefined (only one milestone is in)', () => {
|
|
15692
|
+
webex.internal.newMetrics.callDiagnosticLatencies.completeLocusSyncLatency = sinon
|
|
15693
|
+
.stub()
|
|
15694
|
+
.returns(undefined);
|
|
15695
|
+
|
|
15696
|
+
meeting.tryCompleteLocusSyncLatency('meeting-1', 'sync-tracking-id');
|
|
15697
|
+
|
|
15698
|
+
assert.calledOnceWithExactly(
|
|
15699
|
+
webex.internal.newMetrics.callDiagnosticLatencies.completeLocusSyncLatency,
|
|
15700
|
+
'meeting-1',
|
|
15701
|
+
'sync-tracking-id'
|
|
15702
|
+
);
|
|
15703
|
+
assert.notCalled(meeting.emitLocusSyncCompleteMetric);
|
|
15704
|
+
});
|
|
15705
|
+
});
|
|
15706
|
+
|
|
15707
|
+
describe('#emitLocusSyncCompleteMetric', () => {
|
|
15708
|
+
it('submits client.locus.sync.complete with the llm websocket url and sync latency', () => {
|
|
15709
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
15710
|
+
webex.internal.llm.getWebSocketUrl = sinon.stub().returns('wss://llm-websocket-url');
|
|
15711
|
+
|
|
15712
|
+
meeting.emitLocusSyncCompleteMetric('meeting-1', {
|
|
15713
|
+
dataSet: 'main',
|
|
15714
|
+
syncLatency: {totalTime: 50},
|
|
15715
|
+
});
|
|
15716
|
+
|
|
15717
|
+
assert.calledOnceWithExactly(webex.internal.newMetrics.submitClientEvent, {
|
|
15718
|
+
name: 'client.locus.sync.complete',
|
|
15719
|
+
payload: {
|
|
15720
|
+
identifiers: {
|
|
15721
|
+
llmWebsocketUrl: 'wss://llm-websocket-url',
|
|
15722
|
+
},
|
|
15723
|
+
llmInfo: {
|
|
15724
|
+
dataSet: 'main',
|
|
15725
|
+
},
|
|
15726
|
+
syncLatency: {totalTime: 50},
|
|
15727
|
+
},
|
|
15728
|
+
options: {
|
|
15729
|
+
meetingId: 'meeting-1',
|
|
15730
|
+
},
|
|
15731
|
+
});
|
|
15732
|
+
});
|
|
15733
|
+
|
|
15734
|
+
it('submits with an undefined llm websocket url when it is unavailable', () => {
|
|
15735
|
+
webex.internal.newMetrics.submitClientEvent.resetHistory();
|
|
15736
|
+
webex.internal.llm.getWebSocketUrl = sinon.stub().returns(undefined);
|
|
15737
|
+
|
|
15738
|
+
meeting.emitLocusSyncCompleteMetric('meeting-1', {
|
|
15739
|
+
dataSet: 'main',
|
|
15740
|
+
syncLatency: {totalTime: 50},
|
|
15741
|
+
});
|
|
15742
|
+
|
|
15743
|
+
assert.calledOnceWithExactly(webex.internal.newMetrics.submitClientEvent, {
|
|
15744
|
+
name: 'client.locus.sync.complete',
|
|
15745
|
+
payload: {
|
|
15746
|
+
identifiers: {
|
|
15747
|
+
llmWebsocketUrl: undefined,
|
|
15748
|
+
},
|
|
15749
|
+
llmInfo: {
|
|
15750
|
+
dataSet: 'main',
|
|
15751
|
+
},
|
|
15752
|
+
syncLatency: {totalTime: 50},
|
|
15753
|
+
},
|
|
15754
|
+
options: {
|
|
15755
|
+
meetingId: 'meeting-1',
|
|
15756
|
+
},
|
|
15757
|
+
});
|
|
15758
|
+
});
|
|
15759
|
+
});
|
|
15760
|
+
|
|
15120
15761
|
describe('#setLocus', () => {
|
|
15121
15762
|
beforeEach(() => {
|
|
15122
15763
|
meeting.locusInfo.initialSetup = sinon.stub().returns(true);
|
|
@@ -15152,6 +15793,71 @@ describe('plugin-meetings', () => {
|
|
|
15152
15793
|
});
|
|
15153
15794
|
});
|
|
15154
15795
|
|
|
15796
|
+
describe('#waitForSelfUrlChange', () => {
|
|
15797
|
+
let waitForSelfUrlChange;
|
|
15798
|
+
let locusMediaRequestStub;
|
|
15799
|
+
|
|
15800
|
+
beforeEach(async () => {
|
|
15801
|
+
locusMediaRequestStub = sinon
|
|
15802
|
+
.stub(LocusMediaRequestModule, 'LocusMediaRequest')
|
|
15803
|
+
.returns({id: 'fake LocusMediaRequest instance'});
|
|
15804
|
+
|
|
15805
|
+
meeting.setLocus = sinon.stub().returns(true);
|
|
15806
|
+
webex.meetings.registered = true;
|
|
15807
|
+
sandbox.stub(MeetingUtil, 'joinMeeting').returns(Promise.resolve('JOIN_RESULT'));
|
|
15808
|
+
sinon.stub(meeting, 'updateLLMConnection').returns(Promise.resolve());
|
|
15809
|
+
|
|
15810
|
+
await meeting.join();
|
|
15811
|
+
|
|
15812
|
+
waitForSelfUrlChange = locusMediaRequestStub.firstCall.args[0].waitForSelfUrlChange;
|
|
15813
|
+
});
|
|
15814
|
+
|
|
15815
|
+
it('should resolve immediately when joinWithMediaRetryInfo.retryCount > 0', async () => {
|
|
15816
|
+
meeting.joinWithMediaRetryInfo = {retryCount: 1, prevJoinResponse: undefined};
|
|
15817
|
+
|
|
15818
|
+
const result = waitForSelfUrlChange();
|
|
15819
|
+
|
|
15820
|
+
assert.instanceOf(result, Promise);
|
|
15821
|
+
await result;
|
|
15822
|
+
});
|
|
15823
|
+
|
|
15824
|
+
it('should not resolve before the timeout when retryCount is 0', async () => {
|
|
15825
|
+
meeting.joinWithMediaRetryInfo = {retryCount: 0, prevJoinResponse: undefined};
|
|
15826
|
+
|
|
15827
|
+
let resolved = false;
|
|
15828
|
+
waitForSelfUrlChange().then(() => {
|
|
15829
|
+
resolved = true;
|
|
15830
|
+
});
|
|
15831
|
+
|
|
15832
|
+
await testUtils.flushPromises();
|
|
15833
|
+
assert.isFalse(resolved);
|
|
15834
|
+
});
|
|
15835
|
+
|
|
15836
|
+
it('should resolve after the 5s timeout when retryCount is 0', async () => {
|
|
15837
|
+
meeting.joinWithMediaRetryInfo = {retryCount: 0, prevJoinResponse: undefined};
|
|
15838
|
+
|
|
15839
|
+
let resolved = false;
|
|
15840
|
+
const promise = waitForSelfUrlChange();
|
|
15841
|
+
promise.then(() => {
|
|
15842
|
+
resolved = true;
|
|
15843
|
+
});
|
|
15844
|
+
|
|
15845
|
+
fakeClock.tick(5000);
|
|
15846
|
+
await promise;
|
|
15847
|
+
|
|
15848
|
+
assert.isTrue(resolved);
|
|
15849
|
+
});
|
|
15850
|
+
|
|
15851
|
+
it('should return the same promise when called multiple times', () => {
|
|
15852
|
+
meeting.joinWithMediaRetryInfo = {retryCount: 0, prevJoinResponse: undefined};
|
|
15853
|
+
|
|
15854
|
+
const firstPromise = waitForSelfUrlChange();
|
|
15855
|
+
const secondPromise = waitForSelfUrlChange();
|
|
15856
|
+
|
|
15857
|
+
assert.equal(firstPromise, secondPromise);
|
|
15858
|
+
});
|
|
15859
|
+
});
|
|
15860
|
+
|
|
15155
15861
|
describe('preferred video device', () => {
|
|
15156
15862
|
describe('#getVideoDeviceId', () => {
|
|
15157
15863
|
it('returns the preferred video device', () => {
|
|
@@ -17908,4 +18614,4 @@ describe('plugin-meetings', () => {
|
|
|
17908
18614
|
assert.calledOnceWithExactly(meeting.meetingRequest.cancelSipCallOut, participantId);
|
|
17909
18615
|
});
|
|
17910
18616
|
});
|
|
17911
|
-
});
|
|
18617
|
+
});
|