@webex/internal-plugin-metrics 3.8.1 → 3.9.0-webinar5k.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/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +49 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +218 -48
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +6 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +3 -1
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js.map +1 -1
- package/dist/new-metrics.js +43 -1
- package/dist/new-metrics.js.map +1 -1
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +15 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +144 -9
- package/dist/types/call-diagnostic/config.d.ts +2 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/metrics.types.d.ts +17 -6
- package/dist/types/new-metrics.d.ts +19 -2
- package/package.json +12 -12
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +58 -0
- package/src/call-diagnostic/call-diagnostic-metrics.ts +219 -25
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +6 -0
- package/src/call-diagnostic/config.ts +3 -0
- package/src/index.ts +2 -0
- package/src/metrics.types.ts +22 -5
- package/src/new-metrics.ts +52 -1
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +20 -1
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +167 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +425 -38
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +6 -0
- package/test/unit/spec/new-metrics.ts +67 -2
- package/test/unit/spec/prelogin-metrics-batcher.ts +1 -0
- package/dist/call-diagnostic-events-batcher.js +0 -60
- package/dist/call-diagnostic-events-batcher.js.map +0 -1
|
@@ -13,9 +13,12 @@ import {
|
|
|
13
13
|
} from '@webex/internal-plugin-metrics';
|
|
14
14
|
import uuid from 'uuid';
|
|
15
15
|
import {omit} from 'lodash';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import {glob} from 'glob';
|
|
17
|
+
import {expect} from 'chai';
|
|
18
|
+
import {
|
|
19
|
+
ClientEmailInput,
|
|
20
|
+
ClientUserNameInput,
|
|
21
|
+
} from '@webex/internal-plugin-metrics/src/metrics.types';
|
|
19
22
|
|
|
20
23
|
//@ts-ignore
|
|
21
24
|
global.window = {location: {hostname: 'whatever'}};
|
|
@@ -65,14 +68,14 @@ describe('internal-plugin-metrics', () => {
|
|
|
65
68
|
...fakeMeeting,
|
|
66
69
|
id: '4',
|
|
67
70
|
isoLocalClientMeetingJoinTime: 'testTimeString',
|
|
68
|
-
}
|
|
71
|
+
};
|
|
69
72
|
const fakeMeeting5 = {
|
|
70
73
|
...fakeMeeting,
|
|
71
74
|
id: '5',
|
|
72
75
|
correlationId: 'correlationId5',
|
|
73
76
|
sessionCorrelationId: 'sessionCorrelationId5',
|
|
74
77
|
userNameInput: 'test',
|
|
75
|
-
emailInput: 'test@test.com'
|
|
78
|
+
emailInput: 'test@test.com',
|
|
76
79
|
};
|
|
77
80
|
|
|
78
81
|
const fakeMeetings = {
|
|
@@ -182,7 +185,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
182
185
|
publicNetworkPrefix: '1.1.1.1',
|
|
183
186
|
localNetworkPrefix: '1.1.1.1',
|
|
184
187
|
os: getOSNameInternal(),
|
|
185
|
-
osVersion: getOSVersion(),
|
|
188
|
+
osVersion: getOSVersion() || 'unknown',
|
|
186
189
|
subClientType: 'WEB_APP',
|
|
187
190
|
},
|
|
188
191
|
environment: 'meeting_evn',
|
|
@@ -215,7 +218,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
215
218
|
publicNetworkPrefix: '1.1.1.1',
|
|
216
219
|
localNetworkPrefix: '1.1.1.1',
|
|
217
220
|
os: getOSNameInternal(),
|
|
218
|
-
osVersion: getOSVersion(),
|
|
221
|
+
osVersion: getOSVersion() || 'unknown',
|
|
219
222
|
subClientType: 'WEB_APP',
|
|
220
223
|
clientLaunchMethod: 'url-handler',
|
|
221
224
|
},
|
|
@@ -250,7 +253,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
250
253
|
publicNetworkPrefix: '1.1.1.1',
|
|
251
254
|
localNetworkPrefix: '1.1.1.1',
|
|
252
255
|
os: getOSNameInternal(),
|
|
253
|
-
osVersion: getOSVersion(),
|
|
256
|
+
osVersion: getOSVersion() || 'unknown',
|
|
254
257
|
subClientType: 'WEB_APP',
|
|
255
258
|
clientLaunchMethod: 'url-handler',
|
|
256
259
|
},
|
|
@@ -285,7 +288,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
285
288
|
publicNetworkPrefix: '1.1.1.1',
|
|
286
289
|
localNetworkPrefix: '1.1.1.1',
|
|
287
290
|
os: getOSNameInternal(),
|
|
288
|
-
osVersion: getOSVersion(),
|
|
291
|
+
osVersion: getOSVersion() || 'unknown',
|
|
289
292
|
subClientType: 'WEB_APP',
|
|
290
293
|
clientLaunchMethod: 'url-handler',
|
|
291
294
|
browserLaunchMethod: 'thinclient',
|
|
@@ -313,7 +316,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
313
316
|
publicNetworkPrefix: '1.1.1.1',
|
|
314
317
|
localNetworkPrefix: '1.1.1.1',
|
|
315
318
|
os: getOSNameInternal(),
|
|
316
|
-
osVersion: getOSVersion(),
|
|
319
|
+
osVersion: getOSVersion() || 'unknown',
|
|
317
320
|
subClientType: 'WEB_APP',
|
|
318
321
|
},
|
|
319
322
|
name: 'endpoint',
|
|
@@ -342,7 +345,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
342
345
|
majorVersion: 43,
|
|
343
346
|
minorVersion: 9,
|
|
344
347
|
os: getOSNameInternal(),
|
|
345
|
-
osVersion: getOSVersion(),
|
|
348
|
+
osVersion: getOSVersion() || 'unknown',
|
|
346
349
|
subClientType: 'WEB_APP',
|
|
347
350
|
},
|
|
348
351
|
environment: 'meeting_evn',
|
|
@@ -365,7 +368,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
365
368
|
publicNetworkPrefix: '1.3.4.0',
|
|
366
369
|
localNetworkPrefix: undefined,
|
|
367
370
|
os: getOSNameInternal(),
|
|
368
|
-
osVersion: getOSVersion(),
|
|
371
|
+
osVersion: getOSVersion() || 'unknown',
|
|
369
372
|
subClientType: 'WEB_APP',
|
|
370
373
|
},
|
|
371
374
|
name: 'endpoint',
|
|
@@ -823,7 +826,147 @@ describe('internal-plugin-metrics', () => {
|
|
|
823
826
|
meetingId: fakeMeeting.id,
|
|
824
827
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
825
828
|
};
|
|
829
|
+
cd.setMercuryConnectedStatus(true);
|
|
830
|
+
|
|
831
|
+
cd.submitClientEvent({
|
|
832
|
+
name: 'client.alert.displayed',
|
|
833
|
+
options,
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
assert.called(getIdentifiersSpy);
|
|
837
|
+
assert.calledWith(getIdentifiersSpy, {
|
|
838
|
+
meeting: fakeMeeting,
|
|
839
|
+
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
840
|
+
webexConferenceIdStr: undefined,
|
|
841
|
+
sessionCorrelationId: undefined,
|
|
842
|
+
globalMeetingId: undefined,
|
|
843
|
+
});
|
|
844
|
+
assert.notCalled(generateClientEventErrorPayloadSpy);
|
|
845
|
+
assert.calledWith(
|
|
846
|
+
prepareDiagnosticEventSpy,
|
|
847
|
+
{
|
|
848
|
+
canProceed: true,
|
|
849
|
+
eventData: {
|
|
850
|
+
webClientDomain: 'whatever',
|
|
851
|
+
isMercuryConnected: true,
|
|
852
|
+
},
|
|
853
|
+
identifiers: {
|
|
854
|
+
correlationId: 'correlationId',
|
|
855
|
+
deviceId: 'deviceUrl',
|
|
856
|
+
locusId: 'url',
|
|
857
|
+
locusStartTime: 'lastActive',
|
|
858
|
+
locusUrl: 'locus/url',
|
|
859
|
+
mediaAgentAlias: 'alias',
|
|
860
|
+
mediaAgentGroupId: '1',
|
|
861
|
+
orgId: 'orgId',
|
|
862
|
+
userId: 'userId',
|
|
863
|
+
},
|
|
864
|
+
loginType: 'login-ci',
|
|
865
|
+
name: 'client.alert.displayed',
|
|
866
|
+
userType: 'host',
|
|
867
|
+
isConvergedArchitectureEnabled: undefined,
|
|
868
|
+
webexSubServiceType: undefined,
|
|
869
|
+
webClientPreload: undefined,
|
|
870
|
+
},
|
|
871
|
+
options
|
|
872
|
+
);
|
|
873
|
+
assert.calledWith(submitToCallDiagnosticsSpy, {
|
|
874
|
+
event: {
|
|
875
|
+
canProceed: true,
|
|
876
|
+
eventData: {
|
|
877
|
+
webClientDomain: 'whatever',
|
|
878
|
+
isMercuryConnected: true,
|
|
879
|
+
},
|
|
880
|
+
identifiers: {
|
|
881
|
+
correlationId: 'correlationId',
|
|
882
|
+
deviceId: 'deviceUrl',
|
|
883
|
+
locusId: 'url',
|
|
884
|
+
locusStartTime: 'lastActive',
|
|
885
|
+
locusUrl: 'locus/url',
|
|
886
|
+
mediaAgentAlias: 'alias',
|
|
887
|
+
mediaAgentGroupId: '1',
|
|
888
|
+
orgId: 'orgId',
|
|
889
|
+
userId: 'userId',
|
|
890
|
+
},
|
|
891
|
+
loginType: 'login-ci',
|
|
892
|
+
name: 'client.alert.displayed',
|
|
893
|
+
userType: 'host',
|
|
894
|
+
isConvergedArchitectureEnabled: undefined,
|
|
895
|
+
webexSubServiceType: undefined,
|
|
896
|
+
webClientPreload: undefined,
|
|
897
|
+
},
|
|
898
|
+
eventId: 'my-fake-id',
|
|
899
|
+
origin: {
|
|
900
|
+
origin: 'fake-origin',
|
|
901
|
+
},
|
|
902
|
+
originTime: {
|
|
903
|
+
sent: 'not_defined_yet',
|
|
904
|
+
triggered: now.toISOString(),
|
|
905
|
+
},
|
|
906
|
+
senderCountryCode: 'UK',
|
|
907
|
+
version: 1,
|
|
908
|
+
});
|
|
909
|
+
assert.calledWith(validatorSpy, {
|
|
910
|
+
type: 'ce',
|
|
911
|
+
event: {
|
|
912
|
+
event: {
|
|
913
|
+
canProceed: true,
|
|
914
|
+
eventData: {
|
|
915
|
+
webClientDomain: 'whatever',
|
|
916
|
+
isMercuryConnected: true,
|
|
917
|
+
},
|
|
918
|
+
identifiers: {
|
|
919
|
+
correlationId: 'correlationId',
|
|
920
|
+
deviceId: 'deviceUrl',
|
|
921
|
+
locusId: 'url',
|
|
922
|
+
locusStartTime: 'lastActive',
|
|
923
|
+
locusUrl: 'locus/url',
|
|
924
|
+
mediaAgentAlias: 'alias',
|
|
925
|
+
mediaAgentGroupId: '1',
|
|
926
|
+
orgId: 'orgId',
|
|
927
|
+
userId: 'userId',
|
|
928
|
+
},
|
|
929
|
+
loginType: 'login-ci',
|
|
930
|
+
name: 'client.alert.displayed',
|
|
931
|
+
userType: 'host',
|
|
932
|
+
isConvergedArchitectureEnabled: undefined,
|
|
933
|
+
webexSubServiceType: undefined,
|
|
934
|
+
webClientPreload: undefined,
|
|
935
|
+
},
|
|
936
|
+
eventId: 'my-fake-id',
|
|
937
|
+
origin: {
|
|
938
|
+
origin: 'fake-origin',
|
|
939
|
+
},
|
|
940
|
+
originTime: {
|
|
941
|
+
sent: 'not_defined_yet',
|
|
942
|
+
triggered: now.toISOString(),
|
|
943
|
+
},
|
|
944
|
+
senderCountryCode: 'UK',
|
|
945
|
+
version: 1,
|
|
946
|
+
},
|
|
947
|
+
});
|
|
826
948
|
|
|
949
|
+
const webexLoggerLogCalls = webex.logger.log.getCalls();
|
|
950
|
+
assert.deepEqual(webexLoggerLogCalls[1].args, [
|
|
951
|
+
'call-diagnostic-events -> ',
|
|
952
|
+
'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.',
|
|
953
|
+
`name: client.alert.displayed`,
|
|
954
|
+
]);
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
it('should submit client event correctly when mercury is not connected', () => {
|
|
958
|
+
const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
|
|
959
|
+
const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
|
|
960
|
+
const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
|
|
961
|
+
const getIdentifiersSpy = sinon.spy(cd, 'getIdentifiers');
|
|
962
|
+
const getSubServiceTypeSpy = sinon.spy(cd, 'getSubServiceType');
|
|
963
|
+
sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
|
|
964
|
+
const validatorSpy = sinon.spy(cd, 'validator');
|
|
965
|
+
const options = {
|
|
966
|
+
meetingId: fakeMeeting.id,
|
|
967
|
+
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
968
|
+
};
|
|
969
|
+
cd.setMercuryConnectedStatus(false);
|
|
827
970
|
cd.submitClientEvent({
|
|
828
971
|
name: 'client.alert.displayed',
|
|
829
972
|
options,
|
|
@@ -844,6 +987,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
844
987
|
canProceed: true,
|
|
845
988
|
eventData: {
|
|
846
989
|
webClientDomain: 'whatever',
|
|
990
|
+
isMercuryConnected: false,
|
|
847
991
|
},
|
|
848
992
|
identifiers: {
|
|
849
993
|
correlationId: 'correlationId',
|
|
@@ -870,6 +1014,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
870
1014
|
canProceed: true,
|
|
871
1015
|
eventData: {
|
|
872
1016
|
webClientDomain: 'whatever',
|
|
1017
|
+
isMercuryConnected: false,
|
|
873
1018
|
},
|
|
874
1019
|
identifiers: {
|
|
875
1020
|
correlationId: 'correlationId',
|
|
@@ -907,6 +1052,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
907
1052
|
canProceed: true,
|
|
908
1053
|
eventData: {
|
|
909
1054
|
webClientDomain: 'whatever',
|
|
1055
|
+
isMercuryConnected: false,
|
|
910
1056
|
},
|
|
911
1057
|
identifiers: {
|
|
912
1058
|
correlationId: 'correlationId',
|
|
@@ -959,7 +1105,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
959
1105
|
meetingId: fakeMeeting3.id,
|
|
960
1106
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
961
1107
|
};
|
|
962
|
-
|
|
1108
|
+
cd.setMercuryConnectedStatus(true);
|
|
963
1109
|
cd.submitClientEvent({
|
|
964
1110
|
name: 'client.alert.displayed',
|
|
965
1111
|
options,
|
|
@@ -980,6 +1126,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
980
1126
|
canProceed: true,
|
|
981
1127
|
eventData: {
|
|
982
1128
|
webClientDomain: 'whatever',
|
|
1129
|
+
isMercuryConnected: true,
|
|
983
1130
|
},
|
|
984
1131
|
identifiers: {
|
|
985
1132
|
correlationId: 'correlationId3',
|
|
@@ -1007,6 +1154,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1007
1154
|
canProceed: true,
|
|
1008
1155
|
eventData: {
|
|
1009
1156
|
webClientDomain: 'whatever',
|
|
1157
|
+
isMercuryConnected: true,
|
|
1010
1158
|
},
|
|
1011
1159
|
identifiers: {
|
|
1012
1160
|
correlationId: 'correlationId3',
|
|
@@ -1045,6 +1193,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1045
1193
|
canProceed: true,
|
|
1046
1194
|
eventData: {
|
|
1047
1195
|
webClientDomain: 'whatever',
|
|
1196
|
+
isMercuryConnected: true,
|
|
1048
1197
|
},
|
|
1049
1198
|
identifiers: {
|
|
1050
1199
|
correlationId: 'correlationId3',
|
|
@@ -1097,7 +1246,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1097
1246
|
meetingId: fakeMeeting4.id,
|
|
1098
1247
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
1099
1248
|
};
|
|
1100
|
-
|
|
1249
|
+
cd.setMercuryConnectedStatus(true);
|
|
1101
1250
|
cd.submitClientEvent({
|
|
1102
1251
|
name: 'client.alert.displayed',
|
|
1103
1252
|
options,
|
|
@@ -1119,6 +1268,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1119
1268
|
canProceed: true,
|
|
1120
1269
|
eventData: {
|
|
1121
1270
|
webClientDomain: 'whatever',
|
|
1271
|
+
isMercuryConnected: true,
|
|
1122
1272
|
},
|
|
1123
1273
|
identifiers: {
|
|
1124
1274
|
correlationId: 'correlationId',
|
|
@@ -1146,6 +1296,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1146
1296
|
canProceed: true,
|
|
1147
1297
|
eventData: {
|
|
1148
1298
|
webClientDomain: 'whatever',
|
|
1299
|
+
isMercuryConnected: true,
|
|
1149
1300
|
},
|
|
1150
1301
|
identifiers: {
|
|
1151
1302
|
correlationId: 'correlationId',
|
|
@@ -1184,6 +1335,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1184
1335
|
canProceed: true,
|
|
1185
1336
|
eventData: {
|
|
1186
1337
|
webClientDomain: 'whatever',
|
|
1338
|
+
isMercuryConnected: true,
|
|
1187
1339
|
},
|
|
1188
1340
|
identifiers: {
|
|
1189
1341
|
correlationId: 'correlationId',
|
|
@@ -1235,7 +1387,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1235
1387
|
meetingId: fakeMeeting5.id,
|
|
1236
1388
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
1237
1389
|
};
|
|
1238
|
-
|
|
1390
|
+
cd.setMercuryConnectedStatus(true);
|
|
1239
1391
|
cd.submitClientEvent({
|
|
1240
1392
|
name: 'client.alert.displayed',
|
|
1241
1393
|
options,
|
|
@@ -1256,6 +1408,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1256
1408
|
canProceed: true,
|
|
1257
1409
|
eventData: {
|
|
1258
1410
|
webClientDomain: 'whatever',
|
|
1411
|
+
isMercuryConnected: true,
|
|
1259
1412
|
},
|
|
1260
1413
|
identifiers: {
|
|
1261
1414
|
correlationId: 'correlationId5',
|
|
@@ -1285,6 +1438,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1285
1438
|
canProceed: true,
|
|
1286
1439
|
eventData: {
|
|
1287
1440
|
webClientDomain: 'whatever',
|
|
1441
|
+
isMercuryConnected: true,
|
|
1288
1442
|
},
|
|
1289
1443
|
identifiers: {
|
|
1290
1444
|
correlationId: 'correlationId5',
|
|
@@ -1325,6 +1479,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1325
1479
|
canProceed: true,
|
|
1326
1480
|
eventData: {
|
|
1327
1481
|
webClientDomain: 'whatever',
|
|
1482
|
+
isMercuryConnected: true,
|
|
1328
1483
|
},
|
|
1329
1484
|
identifiers: {
|
|
1330
1485
|
correlationId: 'correlationId5',
|
|
@@ -1436,7 +1591,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1436
1591
|
globalMeetingId: 'globalMeetingId1',
|
|
1437
1592
|
sessionCorrelationId: 'sessionCorrelationId1',
|
|
1438
1593
|
};
|
|
1439
|
-
|
|
1594
|
+
cd.setMercuryConnectedStatus(true);
|
|
1440
1595
|
cd.submitClientEvent({
|
|
1441
1596
|
name: 'client.alert.displayed',
|
|
1442
1597
|
options,
|
|
@@ -1457,6 +1612,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1457
1612
|
canProceed: true,
|
|
1458
1613
|
eventData: {
|
|
1459
1614
|
webClientDomain: 'whatever',
|
|
1615
|
+
isMercuryConnected: true,
|
|
1460
1616
|
},
|
|
1461
1617
|
identifiers: {
|
|
1462
1618
|
correlationId: 'correlationId',
|
|
@@ -1470,7 +1626,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1470
1626
|
},
|
|
1471
1627
|
loginType: 'login-ci',
|
|
1472
1628
|
name: 'client.alert.displayed',
|
|
1473
|
-
webClientPreload: undefined
|
|
1629
|
+
webClientPreload: undefined,
|
|
1474
1630
|
},
|
|
1475
1631
|
options
|
|
1476
1632
|
);
|
|
@@ -1479,6 +1635,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1479
1635
|
canProceed: true,
|
|
1480
1636
|
eventData: {
|
|
1481
1637
|
webClientDomain: 'whatever',
|
|
1638
|
+
isMercuryConnected: true,
|
|
1482
1639
|
},
|
|
1483
1640
|
identifiers: {
|
|
1484
1641
|
correlationId: 'correlationId',
|
|
@@ -1492,7 +1649,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1492
1649
|
},
|
|
1493
1650
|
loginType: 'login-ci',
|
|
1494
1651
|
name: 'client.alert.displayed',
|
|
1495
|
-
webClientPreload: undefined
|
|
1652
|
+
webClientPreload: undefined,
|
|
1496
1653
|
},
|
|
1497
1654
|
eventId: 'my-fake-id',
|
|
1498
1655
|
origin: {
|
|
@@ -1524,7 +1681,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1524
1681
|
const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
|
|
1525
1682
|
const getIdentifiersSpy = sinon.spy(cd, 'getIdentifiers');
|
|
1526
1683
|
sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
|
|
1527
|
-
|
|
1684
|
+
cd.setMercuryConnectedStatus(true);
|
|
1528
1685
|
const options = {
|
|
1529
1686
|
correlationId: 'correlationId',
|
|
1530
1687
|
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
@@ -1553,6 +1710,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1553
1710
|
canProceed: true,
|
|
1554
1711
|
eventData: {
|
|
1555
1712
|
webClientDomain: 'whatever',
|
|
1713
|
+
isMercuryConnected: true,
|
|
1556
1714
|
},
|
|
1557
1715
|
identifiers: {
|
|
1558
1716
|
correlationId: 'correlationId',
|
|
@@ -1592,7 +1750,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1592
1750
|
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1593
1751
|
globalMeetingId: 'globalMeetingId1',
|
|
1594
1752
|
},
|
|
1595
|
-
eventData: {webClientDomain: 'whatever'},
|
|
1753
|
+
eventData: {webClientDomain: 'whatever', isMercuryConnected: true},
|
|
1596
1754
|
loginType: 'login-ci',
|
|
1597
1755
|
webClientPreload: undefined,
|
|
1598
1756
|
},
|
|
@@ -1610,7 +1768,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1610
1768
|
const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
|
|
1611
1769
|
const getIdentifiersSpy = sinon.spy(cd, 'getIdentifiers');
|
|
1612
1770
|
sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
|
|
1613
|
-
|
|
1771
|
+
cd.setMercuryConnectedStatus(true);
|
|
1614
1772
|
const options = {
|
|
1615
1773
|
correlationId: 'correlationId',
|
|
1616
1774
|
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
@@ -1641,6 +1799,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1641
1799
|
canProceed: true,
|
|
1642
1800
|
eventData: {
|
|
1643
1801
|
webClientDomain: 'whatever',
|
|
1802
|
+
isMercuryConnected: true,
|
|
1644
1803
|
},
|
|
1645
1804
|
identifiers: {
|
|
1646
1805
|
correlationId: 'correlationId',
|
|
@@ -1682,7 +1841,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1682
1841
|
webexConferenceIdStr: 'webexConferenceIdStr1',
|
|
1683
1842
|
globalMeetingId: 'globalMeetingId1',
|
|
1684
1843
|
},
|
|
1685
|
-
eventData: {webClientDomain: 'whatever'},
|
|
1844
|
+
eventData: {webClientDomain: 'whatever', isMercuryConnected: true},
|
|
1686
1845
|
loginType: 'login-ci',
|
|
1687
1846
|
userNameInput: 'current',
|
|
1688
1847
|
emailInput: 'current',
|
|
@@ -1700,7 +1859,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1700
1859
|
meetingId: fakeMeeting2.id,
|
|
1701
1860
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
1702
1861
|
};
|
|
1703
|
-
|
|
1862
|
+
cd.setMercuryConnectedStatus(true);
|
|
1704
1863
|
cd.submitClientEvent({
|
|
1705
1864
|
name: 'client.alert.displayed',
|
|
1706
1865
|
options,
|
|
@@ -1711,6 +1870,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1711
1870
|
canProceed: true,
|
|
1712
1871
|
eventData: {
|
|
1713
1872
|
webClientDomain: 'whatever',
|
|
1873
|
+
isMercuryConnected: true,
|
|
1714
1874
|
},
|
|
1715
1875
|
identifiers: {
|
|
1716
1876
|
correlationId: 'correlationId2',
|
|
@@ -1752,7 +1912,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1752
1912
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
1753
1913
|
sessionCorrelationId: 'sessionCorrelationId1',
|
|
1754
1914
|
};
|
|
1755
|
-
|
|
1915
|
+
cd.setMercuryConnectedStatus(true);
|
|
1756
1916
|
cd.submitClientEvent({
|
|
1757
1917
|
name: 'client.alert.displayed',
|
|
1758
1918
|
options,
|
|
@@ -1763,6 +1923,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1763
1923
|
canProceed: true,
|
|
1764
1924
|
eventData: {
|
|
1765
1925
|
webClientDomain: 'whatever',
|
|
1926
|
+
isMercuryConnected: true,
|
|
1766
1927
|
},
|
|
1767
1928
|
identifiers: {
|
|
1768
1929
|
correlationId: 'correlationId2',
|
|
@@ -1811,7 +1972,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1811
1972
|
globalMeetingId: 'globalMeetingId1',
|
|
1812
1973
|
sessionCorrelationId: 'sessionCorrelationId1',
|
|
1813
1974
|
};
|
|
1814
|
-
|
|
1975
|
+
cd.setMercuryConnectedStatus(true);
|
|
1815
1976
|
cd.submitClientEvent({
|
|
1816
1977
|
name: 'client.alert.displayed',
|
|
1817
1978
|
options,
|
|
@@ -1824,6 +1985,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1824
1985
|
canProceed: true,
|
|
1825
1986
|
eventData: {
|
|
1826
1987
|
webClientDomain: 'whatever',
|
|
1988
|
+
isMercuryConnected: true,
|
|
1827
1989
|
},
|
|
1828
1990
|
identifiers: {
|
|
1829
1991
|
correlationId: 'correlationId',
|
|
@@ -1846,6 +2008,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1846
2008
|
canProceed: true,
|
|
1847
2009
|
eventData: {
|
|
1848
2010
|
webClientDomain: 'whatever',
|
|
2011
|
+
isMercuryConnected: true,
|
|
1849
2012
|
},
|
|
1850
2013
|
identifiers: {
|
|
1851
2014
|
correlationId: 'correlationId',
|
|
@@ -1889,7 +2052,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1889
2052
|
},
|
|
1890
2053
|
},
|
|
1891
2054
|
};
|
|
1892
|
-
|
|
2055
|
+
cd.setMercuryConnectedStatus(true);
|
|
1893
2056
|
cd.submitClientEvent({
|
|
1894
2057
|
name: 'client.alert.displayed',
|
|
1895
2058
|
options,
|
|
@@ -1900,6 +2063,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1900
2063
|
canProceed: true,
|
|
1901
2064
|
eventData: {
|
|
1902
2065
|
webClientDomain: 'whatever',
|
|
2066
|
+
isMercuryConnected: true,
|
|
1903
2067
|
},
|
|
1904
2068
|
identifiers: {
|
|
1905
2069
|
correlationId: 'correlationId',
|
|
@@ -1968,7 +2132,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1968
2132
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
1969
2133
|
rawError: new Error('bad times'),
|
|
1970
2134
|
};
|
|
1971
|
-
|
|
2135
|
+
cd.setMercuryConnectedStatus(true);
|
|
1972
2136
|
cd.submitClientEvent({
|
|
1973
2137
|
name: 'client.alert.displayed',
|
|
1974
2138
|
options,
|
|
@@ -1979,6 +2143,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
1979
2143
|
canProceed: true,
|
|
1980
2144
|
eventData: {
|
|
1981
2145
|
webClientDomain: 'whatever',
|
|
2146
|
+
isMercuryConnected: true,
|
|
1982
2147
|
},
|
|
1983
2148
|
identifiers: {
|
|
1984
2149
|
correlationId: 'correlationId',
|
|
@@ -2047,7 +2212,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2047
2212
|
correlationId: 'correlationId',
|
|
2048
2213
|
rawError: new Error('bad times'),
|
|
2049
2214
|
};
|
|
2050
|
-
|
|
2215
|
+
cd.setMercuryConnectedStatus(true);
|
|
2051
2216
|
cd.submitClientEvent({
|
|
2052
2217
|
name: 'client.alert.displayed',
|
|
2053
2218
|
options,
|
|
@@ -2058,6 +2223,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2058
2223
|
canProceed: true,
|
|
2059
2224
|
eventData: {
|
|
2060
2225
|
webClientDomain: 'whatever',
|
|
2226
|
+
isMercuryConnected: true,
|
|
2061
2227
|
},
|
|
2062
2228
|
identifiers: {
|
|
2063
2229
|
correlationId: 'correlationId',
|
|
@@ -2124,7 +2290,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2124
2290
|
},
|
|
2125
2291
|
},
|
|
2126
2292
|
};
|
|
2127
|
-
|
|
2293
|
+
cd.setMercuryConnectedStatus(true);
|
|
2128
2294
|
cd.submitClientEvent({
|
|
2129
2295
|
name: 'client.alert.displayed',
|
|
2130
2296
|
options,
|
|
@@ -2135,6 +2301,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2135
2301
|
canProceed: true,
|
|
2136
2302
|
eventData: {
|
|
2137
2303
|
webClientDomain: 'whatever',
|
|
2304
|
+
isMercuryConnected: true,
|
|
2138
2305
|
},
|
|
2139
2306
|
identifiers: {
|
|
2140
2307
|
correlationId: 'correlationId',
|
|
@@ -2194,7 +2361,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2194
2361
|
meetingId: fakeMeeting.id,
|
|
2195
2362
|
mediaConnections: [{mediaAgentAlias: 'alias', mediaAgentGroupId: '1'}],
|
|
2196
2363
|
};
|
|
2197
|
-
|
|
2364
|
+
cd.setMercuryConnectedStatus(true);
|
|
2198
2365
|
cd.submitClientEvent({
|
|
2199
2366
|
name: 'client.alert.displayed',
|
|
2200
2367
|
payload: {
|
|
@@ -2215,6 +2382,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2215
2382
|
canProceed: true,
|
|
2216
2383
|
eventData: {
|
|
2217
2384
|
webClientDomain: 'whatever',
|
|
2385
|
+
isMercuryConnected: true,
|
|
2218
2386
|
},
|
|
2219
2387
|
identifiers: {
|
|
2220
2388
|
correlationId: 'correlationId',
|
|
@@ -2371,7 +2539,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2371
2539
|
applicationSoftwareType: 'webex-js-sdk',
|
|
2372
2540
|
applicationSoftwareVersion: 'webex-version',
|
|
2373
2541
|
mediaEngineSoftwareType: 'browser',
|
|
2374
|
-
mediaEngineSoftwareVersion: getOSVersion(),
|
|
2542
|
+
mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
|
|
2375
2543
|
startTime: now.toISOString(),
|
|
2376
2544
|
},
|
|
2377
2545
|
},
|
|
@@ -2410,7 +2578,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2410
2578
|
applicationSoftwareType: 'webex-js-sdk',
|
|
2411
2579
|
applicationSoftwareVersion: 'webex-version',
|
|
2412
2580
|
mediaEngineSoftwareType: 'browser',
|
|
2413
|
-
mediaEngineSoftwareVersion: getOSVersion(),
|
|
2581
|
+
mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
|
|
2414
2582
|
startTime: now.toISOString(),
|
|
2415
2583
|
},
|
|
2416
2584
|
},
|
|
@@ -2447,7 +2615,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2447
2615
|
applicationSoftwareType: 'webex-js-sdk',
|
|
2448
2616
|
applicationSoftwareVersion: 'webex-version',
|
|
2449
2617
|
mediaEngineSoftwareType: 'browser',
|
|
2450
|
-
mediaEngineSoftwareVersion: getOSVersion(),
|
|
2618
|
+
mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
|
|
2451
2619
|
startTime: now.toISOString(),
|
|
2452
2620
|
},
|
|
2453
2621
|
},
|
|
@@ -2574,7 +2742,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
2574
2742
|
name: 'other',
|
|
2575
2743
|
rawErrorMessage: 'bad times',
|
|
2576
2744
|
errorDescription: 'UnknownError',
|
|
2577
|
-
}
|
|
2745
|
+
};
|
|
2578
2746
|
|
|
2579
2747
|
const [res, cached] = cd.generateClientEventErrorPayload(error);
|
|
2580
2748
|
assert.isFalse(cached);
|
|
@@ -2903,7 +3071,10 @@ describe('internal-plugin-metrics', () => {
|
|
|
2903
3071
|
});
|
|
2904
3072
|
|
|
2905
3073
|
it('should return unknown error otherwise', () => {
|
|
2906
|
-
const [res, cached] = cd.generateClientEventErrorPayload({
|
|
3074
|
+
const [res, cached] = cd.generateClientEventErrorPayload({
|
|
3075
|
+
something: 'new',
|
|
3076
|
+
message: 'bad times',
|
|
3077
|
+
});
|
|
2907
3078
|
assert.deepEqual(res, {
|
|
2908
3079
|
category: 'other',
|
|
2909
3080
|
errorDescription: 'UnknownError',
|
|
@@ -3251,7 +3422,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
3251
3422
|
meetingId: fakeMeeting.id,
|
|
3252
3423
|
preLoginId,
|
|
3253
3424
|
};
|
|
3254
|
-
|
|
3425
|
+
cd.setMercuryConnectedStatus(true);
|
|
3255
3426
|
const triggered = new Date();
|
|
3256
3427
|
const fetchOptions = await cd.buildClientEventFetchRequestOptions({
|
|
3257
3428
|
name: 'client.exit.app',
|
|
@@ -3267,6 +3438,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
3267
3438
|
canProceed: false,
|
|
3268
3439
|
eventData: {
|
|
3269
3440
|
webClientDomain: 'whatever',
|
|
3441
|
+
isMercuryConnected: true,
|
|
3270
3442
|
},
|
|
3271
3443
|
identifiers: {
|
|
3272
3444
|
correlationId: 'correlationId',
|
|
@@ -3294,7 +3466,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
3294
3466
|
localNetworkPrefix: '192.168.1.80',
|
|
3295
3467
|
publicNetworkPrefix: '1.3.4.0',
|
|
3296
3468
|
os: getOSNameInternal() || 'unknown',
|
|
3297
|
-
osVersion: getOSVersion(),
|
|
3469
|
+
osVersion: getOSVersion() || 'unknown',
|
|
3298
3470
|
subClientType: 'WEB_APP',
|
|
3299
3471
|
},
|
|
3300
3472
|
environment: 'meeting_evn',
|
|
@@ -3573,7 +3745,7 @@ describe('internal-plugin-metrics', () => {
|
|
|
3573
3745
|
|
|
3574
3746
|
const overrides = {
|
|
3575
3747
|
correlationId: 'newCorrelationId',
|
|
3576
|
-
}
|
|
3748
|
+
};
|
|
3577
3749
|
|
|
3578
3750
|
cd.submitClientEvent({
|
|
3579
3751
|
name: 'client.alert.displayed',
|
|
@@ -3635,5 +3807,220 @@ describe('internal-plugin-metrics', () => {
|
|
|
3635
3807
|
assert.notCalled(submitClientEventSpy);
|
|
3636
3808
|
});
|
|
3637
3809
|
});
|
|
3810
|
+
|
|
3811
|
+
describe('#submitFeatureEvent', () => {
|
|
3812
|
+
it('should submit feature event successfully with meetingId', () => {
|
|
3813
|
+
const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
|
|
3814
|
+
const submitToCallFeaturesSpy = sinon.spy(cd, 'submitToCallFeatures');
|
|
3815
|
+
sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
|
|
3816
|
+
|
|
3817
|
+
const options = {
|
|
3818
|
+
meetingId: fakeMeeting.id,
|
|
3819
|
+
};
|
|
3820
|
+
cd.setMercuryConnectedStatus(true);
|
|
3821
|
+
|
|
3822
|
+
cd.submitFeatureEvent({
|
|
3823
|
+
name: 'client.feature.meeting.summary',
|
|
3824
|
+
payload: {
|
|
3825
|
+
meetingSummaryInfo: {
|
|
3826
|
+
featureName: 'syncSystemMuteStatus',
|
|
3827
|
+
featureActions: [{
|
|
3828
|
+
actionName: 'syncMeetingMicUnmuteStatusToSystem',
|
|
3829
|
+
actionId: '14200',
|
|
3830
|
+
isInitialValue: false,
|
|
3831
|
+
clickCount: '1'
|
|
3832
|
+
}]
|
|
3833
|
+
},
|
|
3834
|
+
},
|
|
3835
|
+
options,
|
|
3836
|
+
});
|
|
3837
|
+
|
|
3838
|
+
assert.calledWith(
|
|
3839
|
+
prepareDiagnosticEventSpy,
|
|
3840
|
+
{
|
|
3841
|
+
name: 'client.feature.meeting.summary',
|
|
3842
|
+
canProceed: true,
|
|
3843
|
+
identifiers: {
|
|
3844
|
+
correlationId: 'correlationId',
|
|
3845
|
+
userId: 'userId',
|
|
3846
|
+
deviceId: 'deviceUrl',
|
|
3847
|
+
orgId: 'orgId',
|
|
3848
|
+
locusUrl: 'locus/url',
|
|
3849
|
+
locusId: 'url',
|
|
3850
|
+
locusStartTime: 'lastActive',
|
|
3851
|
+
},
|
|
3852
|
+
eventData: { webClientDomain: 'whatever'},
|
|
3853
|
+
userType: 'host',
|
|
3854
|
+
loginType: 'login-ci',
|
|
3855
|
+
isConvergedArchitectureEnabled: undefined,
|
|
3856
|
+
webexSubServiceType: undefined,
|
|
3857
|
+
webClientPreload: undefined,
|
|
3858
|
+
meetingSummaryInfo: {
|
|
3859
|
+
featureName: 'syncSystemMuteStatus',
|
|
3860
|
+
featureActions: [{
|
|
3861
|
+
actionName: 'syncMeetingMicUnmuteStatusToSystem',
|
|
3862
|
+
actionId: '14200',
|
|
3863
|
+
isInitialValue: false,
|
|
3864
|
+
clickCount: '1'
|
|
3865
|
+
}]
|
|
3866
|
+
},
|
|
3867
|
+
key: "UcfFeatureUsage",
|
|
3868
|
+
},
|
|
3869
|
+
options
|
|
3870
|
+
);
|
|
3871
|
+
|
|
3872
|
+
assert.calledWith(submitToCallFeaturesSpy, {
|
|
3873
|
+
eventId: 'my-fake-id',
|
|
3874
|
+
version: 1,
|
|
3875
|
+
origin: {
|
|
3876
|
+
origin: 'fake-origin',
|
|
3877
|
+
},
|
|
3878
|
+
event: {
|
|
3879
|
+
canProceed: true,
|
|
3880
|
+
eventData: { webClientDomain: 'whatever'},
|
|
3881
|
+
identifiers: {
|
|
3882
|
+
correlationId: 'correlationId',
|
|
3883
|
+
deviceId: 'deviceUrl',
|
|
3884
|
+
locusId: 'url',
|
|
3885
|
+
locusStartTime: 'lastActive',
|
|
3886
|
+
locusUrl: 'locus/url',
|
|
3887
|
+
orgId: 'orgId',
|
|
3888
|
+
userId: 'userId',
|
|
3889
|
+
},
|
|
3890
|
+
loginType: 'login-ci',
|
|
3891
|
+
name: 'client.feature.meeting.summary',
|
|
3892
|
+
userType: 'host',
|
|
3893
|
+
isConvergedArchitectureEnabled: undefined,
|
|
3894
|
+
webexSubServiceType: undefined,
|
|
3895
|
+
webClientPreload: undefined,
|
|
3896
|
+
meetingSummaryInfo: {
|
|
3897
|
+
featureName: 'syncSystemMuteStatus',
|
|
3898
|
+
featureActions: [{
|
|
3899
|
+
actionName: 'syncMeetingMicUnmuteStatusToSystem',
|
|
3900
|
+
actionId: '14200',
|
|
3901
|
+
isInitialValue: false,
|
|
3902
|
+
clickCount: '1'
|
|
3903
|
+
}]
|
|
3904
|
+
},
|
|
3905
|
+
key: "UcfFeatureUsage",
|
|
3906
|
+
},
|
|
3907
|
+
originTime: {
|
|
3908
|
+
sent: 'not_defined_yet',
|
|
3909
|
+
triggered: now.toISOString(),
|
|
3910
|
+
},
|
|
3911
|
+
senderCountryCode: 'UK',
|
|
3912
|
+
});
|
|
3913
|
+
|
|
3914
|
+
const webexLoggerLogCalls = webex.logger.log.getCalls();
|
|
3915
|
+
assert.deepEqual(webexLoggerLogCalls[1].args, [
|
|
3916
|
+
'call-diagnostic-events-feature -> ',
|
|
3917
|
+
'CallFeatureMetrics: @submitFeatureEvent. Submit Client Feature Event CA event.',
|
|
3918
|
+
`name: client.feature.meeting.summary`,
|
|
3919
|
+
]);
|
|
3920
|
+
});
|
|
3921
|
+
});
|
|
3922
|
+
|
|
3923
|
+
describe('#submitDelayedClientFeatureEvents', () => {
|
|
3924
|
+
it('does not call submitFeatureEvent if there were no delayed events', () => {
|
|
3925
|
+
const submitFeatureEventSpy = sinon.spy(cd, 'submitFeatureEvent');
|
|
3926
|
+
|
|
3927
|
+
cd.submitDelayedClientFeatureEvents();
|
|
3928
|
+
|
|
3929
|
+
assert.notCalled(submitFeatureEventSpy);
|
|
3930
|
+
});
|
|
3931
|
+
|
|
3932
|
+
it('calls submitFeatureEvent for every delayed event and clears delayedClientFeatureEvents array', () => {
|
|
3933
|
+
const submitFeatureEventSpy = sinon.spy(cd, 'submitFeatureEvent');
|
|
3934
|
+
const submitToCallFeaturesSpy = sinon.spy(cd, 'submitToCallFeatures');
|
|
3935
|
+
|
|
3936
|
+
const options = {
|
|
3937
|
+
meetingId: 'meetingId',
|
|
3938
|
+
};
|
|
3939
|
+
|
|
3940
|
+
cd.submitFeatureEvent({
|
|
3941
|
+
name: 'client.feature.meeting.summary',
|
|
3942
|
+
options,
|
|
3943
|
+
payload: {
|
|
3944
|
+
meetingSummaryInfo: {
|
|
3945
|
+
featureName: 'syncSystemMuteStatus',
|
|
3946
|
+
featureActions: [{
|
|
3947
|
+
actionName: 'syncMeetingMicUnmuteStatusToSystem',
|
|
3948
|
+
actionId: '14200',
|
|
3949
|
+
isInitialValue: false,
|
|
3950
|
+
clickCount: '1'
|
|
3951
|
+
}]
|
|
3952
|
+
},
|
|
3953
|
+
},
|
|
3954
|
+
delaySubmitEvent: true,
|
|
3955
|
+
});
|
|
3956
|
+
|
|
3957
|
+
cd.submitFeatureEvent({
|
|
3958
|
+
name: 'client.feature.meeting.summary',
|
|
3959
|
+
options,
|
|
3960
|
+
payload: {
|
|
3961
|
+
meetingSummaryInfo: {
|
|
3962
|
+
featureName: 'syncSystemVideoStatus',
|
|
3963
|
+
featureActions: [{
|
|
3964
|
+
actionName: 'syncMeetingVideoUnmuteStatusToSystem',
|
|
3965
|
+
actionId: '13400',
|
|
3966
|
+
isInitialValue: false,
|
|
3967
|
+
clickCount: '1'
|
|
3968
|
+
}]
|
|
3969
|
+
},
|
|
3970
|
+
},
|
|
3971
|
+
delaySubmitEvent: true,
|
|
3972
|
+
});
|
|
3973
|
+
|
|
3974
|
+
assert.notCalled(submitToCallFeaturesSpy);
|
|
3975
|
+
assert.calledTwice(submitFeatureEventSpy);
|
|
3976
|
+
submitFeatureEventSpy.resetHistory();
|
|
3977
|
+
|
|
3978
|
+
cd.submitDelayedClientFeatureEvents();
|
|
3979
|
+
|
|
3980
|
+
assert.calledTwice(submitFeatureEventSpy);
|
|
3981
|
+
assert.calledWith(submitFeatureEventSpy.firstCall, {
|
|
3982
|
+
name: 'client.feature.meeting.summary',
|
|
3983
|
+
payload: {
|
|
3984
|
+
meetingSummaryInfo: {
|
|
3985
|
+
featureName: 'syncSystemMuteStatus',
|
|
3986
|
+
featureActions: [{
|
|
3987
|
+
actionName: 'syncMeetingMicUnmuteStatusToSystem',
|
|
3988
|
+
actionId: '14200',
|
|
3989
|
+
isInitialValue: false,
|
|
3990
|
+
clickCount: '1'
|
|
3991
|
+
}]
|
|
3992
|
+
},
|
|
3993
|
+
},
|
|
3994
|
+
options: {
|
|
3995
|
+
meetingId: 'meetingId',
|
|
3996
|
+
triggeredTime: now.toISOString(),
|
|
3997
|
+
},
|
|
3998
|
+
});
|
|
3999
|
+
assert.calledWith(submitFeatureEventSpy.secondCall, {
|
|
4000
|
+
name: 'client.feature.meeting.summary',
|
|
4001
|
+
payload: {
|
|
4002
|
+
meetingSummaryInfo: {
|
|
4003
|
+
featureName: 'syncSystemVideoStatus',
|
|
4004
|
+
featureActions: [{
|
|
4005
|
+
actionName: 'syncMeetingVideoUnmuteStatusToSystem',
|
|
4006
|
+
actionId: '13400',
|
|
4007
|
+
isInitialValue: false,
|
|
4008
|
+
clickCount: '1'
|
|
4009
|
+
}]
|
|
4010
|
+
},
|
|
4011
|
+
},
|
|
4012
|
+
options: {
|
|
4013
|
+
meetingId: 'meetingId',
|
|
4014
|
+
triggeredTime: now.toISOString(),
|
|
4015
|
+
},
|
|
4016
|
+
});
|
|
4017
|
+
submitFeatureEventSpy.resetHistory();
|
|
4018
|
+
|
|
4019
|
+
cd.submitDelayedClientFeatureEvents();
|
|
4020
|
+
|
|
4021
|
+
// should not call submitFeatureEventSpy again if delayedClientFeatureEvents was cleared
|
|
4022
|
+
assert.notCalled(submitFeatureEventSpy);
|
|
4023
|
+
});
|
|
4024
|
+
});
|
|
3638
4025
|
});
|
|
3639
4026
|
});
|