@webex/internal-plugin-metrics 3.11.0 → 3.12.0-metrics-init-fix-2.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.
Files changed (57) hide show
  1. package/dist/automated-user.js +19 -0
  2. package/dist/automated-user.js.map +1 -0
  3. package/dist/batcher.js +3 -0
  4. package/dist/batcher.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +639 -65
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  7. package/dist/call-diagnostic/call-diagnostic-metrics.js +166 -75
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +18 -4
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  11. package/dist/call-diagnostic/config.js +17 -3
  12. package/dist/call-diagnostic/config.js.map +1 -1
  13. package/dist/config.js +1 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/generic-metrics.js +8 -6
  16. package/dist/generic-metrics.js.map +1 -1
  17. package/dist/index.js +22 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/metrics.js +1 -1
  20. package/dist/metrics.types.js +4 -0
  21. package/dist/metrics.types.js.map +1 -1
  22. package/dist/new-metrics.js +69 -23
  23. package/dist/new-metrics.js.map +1 -1
  24. package/dist/prelogin-metrics.js +106 -0
  25. package/dist/prelogin-metrics.js.map +1 -0
  26. package/dist/types/automated-user.d.ts +2 -0
  27. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +208 -5
  28. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +79 -15
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +5 -0
  30. package/dist/types/call-diagnostic/config.d.ts +5 -0
  31. package/dist/types/config.d.ts +1 -0
  32. package/dist/types/index.d.ts +6 -3
  33. package/dist/types/metrics.types.d.ts +6 -4
  34. package/dist/types/new-metrics.d.ts +16 -0
  35. package/dist/types/prelogin-metrics.d.ts +47 -0
  36. package/package.json +12 -11
  37. package/src/automated-user.ts +16 -0
  38. package/src/batcher.js +4 -0
  39. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +800 -75
  40. package/src/call-diagnostic/call-diagnostic-metrics.ts +101 -14
  41. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +22 -2
  42. package/src/call-diagnostic/config.ts +15 -0
  43. package/src/config.js +1 -0
  44. package/src/generic-metrics.ts +6 -6
  45. package/src/index.ts +7 -0
  46. package/src/metrics.types.ts +18 -5
  47. package/src/new-metrics.ts +54 -4
  48. package/src/prelogin-metrics.ts +94 -0
  49. package/test/unit/spec/automated-user.ts +43 -0
  50. package/test/unit/spec/batcher.js +43 -0
  51. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +47 -11
  52. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1550 -416
  53. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +846 -159
  54. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +61 -3
  55. package/test/unit/spec/new-metrics.ts +13 -2
  56. package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
  57. package/test/unit/spec/prelogin-metrics.ts +132 -0
@@ -9,6 +9,7 @@ import {
9
9
  CallDiagnosticMetrics,
10
10
  getOSNameInternal,
11
11
  CallDiagnosticUtils,
12
+ AutomatedUserUtils,
12
13
  config,
13
14
  } from '@webex/internal-plugin-metrics';
14
15
  import uuid from 'uuid';
@@ -34,6 +35,7 @@ describe('internal-plugin-metrics', () => {
34
35
  var now = new Date();
35
36
 
36
37
  let cd: CallDiagnosticMetrics;
38
+ let isAutomatedUserStub: sinon.SinonStub;
37
39
 
38
40
  const fakeMeeting = {
39
41
  id: '1',
@@ -44,6 +46,7 @@ describe('internal-plugin-metrics', () => {
44
46
  locusInfo: {
45
47
  fullState: {
46
48
  lastActive: 'lastActive',
49
+ sessionId: 'locusSessionId',
47
50
  },
48
51
  },
49
52
  meetingInfo: {},
@@ -154,6 +157,7 @@ describe('internal-plugin-metrics', () => {
154
157
  sinon.useFakeTimers(now.getTime());
155
158
  cd = new CallDiagnosticMetrics({}, {parent: webex});
156
159
  sinon.stub(uuid, 'v4').returns('my-fake-id');
160
+ isAutomatedUserStub = sinon.stub(AutomatedUserUtils, 'isAutomatedUser').returns(false);
157
161
  cd.setDeviceInfo(webex.internal.device);
158
162
  });
159
163
 
@@ -390,6 +394,64 @@ describe('internal-plugin-metrics', () => {
390
394
  });
391
395
  });
392
396
 
397
+ it('builds origin correctly with browser details provided by the host client', () => {
398
+ // host resolves wrapper browsers (WebOS, Electron) to the engine that determines capability
399
+ webex.meetings.config.metrics.browser = 'WebOS Browser';
400
+ webex.meetings.config.metrics.browserVersion = '108.0.0.0';
401
+
402
+ //@ts-ignore
403
+ const res = cd.getOrigin(
404
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
405
+ fakeMeeting.id
406
+ );
407
+
408
+ assert.equal(res.clientInfo.browser, 'WebOS Browser');
409
+ assert.equal(res.clientInfo.browserVersion, '108.0.0.0');
410
+ });
411
+
412
+ it('falls back to SDK browser detection when the host provides nothing', () => {
413
+ //@ts-ignore
414
+ const res = cd.getOrigin(
415
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
416
+ fakeMeeting.id
417
+ );
418
+
419
+ assert.equal(res.clientInfo.browser, getBrowserName());
420
+ assert.equal(res.clientInfo.browserVersion, getBrowserVersion());
421
+ });
422
+
423
+ it('builds origin correctly with the browser support flags from config', () => {
424
+ // `false` is the meaningful "unsupported family" signal, so it must survive a truthy check
425
+ webex.meetings.config.metrics.isSupportedBrowserFamily = false;
426
+ webex.meetings.config.metrics.isOutdatedBrowserVersion = true;
427
+
428
+ //@ts-ignore
429
+ const res = cd.getOrigin(
430
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
431
+ fakeMeeting.id
432
+ );
433
+
434
+ assert.deepEqual(res, {
435
+ clientInfo: {
436
+ browser: getBrowserName(),
437
+ browserVersion: getBrowserVersion(),
438
+ clientType: 'TEAMS_CLIENT',
439
+ clientVersion: 'webex-js-sdk/webex-version',
440
+ publicNetworkPrefix: '1.3.4.0',
441
+ localNetworkPrefix: '192.168.1.80',
442
+ os: getOSNameInternal(),
443
+ osVersion: getOSVersion() || 'unknown',
444
+ subClientType: 'WEB_APP',
445
+ isSupportedBrowserFamily: false,
446
+ isOutdatedBrowserVersion: true,
447
+ },
448
+ environment: 'meeting_evn',
449
+ name: 'endpoint',
450
+ networkType: 'unknown',
451
+ userAgent,
452
+ });
453
+ });
454
+
393
455
  it('should build origin correctly with no meeting or stats analyzer', () => {
394
456
  //@ts-ignore
395
457
  const res = cd.getOrigin();
@@ -431,6 +493,7 @@ describe('internal-plugin-metrics', () => {
431
493
  correlationId: 'correlationId',
432
494
  deviceId: 'deviceUrl',
433
495
  locusId: 'url',
496
+ locusSessionId: 'locusSessionId',
434
497
  locusStartTime: 'lastActive',
435
498
  locusUrl: 'locus/url',
436
499
  machineId: 'installationId',
@@ -460,6 +523,7 @@ describe('internal-plugin-metrics', () => {
460
523
  correlationId: 'correlationId',
461
524
  deviceId: 'deviceUrl',
462
525
  locusId: 'url',
526
+ locusSessionId: 'locusSessionId',
463
527
  locusStartTime: 'lastActive',
464
528
  locusUrl: 'locus/url',
465
529
  machineId: 'installationId',
@@ -490,6 +554,7 @@ describe('internal-plugin-metrics', () => {
490
554
  sessionCorrelationId: 'sessionCorrelationId',
491
555
  deviceId: 'deviceUrl',
492
556
  locusId: 'url',
557
+ locusSessionId: 'locusSessionId',
493
558
  locusStartTime: 'lastActive',
494
559
  locusUrl: 'locus/url',
495
560
  machineId: 'installationId',
@@ -519,6 +584,7 @@ describe('internal-plugin-metrics', () => {
519
584
  sessionCorrelationId: 'sessionCorrelationId',
520
585
  deviceId: 'deviceUrl',
521
586
  locusId: 'url',
587
+ locusSessionId: 'locusSessionId',
522
588
  locusStartTime: 'lastActive',
523
589
  locusUrl: 'locus/url',
524
590
  machineId: 'installationId',
@@ -554,6 +620,7 @@ describe('internal-plugin-metrics', () => {
554
620
  globalMeetingId: 'globalMeetingId1',
555
621
  deviceId: 'deviceUrl',
556
622
  locusId: 'url',
623
+ locusSessionId: 'locusSessionId',
557
624
  locusStartTime: 'lastActive',
558
625
  locusUrl: 'locus/url',
559
626
  mediaAgentAlias: 'mediaAgentAlias',
@@ -586,6 +653,7 @@ describe('internal-plugin-metrics', () => {
586
653
  globalMeetingId: 'globalMeetingId1',
587
654
  deviceId: 'deviceUrl',
588
655
  locusId: 'url',
656
+ locusSessionId: 'locusSessionId',
589
657
  locusStartTime: 'lastActive',
590
658
  locusUrl: 'locus/url',
591
659
  mediaAgentAlias: 'mediaAgentAlias',
@@ -620,6 +688,7 @@ describe('internal-plugin-metrics', () => {
620
688
  deviceId: 'deviceUrl',
621
689
  locusId: 'url',
622
690
  locusStartTime: 'lastActive',
691
+ locusSessionId: 'locusSessionId',
623
692
  locusUrl: 'locus/url',
624
693
  mediaAgentAlias: 'mediaAgentAlias',
625
694
  mediaAgentGroupId: 'mediaAgentGroupId',
@@ -655,6 +724,7 @@ describe('internal-plugin-metrics', () => {
655
724
  globalMeetingId: 'globalMeetingId1',
656
725
  deviceId: 'deviceUrl',
657
726
  locusId: 'url',
727
+ locusSessionId: 'locusSessionId',
658
728
  locusStartTime: 'lastActive',
659
729
  locusUrl: 'locus/url',
660
730
  mediaAgentAlias: 'mediaAgentAlias',
@@ -848,6 +918,103 @@ describe('internal-plugin-metrics', () => {
848
918
  });
849
919
  });
850
920
 
921
+ describe('#prepareDiagnosticEvent isAutomatedUser field', () => {
922
+ it('should set isAutomatedUser to false when window is not defined', () => {
923
+ const options = {meetingId: fakeMeeting.id};
924
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
925
+
926
+ const res = cd.prepareDiagnosticEvent(
927
+ {
928
+ canProceed: true,
929
+ identifiers: {correlationId: 'test-id'},
930
+ name: 'client.alert.displayed',
931
+ isAutomatedUser: false,
932
+ userActivation: undefined,
933
+ },
934
+ options
935
+ );
936
+
937
+ // In the test environment, isAutomatedUser should be false since we're not in a webdriver environment
938
+ assert.isFalse(
939
+ res.event.isAutomatedUser,
940
+ 'isAutomatedUser should be false in non-webdriver test environment'
941
+ );
942
+ });
943
+
944
+ it('should include isAutomatedUser field in the returned event', () => {
945
+ const options = {meetingId: fakeMeeting.id};
946
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
947
+
948
+ const res = cd.prepareDiagnosticEvent(
949
+ {
950
+ canProceed: true,
951
+ identifiers: {correlationId: 'test-id'},
952
+ name: 'client.alert.displayed',
953
+ isAutomatedUser: false,
954
+ userActivation: undefined,
955
+ },
956
+ options
957
+ );
958
+
959
+ // Verify the isAutomatedUser field is present in the event
960
+ assert.isDefined(res.event.isAutomatedUser, 'isAutomatedUser field should be defined');
961
+ assert.isBoolean(res.event.isAutomatedUser, 'isAutomatedUser should be a boolean');
962
+ });
963
+
964
+ it('should set isAutomatedUser to true when the user is automated', () => {
965
+ isAutomatedUserStub.returns(true);
966
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
967
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
968
+ cd.setMercuryConnectedStatus(true);
969
+
970
+ cd.submitClientEvent({
971
+ name: 'client.alert.displayed',
972
+ options: {correlationId: 'correlationId'},
973
+ });
974
+
975
+ assert.isTrue(
976
+ prepareDiagnosticEventSpy.firstCall.args[0].isAutomatedUser,
977
+ 'isAutomatedUser should be true for an automated user'
978
+ );
979
+ });
980
+ });
981
+
982
+ describe('#getUserActivation', () => {
983
+ let originalDescriptor;
984
+
985
+ beforeEach(() => {
986
+ originalDescriptor = Object.getOwnPropertyDescriptor(global, 'navigator');
987
+ });
988
+
989
+ afterEach(() => {
990
+ if (originalDescriptor) {
991
+ Object.defineProperty(global, 'navigator', originalDescriptor);
992
+ } else {
993
+ delete (global as any).navigator;
994
+ }
995
+ });
996
+
997
+ it('should return the userActivation state when navigator.userActivation is available', () => {
998
+ Object.defineProperty(global, 'navigator', {
999
+ value: {userActivation: {hasBeenActive: true, isActive: false}},
1000
+ configurable: true,
1001
+ writable: true,
1002
+ });
1003
+
1004
+ assert.deepEqual(cd.getUserActivation(), {hasBeenActive: true, isActive: false});
1005
+ });
1006
+
1007
+ it('should return undefined when navigator.userActivation is not available', () => {
1008
+ Object.defineProperty(global, 'navigator', {
1009
+ value: {},
1010
+ configurable: true,
1011
+ writable: true,
1012
+ });
1013
+
1014
+ assert.isUndefined(cd.getUserActivation());
1015
+ });
1016
+ });
1017
+
851
1018
  describe('#submitClientEvent', () => {
852
1019
  it('should submit client event successfully with meetingId', () => {
853
1020
  const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
@@ -889,6 +1056,7 @@ describe('internal-plugin-metrics', () => {
889
1056
  correlationId: 'correlationId',
890
1057
  deviceId: 'deviceUrl',
891
1058
  locusId: 'url',
1059
+ locusSessionId: 'locusSessionId',
892
1060
  locusStartTime: 'lastActive',
893
1061
  locusUrl: 'locus/url',
894
1062
  mediaAgentAlias: 'alias',
@@ -897,11 +1065,15 @@ describe('internal-plugin-metrics', () => {
897
1065
  userId: 'userId',
898
1066
  },
899
1067
  loginType: 'login-ci',
1068
+ telemetryOptOut: undefined,
900
1069
  name: 'client.alert.displayed',
901
1070
  userType: 'host',
902
1071
  isConvergedArchitectureEnabled: undefined,
903
1072
  webexSubServiceType: undefined,
904
1073
  webClientPreload: undefined,
1074
+ isVipMeeting: false,
1075
+ isAutomatedUser: false,
1076
+ userActivation: undefined,
905
1077
  },
906
1078
  options
907
1079
  );
@@ -916,6 +1088,7 @@ describe('internal-plugin-metrics', () => {
916
1088
  correlationId: 'correlationId',
917
1089
  deviceId: 'deviceUrl',
918
1090
  locusId: 'url',
1091
+ locusSessionId: 'locusSessionId',
919
1092
  locusStartTime: 'lastActive',
920
1093
  locusUrl: 'locus/url',
921
1094
  mediaAgentAlias: 'alias',
@@ -924,11 +1097,15 @@ describe('internal-plugin-metrics', () => {
924
1097
  userId: 'userId',
925
1098
  },
926
1099
  loginType: 'login-ci',
1100
+ telemetryOptOut: undefined,
927
1101
  name: 'client.alert.displayed',
928
1102
  userType: 'host',
929
1103
  isConvergedArchitectureEnabled: undefined,
930
1104
  webexSubServiceType: undefined,
931
1105
  webClientPreload: undefined,
1106
+ isVipMeeting: false,
1107
+ isAutomatedUser: false,
1108
+ userActivation: undefined,
932
1109
  },
933
1110
  eventId: 'my-fake-id',
934
1111
  origin: {
@@ -954,6 +1131,7 @@ describe('internal-plugin-metrics', () => {
954
1131
  correlationId: 'correlationId',
955
1132
  deviceId: 'deviceUrl',
956
1133
  locusId: 'url',
1134
+ locusSessionId: 'locusSessionId',
957
1135
  locusStartTime: 'lastActive',
958
1136
  locusUrl: 'locus/url',
959
1137
  mediaAgentAlias: 'alias',
@@ -962,11 +1140,15 @@ describe('internal-plugin-metrics', () => {
962
1140
  userId: 'userId',
963
1141
  },
964
1142
  loginType: 'login-ci',
1143
+ telemetryOptOut: undefined,
965
1144
  name: 'client.alert.displayed',
966
1145
  userType: 'host',
967
1146
  isConvergedArchitectureEnabled: undefined,
968
1147
  webexSubServiceType: undefined,
969
1148
  webClientPreload: undefined,
1149
+ isVipMeeting: false,
1150
+ isAutomatedUser: false,
1151
+ userActivation: undefined,
970
1152
  },
971
1153
  eventId: 'my-fake-id',
972
1154
  origin: {
@@ -1028,6 +1210,7 @@ describe('internal-plugin-metrics', () => {
1028
1210
  correlationId: 'correlationId',
1029
1211
  deviceId: 'deviceUrl',
1030
1212
  locusId: 'url',
1213
+ locusSessionId: 'locusSessionId',
1031
1214
  locusStartTime: 'lastActive',
1032
1215
  locusUrl: 'locus/url',
1033
1216
  mediaAgentAlias: 'alias',
@@ -1036,11 +1219,15 @@ describe('internal-plugin-metrics', () => {
1036
1219
  userId: 'userId',
1037
1220
  },
1038
1221
  loginType: 'login-ci',
1222
+ telemetryOptOut: undefined,
1039
1223
  name: 'client.alert.displayed',
1040
1224
  userType: 'host',
1041
1225
  isConvergedArchitectureEnabled: undefined,
1042
1226
  webexSubServiceType: undefined,
1043
1227
  webClientPreload: undefined,
1228
+ isVipMeeting: false,
1229
+ isAutomatedUser: false,
1230
+ userActivation: undefined,
1044
1231
  },
1045
1232
  options
1046
1233
  );
@@ -1055,6 +1242,7 @@ describe('internal-plugin-metrics', () => {
1055
1242
  correlationId: 'correlationId',
1056
1243
  deviceId: 'deviceUrl',
1057
1244
  locusId: 'url',
1245
+ locusSessionId: 'locusSessionId',
1058
1246
  locusStartTime: 'lastActive',
1059
1247
  locusUrl: 'locus/url',
1060
1248
  mediaAgentAlias: 'alias',
@@ -1063,11 +1251,15 @@ describe('internal-plugin-metrics', () => {
1063
1251
  userId: 'userId',
1064
1252
  },
1065
1253
  loginType: 'login-ci',
1254
+ telemetryOptOut: undefined,
1066
1255
  name: 'client.alert.displayed',
1067
1256
  userType: 'host',
1068
1257
  isConvergedArchitectureEnabled: undefined,
1069
1258
  webexSubServiceType: undefined,
1070
1259
  webClientPreload: undefined,
1260
+ isVipMeeting: false,
1261
+ isAutomatedUser: false,
1262
+ userActivation: undefined,
1071
1263
  },
1072
1264
  eventId: 'my-fake-id',
1073
1265
  origin: {
@@ -1093,6 +1285,7 @@ describe('internal-plugin-metrics', () => {
1093
1285
  correlationId: 'correlationId',
1094
1286
  deviceId: 'deviceUrl',
1095
1287
  locusId: 'url',
1288
+ locusSessionId: 'locusSessionId',
1096
1289
  locusStartTime: 'lastActive',
1097
1290
  locusUrl: 'locus/url',
1098
1291
  mediaAgentAlias: 'alias',
@@ -1101,11 +1294,15 @@ describe('internal-plugin-metrics', () => {
1101
1294
  userId: 'userId',
1102
1295
  },
1103
1296
  loginType: 'login-ci',
1297
+ telemetryOptOut: undefined,
1104
1298
  name: 'client.alert.displayed',
1105
1299
  userType: 'host',
1106
1300
  isConvergedArchitectureEnabled: undefined,
1107
1301
  webexSubServiceType: undefined,
1108
1302
  webClientPreload: undefined,
1303
+ isVipMeeting: false,
1304
+ isAutomatedUser: false,
1305
+ userActivation: undefined,
1109
1306
  },
1110
1307
  eventId: 'my-fake-id',
1111
1308
  origin: {
@@ -1168,6 +1365,7 @@ describe('internal-plugin-metrics', () => {
1168
1365
  sessionCorrelationId: 'sessionCorrelationId3',
1169
1366
  deviceId: 'deviceUrl',
1170
1367
  locusId: 'url',
1368
+ locusSessionId: 'locusSessionId',
1171
1369
  locusStartTime: 'lastActive',
1172
1370
  locusUrl: 'locus/url',
1173
1371
  mediaAgentAlias: 'alias',
@@ -1176,11 +1374,15 @@ describe('internal-plugin-metrics', () => {
1176
1374
  userId: 'userId',
1177
1375
  },
1178
1376
  loginType: 'login-ci',
1377
+ telemetryOptOut: undefined,
1179
1378
  name: 'client.alert.displayed',
1180
1379
  userType: 'host',
1181
1380
  isConvergedArchitectureEnabled: undefined,
1182
1381
  webexSubServiceType: undefined,
1183
1382
  webClientPreload: undefined,
1383
+ isVipMeeting: false,
1384
+ isAutomatedUser: false,
1385
+ userActivation: undefined,
1184
1386
  },
1185
1387
  options
1186
1388
  );
@@ -1196,6 +1398,7 @@ describe('internal-plugin-metrics', () => {
1196
1398
  sessionCorrelationId: 'sessionCorrelationId3',
1197
1399
  deviceId: 'deviceUrl',
1198
1400
  locusId: 'url',
1401
+ locusSessionId: 'locusSessionId',
1199
1402
  locusStartTime: 'lastActive',
1200
1403
  locusUrl: 'locus/url',
1201
1404
  mediaAgentAlias: 'alias',
@@ -1204,11 +1407,15 @@ describe('internal-plugin-metrics', () => {
1204
1407
  userId: 'userId',
1205
1408
  },
1206
1409
  loginType: 'login-ci',
1410
+ telemetryOptOut: undefined,
1207
1411
  name: 'client.alert.displayed',
1208
1412
  userType: 'host',
1209
1413
  isConvergedArchitectureEnabled: undefined,
1210
1414
  webexSubServiceType: undefined,
1211
1415
  webClientPreload: undefined,
1416
+ isVipMeeting: false,
1417
+ isAutomatedUser: false,
1418
+ userActivation: undefined,
1212
1419
  },
1213
1420
  eventId: 'my-fake-id',
1214
1421
  origin: {
@@ -1235,6 +1442,7 @@ describe('internal-plugin-metrics', () => {
1235
1442
  sessionCorrelationId: 'sessionCorrelationId3',
1236
1443
  deviceId: 'deviceUrl',
1237
1444
  locusId: 'url',
1445
+ locusSessionId: 'locusSessionId',
1238
1446
  locusStartTime: 'lastActive',
1239
1447
  locusUrl: 'locus/url',
1240
1448
  mediaAgentAlias: 'alias',
@@ -1243,11 +1451,15 @@ describe('internal-plugin-metrics', () => {
1243
1451
  userId: 'userId',
1244
1452
  },
1245
1453
  loginType: 'login-ci',
1454
+ telemetryOptOut: undefined,
1246
1455
  name: 'client.alert.displayed',
1247
1456
  userType: 'host',
1248
1457
  isConvergedArchitectureEnabled: undefined,
1249
1458
  webexSubServiceType: undefined,
1250
1459
  webClientPreload: undefined,
1460
+ isVipMeeting: false,
1461
+ isAutomatedUser: false,
1462
+ userActivation: undefined,
1251
1463
  },
1252
1464
  eventId: 'my-fake-id',
1253
1465
  origin: {
@@ -1309,6 +1521,7 @@ describe('internal-plugin-metrics', () => {
1309
1521
  correlationId: 'correlationId',
1310
1522
  deviceId: 'deviceUrl',
1311
1523
  locusId: 'url',
1524
+ locusSessionId: 'locusSessionId',
1312
1525
  locusStartTime: 'lastActive',
1313
1526
  locusUrl: 'locus/url',
1314
1527
  mediaAgentAlias: 'alias',
@@ -1317,11 +1530,15 @@ describe('internal-plugin-metrics', () => {
1317
1530
  userId: 'userId',
1318
1531
  },
1319
1532
  loginType: 'login-ci',
1533
+ telemetryOptOut: undefined,
1320
1534
  webClientPreload: undefined,
1321
1535
  name: 'client.alert.displayed',
1322
1536
  userType: 'host',
1323
1537
  isConvergedArchitectureEnabled: undefined,
1324
1538
  webexSubServiceType: undefined,
1539
+ isVipMeeting: false,
1540
+ isAutomatedUser: false,
1541
+ userActivation: undefined,
1325
1542
  },
1326
1543
  options
1327
1544
  );
@@ -1337,6 +1554,7 @@ describe('internal-plugin-metrics', () => {
1337
1554
  correlationId: 'correlationId',
1338
1555
  deviceId: 'deviceUrl',
1339
1556
  locusId: 'url',
1557
+ locusSessionId: 'locusSessionId',
1340
1558
  locusStartTime: 'lastActive',
1341
1559
  locusUrl: 'locus/url',
1342
1560
  mediaAgentAlias: 'alias',
@@ -1345,11 +1563,15 @@ describe('internal-plugin-metrics', () => {
1345
1563
  userId: 'userId',
1346
1564
  },
1347
1565
  loginType: 'login-ci',
1566
+ telemetryOptOut: undefined,
1348
1567
  webClientPreload: undefined,
1349
1568
  name: 'client.alert.displayed',
1350
1569
  userType: 'host',
1351
1570
  isConvergedArchitectureEnabled: undefined,
1352
1571
  webexSubServiceType: undefined,
1572
+ isVipMeeting: false,
1573
+ isAutomatedUser: false,
1574
+ userActivation: undefined,
1353
1575
  },
1354
1576
  eventId: 'my-fake-id',
1355
1577
  origin: {
@@ -1376,6 +1598,7 @@ describe('internal-plugin-metrics', () => {
1376
1598
  correlationId: 'correlationId',
1377
1599
  deviceId: 'deviceUrl',
1378
1600
  locusId: 'url',
1601
+ locusSessionId: 'locusSessionId',
1379
1602
  locusStartTime: 'lastActive',
1380
1603
  locusUrl: 'locus/url',
1381
1604
  mediaAgentAlias: 'alias',
@@ -1384,11 +1607,15 @@ describe('internal-plugin-metrics', () => {
1384
1607
  userId: 'userId',
1385
1608
  },
1386
1609
  loginType: 'login-ci',
1610
+ telemetryOptOut: undefined,
1387
1611
  webClientPreload: undefined,
1388
1612
  name: 'client.alert.displayed',
1389
1613
  userType: 'host',
1390
1614
  isConvergedArchitectureEnabled: undefined,
1391
1615
  webexSubServiceType: undefined,
1616
+ isVipMeeting: false,
1617
+ isAutomatedUser: false,
1618
+ userActivation: undefined,
1392
1619
  },
1393
1620
  eventId: 'my-fake-id',
1394
1621
  origin: {
@@ -1450,6 +1677,7 @@ describe('internal-plugin-metrics', () => {
1450
1677
  sessionCorrelationId: 'sessionCorrelationId5',
1451
1678
  deviceId: 'deviceUrl',
1452
1679
  locusId: 'url',
1680
+ locusSessionId: 'locusSessionId',
1453
1681
  locusStartTime: 'lastActive',
1454
1682
  locusUrl: 'locus/url',
1455
1683
  mediaAgentAlias: 'alias',
@@ -1458,6 +1686,7 @@ describe('internal-plugin-metrics', () => {
1458
1686
  userId: 'userId',
1459
1687
  },
1460
1688
  loginType: 'login-ci',
1689
+ telemetryOptOut: undefined,
1461
1690
  name: 'client.alert.displayed',
1462
1691
  userType: 'host',
1463
1692
  userNameInput: 'test',
@@ -1465,6 +1694,9 @@ describe('internal-plugin-metrics', () => {
1465
1694
  isConvergedArchitectureEnabled: undefined,
1466
1695
  webexSubServiceType: undefined,
1467
1696
  webClientPreload: undefined,
1697
+ isVipMeeting: false,
1698
+ isAutomatedUser: false,
1699
+ userActivation: undefined,
1468
1700
  },
1469
1701
  options
1470
1702
  );
@@ -1480,6 +1712,7 @@ describe('internal-plugin-metrics', () => {
1480
1712
  sessionCorrelationId: 'sessionCorrelationId5',
1481
1713
  deviceId: 'deviceUrl',
1482
1714
  locusId: 'url',
1715
+ locusSessionId: 'locusSessionId',
1483
1716
  locusStartTime: 'lastActive',
1484
1717
  locusUrl: 'locus/url',
1485
1718
  mediaAgentAlias: 'alias',
@@ -1488,6 +1721,7 @@ describe('internal-plugin-metrics', () => {
1488
1721
  userId: 'userId',
1489
1722
  },
1490
1723
  loginType: 'login-ci',
1724
+ telemetryOptOut: undefined,
1491
1725
  name: 'client.alert.displayed',
1492
1726
  userType: 'host',
1493
1727
  userNameInput: 'test',
@@ -1495,6 +1729,9 @@ describe('internal-plugin-metrics', () => {
1495
1729
  isConvergedArchitectureEnabled: undefined,
1496
1730
  webexSubServiceType: undefined,
1497
1731
  webClientPreload: undefined,
1732
+ isVipMeeting: false,
1733
+ isAutomatedUser: false,
1734
+ userActivation: undefined,
1498
1735
  },
1499
1736
  eventId: 'my-fake-id',
1500
1737
  origin: {
@@ -1521,6 +1758,7 @@ describe('internal-plugin-metrics', () => {
1521
1758
  sessionCorrelationId: 'sessionCorrelationId5',
1522
1759
  deviceId: 'deviceUrl',
1523
1760
  locusId: 'url',
1761
+ locusSessionId: 'locusSessionId',
1524
1762
  locusStartTime: 'lastActive',
1525
1763
  locusUrl: 'locus/url',
1526
1764
  mediaAgentAlias: 'alias',
@@ -1529,6 +1767,7 @@ describe('internal-plugin-metrics', () => {
1529
1767
  userId: 'userId',
1530
1768
  },
1531
1769
  loginType: 'login-ci',
1770
+ telemetryOptOut: undefined,
1532
1771
  name: 'client.alert.displayed',
1533
1772
  userType: 'host',
1534
1773
  userNameInput: 'test',
@@ -1536,6 +1775,9 @@ describe('internal-plugin-metrics', () => {
1536
1775
  isConvergedArchitectureEnabled: undefined,
1537
1776
  webexSubServiceType: undefined,
1538
1777
  webClientPreload: undefined,
1778
+ isVipMeeting: false,
1779
+ isAutomatedUser: false,
1780
+ userActivation: undefined,
1539
1781
  },
1540
1782
  eventId: 'my-fake-id',
1541
1783
  origin: {
@@ -1660,8 +1902,11 @@ describe('internal-plugin-metrics', () => {
1660
1902
  userId: 'userId',
1661
1903
  },
1662
1904
  loginType: 'login-ci',
1905
+ telemetryOptOut: undefined,
1663
1906
  name: 'client.alert.displayed',
1664
1907
  webClientPreload: undefined,
1908
+ isAutomatedUser: false,
1909
+ userActivation: undefined,
1665
1910
  },
1666
1911
  options
1667
1912
  );
@@ -1683,8 +1928,11 @@ describe('internal-plugin-metrics', () => {
1683
1928
  userId: 'userId',
1684
1929
  },
1685
1930
  loginType: 'login-ci',
1931
+ telemetryOptOut: undefined,
1686
1932
  name: 'client.alert.displayed',
1687
1933
  webClientPreload: undefined,
1934
+ isAutomatedUser: false,
1935
+ userActivation: undefined,
1688
1936
  },
1689
1937
  eventId: 'my-fake-id',
1690
1938
  origin: {
@@ -1758,8 +2006,11 @@ describe('internal-plugin-metrics', () => {
1758
2006
  userId: 'myPreLoginId',
1759
2007
  },
1760
2008
  loginType: 'login-ci',
2009
+ telemetryOptOut: undefined,
1761
2010
  name: 'client.alert.displayed',
1762
2011
  webClientPreload: undefined,
2012
+ isAutomatedUser: false,
2013
+ userActivation: undefined,
1763
2014
  },
1764
2015
  options
1765
2016
  );
@@ -1787,7 +2038,10 @@ describe('internal-plugin-metrics', () => {
1787
2038
  },
1788
2039
  eventData: {webClientDomain: 'whatever', isMercuryConnected: true},
1789
2040
  loginType: 'login-ci',
2041
+ telemetryOptOut: undefined,
1790
2042
  webClientPreload: undefined,
2043
+ isAutomatedUser: false,
2044
+ userActivation: undefined,
1791
2045
  },
1792
2046
  },
1793
2047
  options.preLoginId
@@ -1849,8 +2103,11 @@ describe('internal-plugin-metrics', () => {
1849
2103
  userNameInput: 'current',
1850
2104
  emailInput: 'current',
1851
2105
  loginType: 'login-ci',
2106
+ telemetryOptOut: undefined,
1852
2107
  name: 'client.alert.displayed',
1853
2108
  webClientPreload: undefined,
2109
+ isAutomatedUser: false,
2110
+ userActivation: undefined,
1854
2111
  },
1855
2112
  options
1856
2113
  );
@@ -1878,9 +2135,12 @@ describe('internal-plugin-metrics', () => {
1878
2135
  },
1879
2136
  eventData: {webClientDomain: 'whatever', isMercuryConnected: true},
1880
2137
  loginType: 'login-ci',
2138
+ telemetryOptOut: undefined,
1881
2139
  userNameInput: 'current',
1882
2140
  emailInput: 'current',
1883
2141
  webClientPreload: undefined,
2142
+ isAutomatedUser: false,
2143
+ userActivation: undefined,
1884
2144
  },
1885
2145
  },
1886
2146
  options.preLoginId
@@ -1911,6 +2171,7 @@ describe('internal-plugin-metrics', () => {
1911
2171
  correlationId: 'correlationId2',
1912
2172
  deviceId: 'deviceUrl',
1913
2173
  locusId: 'url',
2174
+ locusSessionId: 'locusSessionId',
1914
2175
  locusStartTime: 'lastActive',
1915
2176
  locusUrl: 'locus/url',
1916
2177
  mediaAgentAlias: 'alias',
@@ -1919,12 +2180,16 @@ describe('internal-plugin-metrics', () => {
1919
2180
  userId: 'userId',
1920
2181
  },
1921
2182
  loginType: 'fakeLoginType',
2183
+ telemetryOptOut: undefined,
1922
2184
  name: 'client.alert.displayed',
1923
2185
  userType: 'host',
1924
2186
  joinFlowVersion: 'Other',
1925
2187
  isConvergedArchitectureEnabled: undefined,
1926
2188
  webexSubServiceType: undefined,
1927
2189
  webClientPreload: undefined,
2190
+ isVipMeeting: false,
2191
+ isAutomatedUser: false,
2192
+ userActivation: undefined,
1928
2193
  },
1929
2194
  eventId: 'my-fake-id',
1930
2195
  origin: {
@@ -1965,6 +2230,7 @@ describe('internal-plugin-metrics', () => {
1965
2230
  sessionCorrelationId: 'sessionCorrelationId1',
1966
2231
  deviceId: 'deviceUrl',
1967
2232
  locusId: 'url',
2233
+ locusSessionId: 'locusSessionId',
1968
2234
  locusStartTime: 'lastActive',
1969
2235
  locusUrl: 'locus/url',
1970
2236
  mediaAgentAlias: 'alias',
@@ -1973,12 +2239,16 @@ describe('internal-plugin-metrics', () => {
1973
2239
  userId: 'userId',
1974
2240
  },
1975
2241
  loginType: 'fakeLoginType',
2242
+ telemetryOptOut: undefined,
1976
2243
  name: 'client.alert.displayed',
1977
2244
  userType: 'host',
1978
2245
  joinFlowVersion: 'Other',
1979
2246
  isConvergedArchitectureEnabled: undefined,
1980
2247
  webexSubServiceType: undefined,
1981
2248
  webClientPreload: undefined,
2249
+ isVipMeeting: false,
2250
+ isAutomatedUser: false,
2251
+ userActivation: undefined,
1982
2252
  },
1983
2253
  eventId: 'my-fake-id',
1984
2254
  origin: {
@@ -2033,8 +2303,11 @@ describe('internal-plugin-metrics', () => {
2033
2303
  userId: 'userId',
2034
2304
  },
2035
2305
  loginType: 'login-ci',
2306
+ telemetryOptOut: undefined,
2036
2307
  name: 'client.alert.displayed',
2037
2308
  webClientPreload: true,
2309
+ isAutomatedUser: false,
2310
+ userActivation: undefined,
2038
2311
  },
2039
2312
  options
2040
2313
  );
@@ -2056,8 +2329,221 @@ describe('internal-plugin-metrics', () => {
2056
2329
  userId: 'userId',
2057
2330
  },
2058
2331
  loginType: 'login-ci',
2332
+ telemetryOptOut: undefined,
2059
2333
  name: 'client.alert.displayed',
2060
2334
  webClientPreload: true,
2335
+ isAutomatedUser: false,
2336
+ userActivation: undefined,
2337
+ },
2338
+ eventId: 'my-fake-id',
2339
+ origin: {
2340
+ origin: 'fake-origin',
2341
+ },
2342
+ originTime: {
2343
+ sent: 'not_defined_yet',
2344
+ triggered: now.toISOString(),
2345
+ },
2346
+ senderCountryCode: 'UK',
2347
+ version: 1,
2348
+ });
2349
+ });
2350
+
2351
+ it('should submit client event with isVipMeeting: false when vipMeeting is false', () => {
2352
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
2353
+ const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
2354
+ const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
2355
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
2356
+
2357
+ webex.meetings.getBasicMeetingInformation = sinon.stub().returns({
2358
+ ...fakeMeeting,
2359
+ meetingInfo: {
2360
+ vipmeeting: false,
2361
+ },
2362
+ });
2363
+
2364
+ const options = {
2365
+ correlationId: 'correlationId',
2366
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2367
+ globalMeetingId: 'globalMeetingId1',
2368
+ sessionCorrelationId: 'sessionCorrelationId1',
2369
+ meetingId: fakeMeeting.id,
2370
+ };
2371
+ cd.setMercuryConnectedStatus(true);
2372
+ cd.submitClientEvent({
2373
+ name: 'client.alert.displayed',
2374
+ options,
2375
+ });
2376
+
2377
+ assert.notCalled(generateClientEventErrorPayloadSpy);
2378
+ assert.calledWith(
2379
+ prepareDiagnosticEventSpy,
2380
+ {
2381
+ canProceed: true,
2382
+ eventData: {
2383
+ webClientDomain: 'whatever',
2384
+ isMercuryConnected: true,
2385
+ },
2386
+ identifiers: {
2387
+ correlationId: 'correlationId',
2388
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2389
+ globalMeetingId: 'globalMeetingId1',
2390
+ sessionCorrelationId: 'sessionCorrelationId1',
2391
+ deviceId: 'deviceUrl',
2392
+ locusId: 'url',
2393
+ locusSessionId: 'locusSessionId',
2394
+ locusStartTime: 'lastActive',
2395
+ locusUrl: 'locus/url',
2396
+ orgId: 'orgId',
2397
+ userId: 'userId',
2398
+ },
2399
+ loginType: 'login-ci',
2400
+ telemetryOptOut: undefined,
2401
+ name: 'client.alert.displayed',
2402
+ userType: 'host',
2403
+ isConvergedArchitectureEnabled: undefined,
2404
+ webexSubServiceType: undefined,
2405
+ webClientPreload: undefined,
2406
+ isVipMeeting: false,
2407
+ isAutomatedUser: false,
2408
+ userActivation: undefined,
2409
+ },
2410
+ options
2411
+ );
2412
+ assert.calledWith(submitToCallDiagnosticsSpy, {
2413
+ event: {
2414
+ canProceed: true,
2415
+ eventData: {
2416
+ webClientDomain: 'whatever',
2417
+ isMercuryConnected: true,
2418
+ },
2419
+ identifiers: {
2420
+ correlationId: 'correlationId',
2421
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2422
+ globalMeetingId: 'globalMeetingId1',
2423
+ sessionCorrelationId: 'sessionCorrelationId1',
2424
+ deviceId: 'deviceUrl',
2425
+ locusId: 'url',
2426
+ locusSessionId: 'locusSessionId',
2427
+ locusStartTime: 'lastActive',
2428
+ locusUrl: 'locus/url',
2429
+ orgId: 'orgId',
2430
+ userId: 'userId',
2431
+ },
2432
+ loginType: 'login-ci',
2433
+ telemetryOptOut: undefined,
2434
+ name: 'client.alert.displayed',
2435
+ userType: 'host',
2436
+ isConvergedArchitectureEnabled: undefined,
2437
+ webexSubServiceType: undefined,
2438
+ webClientPreload: undefined,
2439
+ isVipMeeting: false,
2440
+ isAutomatedUser: false,
2441
+ userActivation: undefined,
2442
+ },
2443
+ eventId: 'my-fake-id',
2444
+ origin: {
2445
+ origin: 'fake-origin',
2446
+ },
2447
+ originTime: {
2448
+ sent: 'not_defined_yet',
2449
+ triggered: now.toISOString(),
2450
+ },
2451
+ senderCountryCode: 'UK',
2452
+ version: 1,
2453
+ });
2454
+ });
2455
+
2456
+ it('should submit client event with isVipMeeting: true when vipMeeting is true', () => {
2457
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
2458
+ const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
2459
+ const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
2460
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
2461
+
2462
+ webex.meetings.getBasicMeetingInformation = sinon.stub().returns({
2463
+ ...fakeMeeting,
2464
+ meetingInfo: {
2465
+ vipmeeting: true,
2466
+ },
2467
+ });
2468
+
2469
+ const options = {
2470
+ correlationId: 'correlationId',
2471
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2472
+ globalMeetingId: 'globalMeetingId1',
2473
+ sessionCorrelationId: 'sessionCorrelationId1',
2474
+ meetingId: fakeMeeting.id,
2475
+ };
2476
+ cd.setMercuryConnectedStatus(true);
2477
+ cd.submitClientEvent({
2478
+ name: 'client.alert.displayed',
2479
+ options,
2480
+ });
2481
+
2482
+ assert.notCalled(generateClientEventErrorPayloadSpy);
2483
+ assert.calledWith(
2484
+ prepareDiagnosticEventSpy,
2485
+ {
2486
+ canProceed: true,
2487
+ eventData: {
2488
+ webClientDomain: 'whatever',
2489
+ isMercuryConnected: true,
2490
+ },
2491
+ identifiers: {
2492
+ correlationId: 'correlationId',
2493
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2494
+ globalMeetingId: 'globalMeetingId1',
2495
+ sessionCorrelationId: 'sessionCorrelationId1',
2496
+ deviceId: 'deviceUrl',
2497
+ locusId: 'url',
2498
+ locusSessionId: 'locusSessionId',
2499
+ locusStartTime: 'lastActive',
2500
+ locusUrl: 'locus/url',
2501
+ orgId: 'orgId',
2502
+ userId: 'userId',
2503
+ },
2504
+ loginType: 'login-ci',
2505
+ telemetryOptOut: undefined,
2506
+ name: 'client.alert.displayed',
2507
+ userType: 'host',
2508
+ isConvergedArchitectureEnabled: undefined,
2509
+ webexSubServiceType: undefined,
2510
+ webClientPreload: undefined,
2511
+ isVipMeeting: true,
2512
+ isAutomatedUser: false,
2513
+ userActivation: undefined,
2514
+ },
2515
+ options
2516
+ );
2517
+ assert.calledWith(submitToCallDiagnosticsSpy, {
2518
+ event: {
2519
+ canProceed: true,
2520
+ eventData: {
2521
+ webClientDomain: 'whatever',
2522
+ isMercuryConnected: true,
2523
+ },
2524
+ identifiers: {
2525
+ correlationId: 'correlationId',
2526
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2527
+ globalMeetingId: 'globalMeetingId1',
2528
+ sessionCorrelationId: 'sessionCorrelationId1',
2529
+ deviceId: 'deviceUrl',
2530
+ locusId: 'url',
2531
+ locusSessionId: 'locusSessionId',
2532
+ locusStartTime: 'lastActive',
2533
+ locusUrl: 'locus/url',
2534
+ orgId: 'orgId',
2535
+ userId: 'userId',
2536
+ },
2537
+ loginType: 'login-ci',
2538
+ telemetryOptOut: undefined,
2539
+ name: 'client.alert.displayed',
2540
+ userType: 'host',
2541
+ isConvergedArchitectureEnabled: undefined,
2542
+ webexSubServiceType: undefined,
2543
+ webClientPreload: undefined,
2544
+ isVipMeeting: true,
2545
+ isAutomatedUser: false,
2546
+ userActivation: undefined,
2061
2547
  },
2062
2548
  eventId: 'my-fake-id',
2063
2549
  origin: {
@@ -2106,6 +2592,7 @@ describe('internal-plugin-metrics', () => {
2106
2592
  globalMeetingId: 'globalMeetingId1',
2107
2593
  deviceId: 'deviceUrl',
2108
2594
  locusId: 'url',
2595
+ locusSessionId: 'locusSessionId',
2109
2596
  locusStartTime: 'lastActive',
2110
2597
  locusUrl: 'locus/url',
2111
2598
  mediaAgentAlias: 'alias',
@@ -2126,11 +2613,15 @@ describe('internal-plugin-metrics', () => {
2126
2613
  },
2127
2614
  ],
2128
2615
  loginType: 'login-ci',
2616
+ telemetryOptOut: undefined,
2129
2617
  name: 'client.alert.displayed',
2130
2618
  userType: 'host',
2131
2619
  isConvergedArchitectureEnabled: undefined,
2132
2620
  webexSubServiceType: undefined,
2133
2621
  webClientPreload: undefined,
2622
+ isVipMeeting: false,
2623
+ isAutomatedUser: false,
2624
+ userActivation: undefined,
2134
2625
  },
2135
2626
  eventId: 'my-fake-id',
2136
2627
  origin: {
@@ -2184,6 +2675,7 @@ describe('internal-plugin-metrics', () => {
2184
2675
  correlationId: 'correlationId',
2185
2676
  deviceId: 'deviceUrl',
2186
2677
  locusId: 'url',
2678
+ locusSessionId: 'locusSessionId',
2187
2679
  locusStartTime: 'lastActive',
2188
2680
  locusUrl: 'locus/url',
2189
2681
  mediaAgentAlias: 'alias',
@@ -2207,11 +2699,15 @@ describe('internal-plugin-metrics', () => {
2207
2699
  },
2208
2700
  ],
2209
2701
  loginType: 'login-ci',
2702
+ telemetryOptOut: undefined,
2210
2703
  name: 'client.alert.displayed',
2211
2704
  userType: 'host',
2212
2705
  isConvergedArchitectureEnabled: undefined,
2213
2706
  webexSubServiceType: undefined,
2214
2707
  webClientPreload: undefined,
2708
+ isVipMeeting: false,
2709
+ isAutomatedUser: false,
2710
+ userActivation: undefined,
2215
2711
  },
2216
2712
  eventId: 'my-fake-id',
2217
2713
  origin: {
@@ -2283,8 +2779,11 @@ describe('internal-plugin-metrics', () => {
2283
2779
  },
2284
2780
  ],
2285
2781
  loginType: 'login-ci',
2782
+ telemetryOptOut: undefined,
2286
2783
  name: 'client.alert.displayed',
2287
2784
  webClientPreload: undefined,
2785
+ isAutomatedUser: false,
2786
+ userActivation: undefined,
2288
2787
  },
2289
2788
  eventId: 'my-fake-id',
2290
2789
  origin: {
@@ -2358,8 +2857,11 @@ describe('internal-plugin-metrics', () => {
2358
2857
  },
2359
2858
  ],
2360
2859
  loginType: 'login-ci',
2860
+ telemetryOptOut: undefined,
2361
2861
  name: 'client.alert.displayed',
2362
2862
  webClientPreload: undefined,
2863
+ isAutomatedUser: false,
2864
+ userActivation: undefined,
2363
2865
  },
2364
2866
  eventId: 'my-fake-id',
2365
2867
  origin: {
@@ -2423,6 +2925,7 @@ describe('internal-plugin-metrics', () => {
2423
2925
  correlationId: 'correlationId',
2424
2926
  deviceId: 'deviceUrl',
2425
2927
  locusId: 'url',
2928
+ locusSessionId: 'locusSessionId',
2426
2929
  locusStartTime: 'lastActive',
2427
2930
  locusUrl: 'locus/url',
2428
2931
  mediaAgentAlias: 'alias',
@@ -2439,11 +2942,15 @@ describe('internal-plugin-metrics', () => {
2439
2942
  },
2440
2943
  ],
2441
2944
  loginType: 'login-ci',
2945
+ telemetryOptOut: undefined,
2442
2946
  name: 'client.alert.displayed',
2443
2947
  userType: 'host',
2444
2948
  isConvergedArchitectureEnabled: undefined,
2445
2949
  webexSubServiceType: undefined,
2446
2950
  webClientPreload: undefined,
2951
+ isVipMeeting: false,
2952
+ isAutomatedUser: false,
2953
+ userActivation: undefined,
2447
2954
  },
2448
2955
  eventId: 'my-fake-id',
2449
2956
  origin: {
@@ -2534,16 +3041,18 @@ describe('internal-plugin-metrics', () => {
2534
3041
  });
2535
3042
 
2536
3043
  assert.calledThrice(submitToCallDiagnosticsStub);
2537
- });
3044
+ });
2538
3045
 
2539
- ([
2540
- ['client.media.render.start'],
2541
- ['client.media.render.stop'],
2542
- ['client.media.rx.start'],
2543
- ['client.media.rx.stop'],
2544
- ['client.media.tx.start'],
2545
- ['client.media.tx.stop']
2546
- ] as const).forEach(([name]) => {
3046
+ (
3047
+ [
3048
+ ['client.media.render.start'],
3049
+ ['client.media.render.stop'],
3050
+ ['client.media.rx.start'],
3051
+ ['client.media.rx.stop'],
3052
+ ['client.media.tx.start'],
3053
+ ['client.media.tx.stop'],
3054
+ ] as const
3055
+ ).forEach(([name]) => {
2547
3056
  it(`should only send ${name} once per mediaType`, () => {
2548
3057
  const options = {
2549
3058
  meetingId: fakeMeeting.id,
@@ -2587,7 +3096,8 @@ describe('internal-plugin-metrics', () => {
2587
3096
  });
2588
3097
 
2589
3098
  assert.notCalled(submitToCallDiagnosticsStub);
2590
- assert.neverCalledWithMatch(webex.logger.log,
3099
+ assert.neverCalledWithMatch(
3100
+ webex.logger.log,
2591
3101
  'call-diagnostic-events -> ',
2592
3102
  sinon.match(createEventLimitRegex(name, 'mediaType video'))
2593
3103
  );
@@ -2630,7 +3140,7 @@ describe('internal-plugin-metrics', () => {
2630
3140
  // Send event with different shareInstanceId
2631
3141
  cd.submitClientEvent({
2632
3142
  name,
2633
- payload: { ...payload, shareInstanceId: 'instance-2' },
3143
+ payload: {...payload, shareInstanceId: 'instance-2'},
2634
3144
  options,
2635
3145
  });
2636
3146
 
@@ -2638,89 +3148,88 @@ describe('internal-plugin-metrics', () => {
2638
3148
  });
2639
3149
  });
2640
3150
 
2641
- ([
2642
- ['client.roap-message.received'],
2643
- ['client.roap-message.sent']
2644
- ] as const).forEach(([name]) => {
2645
- it(`should not send third event of same type and not log warning again for ${name}`, () => {
2646
- const options = {
2647
- meetingId: fakeMeeting.id,
2648
- };
2649
- const payload = {
2650
- roap: {
2651
- messageType: 'OFFER' as const,
2652
- },
2653
- };
2654
- const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
2655
-
2656
- // Clear any existing call history to get accurate counts
2657
- webex.logger.log.resetHistory();
2658
-
2659
- // Send first event
2660
- cd.submitClientEvent({
2661
- name,
2662
- payload,
2663
- options,
2664
- });
2665
-
2666
- assert.calledOnce(submitToCallDiagnosticsStub);
2667
- submitToCallDiagnosticsStub.resetHistory();
2668
-
2669
- // Send second event (should trigger warning)
2670
- cd.submitClientEvent({
2671
- name,
2672
- payload,
2673
- options,
2674
- });
2675
-
2676
- assert.notCalled(submitToCallDiagnosticsStub);
2677
- assert.calledWith(
2678
- webex.logger.log,
2679
- 'call-diagnostic-events -> ',
2680
- sinon.match(createEventLimitRegex(name, 'ROAP type OFFER'))
2681
- );
2682
- webex.logger.log.resetHistory();
2683
-
2684
- cd.submitClientEvent({
2685
- name,
2686
- payload,
2687
- options,
3151
+ ([['client.roap-message.received'], ['client.roap-message.sent']] as const).forEach(
3152
+ ([name]) => {
3153
+ it(`should not send third event of same type and not log warning again for ${name}`, () => {
3154
+ const options = {
3155
+ meetingId: fakeMeeting.id,
3156
+ };
3157
+ const payload = {
3158
+ roap: {
3159
+ messageType: 'OFFER' as const,
3160
+ },
3161
+ };
3162
+ const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
3163
+
3164
+ // Clear any existing call history to get accurate counts
3165
+ webex.logger.log.resetHistory();
3166
+
3167
+ // Send first event
3168
+ cd.submitClientEvent({
3169
+ name,
3170
+ payload,
3171
+ options,
3172
+ });
3173
+
3174
+ assert.calledOnce(submitToCallDiagnosticsStub);
3175
+ submitToCallDiagnosticsStub.resetHistory();
3176
+
3177
+ // Send second event (should trigger warning)
3178
+ cd.submitClientEvent({
3179
+ name,
3180
+ payload,
3181
+ options,
3182
+ });
3183
+
3184
+ assert.notCalled(submitToCallDiagnosticsStub);
3185
+ assert.calledWith(
3186
+ webex.logger.log,
3187
+ 'call-diagnostic-events -> ',
3188
+ sinon.match(createEventLimitRegex(name, 'ROAP type OFFER'))
3189
+ );
3190
+ webex.logger.log.resetHistory();
3191
+
3192
+ cd.submitClientEvent({
3193
+ name,
3194
+ payload,
3195
+ options,
3196
+ });
3197
+
3198
+ assert.notCalled(submitToCallDiagnosticsStub);
3199
+ assert.neverCalledWithMatch(
3200
+ webex.logger.log,
3201
+ 'call-diagnostic-events -> ',
3202
+ sinon.match(createEventLimitRegex(name, 'ROAP type OFFER'))
3203
+ );
2688
3204
  });
2689
3205
 
2690
- assert.notCalled(submitToCallDiagnosticsStub);
2691
- assert.neverCalledWithMatch(
2692
- webex.logger.log,
2693
- 'call-diagnostic-events -> ',
2694
- sinon.match(createEventLimitRegex(name, 'ROAP type OFFER'))
2695
- );
2696
- });
3206
+ it(`should handle roap.type instead of roap.messageType for ${name}`, () => {
3207
+ const options = {
3208
+ meetingId: fakeMeeting.id,
3209
+ };
3210
+ const payload = {
3211
+ roap: {
3212
+ type: 'ANSWER' as const,
3213
+ },
3214
+ };
3215
+ const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
2697
3216
 
2698
- it(`should handle roap.type instead of roap.messageType for ${name}`, () => {
2699
- const options = {
2700
- meetingId: fakeMeeting.id,
2701
- };
2702
- const payload = {
2703
- roap: {
2704
- type: 'ANSWER' as const,
2705
- },
2706
- };
2707
- const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
3217
+ cd.submitClientEvent({
3218
+ name,
3219
+ payload,
3220
+ options,
3221
+ });
2708
3222
 
2709
- cd.submitClientEvent({
2710
- name,
2711
- payload,
2712
- options,
2713
- });
3223
+ cd.submitClientEvent({
3224
+ name,
3225
+ payload,
3226
+ options,
3227
+ });
2714
3228
 
2715
- cd.submitClientEvent({
2716
- name,
2717
- payload,
2718
- options,
3229
+ assert.calledOnce(submitToCallDiagnosticsStub);
2719
3230
  });
2720
-
2721
- assert.calledOnce(submitToCallDiagnosticsStub);
2722
- });
2723
- });
3231
+ }
3232
+ );
2724
3233
  });
2725
3234
  });
2726
3235
 
@@ -2731,7 +3240,10 @@ describe('internal-plugin-metrics', () => {
2731
3240
  cd.callDiagnosticEventsBatcher = {request: requestStub};
2732
3241
  //@ts-ignore
2733
3242
  cd.submitToCallDiagnostics({event: 'test'});
2734
- assert.calledWith(requestStub, {eventPayload: {event: 'test'}, type: ['diagnostic-event']});
3243
+ assert.calledWith(requestStub, {
3244
+ eventPayload: {event: 'test'},
3245
+ type: ['diagnostic-event'],
3246
+ });
2735
3247
  });
2736
3248
  });
2737
3249
 
@@ -2784,6 +3296,7 @@ describe('internal-plugin-metrics', () => {
2784
3296
  orgId: 'orgId',
2785
3297
  locusUrl: 'locus/url',
2786
3298
  locusId: 'url',
3299
+ locusSessionId: 'locusSessionId',
2787
3300
  locusStartTime: 'lastActive',
2788
3301
  },
2789
3302
  eventData: {webClientDomain: 'whatever'},
@@ -2799,6 +3312,7 @@ describe('internal-plugin-metrics', () => {
2799
3312
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
2800
3313
  startTime: now.toISOString(),
2801
3314
  },
3315
+ webexSubServiceType: undefined,
2802
3316
  },
2803
3317
  options
2804
3318
  );
@@ -2823,6 +3337,7 @@ describe('internal-plugin-metrics', () => {
2823
3337
  orgId: 'orgId',
2824
3338
  locusUrl: 'locus/url',
2825
3339
  locusId: 'url',
3340
+ locusSessionId: 'locusSessionId',
2826
3341
  locusStartTime: 'lastActive',
2827
3342
  },
2828
3343
  eventData: {webClientDomain: 'whatever'},
@@ -2838,6 +3353,7 @@ describe('internal-plugin-metrics', () => {
2838
3353
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
2839
3354
  startTime: now.toISOString(),
2840
3355
  },
3356
+ webexSubServiceType: undefined,
2841
3357
  },
2842
3358
  },
2843
3359
  });
@@ -2860,6 +3376,7 @@ describe('internal-plugin-metrics', () => {
2860
3376
  orgId: 'orgId',
2861
3377
  locusUrl: 'locus/url',
2862
3378
  locusId: 'url',
3379
+ locusSessionId: 'locusSessionId',
2863
3380
  locusStartTime: 'lastActive',
2864
3381
  },
2865
3382
  eventData: {webClientDomain: 'whatever'},
@@ -2875,10 +3392,48 @@ describe('internal-plugin-metrics', () => {
2875
3392
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
2876
3393
  startTime: now.toISOString(),
2877
3394
  },
3395
+ webexSubServiceType: undefined,
2878
3396
  },
2879
3397
  });
2880
3398
  });
2881
3399
 
3400
+ it('includes webexSubServiceType in the media quality event payload', () => {
3401
+ const meeting = {
3402
+ ...fakeMeeting,
3403
+ meetingInfo: {
3404
+ enableConvergedArchitecture: true,
3405
+ enableEvent: true,
3406
+ enableConvergedWebinarLargeScale: true,
3407
+ },
3408
+ };
3409
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
3410
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
3411
+ webex.meetings.getBasicMeetingInformation = sinon.stub().returns(meeting);
3412
+
3413
+ const options = {
3414
+ networkType: 'wifi' as const,
3415
+ meetingId: fakeMeeting.id,
3416
+ };
3417
+
3418
+ cd.submitMQE({
3419
+ name: 'client.mediaquality.event',
3420
+ payload: {
3421
+ //@ts-ignore
3422
+ intervals: [{}],
3423
+ },
3424
+ options,
3425
+ });
3426
+
3427
+ assert.calledOnceWithExactly(
3428
+ prepareDiagnosticEventSpy,
3429
+ sinon.match({
3430
+ name: 'client.mediaquality.event',
3431
+ webexSubServiceType: 'LargeScaleWebinar',
3432
+ }),
3433
+ options
3434
+ );
3435
+ });
3436
+
2882
3437
  it('throws if meeting id not provided', () => {
2883
3438
  assert.throws(() =>
2884
3439
  cd.submitMQE({
@@ -3599,6 +4154,97 @@ describe('internal-plugin-metrics', () => {
3599
4154
  });
3600
4155
  });
3601
4156
 
4157
+ describe('#getTelemetryOptOut', () => {
4158
+ it('returns "manual" when manual telemetry opt-out is enabled', () => {
4159
+ cd.setIsTelemetryOptOutManual(true);
4160
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4161
+ });
4162
+
4163
+ it('returns "automatic" when automatic telemetry opt-out is enabled', () => {
4164
+ cd.setIsTelemetryOptOutAutomatic(true);
4165
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4166
+ });
4167
+
4168
+ it('returns "manual" when manual opt-out takes precedence over automatic', () => {
4169
+ cd.setIsTelemetryOptOutManual(true);
4170
+ cd.setIsTelemetryOptOutAutomatic(true);
4171
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4172
+ });
4173
+
4174
+ it('returns undefined when neither manual nor automatic opt-out is set', () => {
4175
+ assert.isUndefined(cd.getTelemetryOptOut());
4176
+ });
4177
+
4178
+ it('returns undefined after disabling manual opt-out', () => {
4179
+ cd.setIsTelemetryOptOutManual(true);
4180
+ cd.setIsTelemetryOptOutManual(false);
4181
+ assert.isUndefined(cd.getTelemetryOptOut());
4182
+ });
4183
+ });
4184
+
4185
+ describe('#setIsTelemetryOptOutManual', () => {
4186
+ it('sets manual telemetry opt-out to true', () => {
4187
+ cd.setIsTelemetryOptOutManual(true);
4188
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4189
+ });
4190
+
4191
+ it('sets manual telemetry opt-out to false', () => {
4192
+ cd.setIsTelemetryOptOutManual(true);
4193
+ cd.setIsTelemetryOptOutManual(false);
4194
+ assert.isUndefined(cd.getTelemetryOptOut());
4195
+ });
4196
+
4197
+ it('can toggle manual telemetry opt-out multiple times', () => {
4198
+ cd.setIsTelemetryOptOutManual(true);
4199
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4200
+
4201
+ cd.setIsTelemetryOptOutManual(false);
4202
+ assert.isUndefined(cd.getTelemetryOptOut());
4203
+
4204
+ cd.setIsTelemetryOptOutManual(true);
4205
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4206
+ });
4207
+
4208
+ it('manual opt-out takes precedence when automatic is also set', () => {
4209
+ cd.setIsTelemetryOptOutAutomatic(true);
4210
+ cd.setIsTelemetryOptOutManual(true);
4211
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4212
+ });
4213
+ });
4214
+
4215
+ describe('#setIsTelemetryOptOutAutomatic', () => {
4216
+ it('sets automatic telemetry opt-out to true', () => {
4217
+ cd.setIsTelemetryOptOutAutomatic(true);
4218
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4219
+ });
4220
+
4221
+ it('sets automatic telemetry opt-out to false', () => {
4222
+ cd.setIsTelemetryOptOutAutomatic(true);
4223
+ cd.setIsTelemetryOptOutAutomatic(false);
4224
+ assert.isUndefined(cd.getTelemetryOptOut());
4225
+ });
4226
+
4227
+ it('can toggle automatic telemetry opt-out multiple times', () => {
4228
+ cd.setIsTelemetryOptOutAutomatic(true);
4229
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4230
+
4231
+ cd.setIsTelemetryOptOutAutomatic(false);
4232
+ assert.isUndefined(cd.getTelemetryOptOut());
4233
+
4234
+ cd.setIsTelemetryOptOutAutomatic(true);
4235
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4236
+ });
4237
+
4238
+ it('does not override manual opt-out', () => {
4239
+ cd.setIsTelemetryOptOutManual(true);
4240
+ cd.setIsTelemetryOptOutAutomatic(true);
4241
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4242
+
4243
+ cd.setIsTelemetryOptOutAutomatic(false);
4244
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4245
+ });
4246
+ });
4247
+
3602
4248
  describe('#getSubServiceType', () => {
3603
4249
  it('returns subServicetype as PMR when PMR meeting', () => {
3604
4250
  fakeMeeting.meetingInfo = {
@@ -3648,6 +4294,15 @@ describe('internal-plugin-metrics', () => {
3648
4294
  assert.deepEqual(cd.getSubServiceType(fakeMeeting), 'Webcast');
3649
4295
  });
3650
4296
 
4297
+ it('returns subServicetype as LargeScaleWebinar when meeting is converged Webinar and enable large scale', () => {
4298
+ fakeMeeting.meetingInfo = {
4299
+ enableEvent: true,
4300
+ enableConvergedArchitecture: true,
4301
+ enableConvergedWebinarLargeScale: true,
4302
+ };
4303
+ assert.deepEqual(cd.getSubServiceType(fakeMeeting), 'LargeScaleWebinar');
4304
+ });
4305
+
3651
4306
  it('returns subServicetype as undefined when correct parameters are not found', () => {
3652
4307
  fakeMeeting.meetingInfo = {};
3653
4308
  assert.deepEqual(cd.getSubServiceType(fakeMeeting), undefined);
@@ -3701,18 +4356,23 @@ describe('internal-plugin-metrics', () => {
3701
4356
  correlationId: 'correlationId',
3702
4357
  deviceId: 'deviceUrl',
3703
4358
  locusId: 'url',
4359
+ locusSessionId: 'locusSessionId',
3704
4360
  locusStartTime: 'lastActive',
3705
4361
  locusUrl: 'locus/url',
3706
4362
  orgId: 'orgId',
3707
4363
  userId: 'userId',
3708
4364
  },
3709
4365
  loginType: 'login-ci',
4366
+ telemetryOptOut: undefined,
3710
4367
  name: 'client.exit.app',
3711
4368
  trigger: 'user-interaction',
3712
4369
  userType: 'host',
3713
4370
  isConvergedArchitectureEnabled: undefined,
3714
4371
  webexSubServiceType: undefined,
3715
4372
  webClientPreload: undefined,
4373
+ isVipMeeting: false,
4374
+ isAutomatedUser: false,
4375
+ userActivation: undefined,
3716
4376
  },
3717
4377
  eventId: 'my-fake-id',
3718
4378
  origin: {
@@ -3880,7 +4540,10 @@ describe('internal-plugin-metrics', () => {
3880
4540
  cd.submitToCallDiagnosticsPreLogin({event: 'test'}, preLoginId);
3881
4541
  //@ts-ignore
3882
4542
  assert.calledWith(cd.preLoginMetricsBatcher.savePreLoginId, preLoginId);
3883
- assert.calledWith(requestStub, {eventPayload: {event: 'test'}, type: ['diagnostic-event']});
4543
+ assert.calledWith(requestStub, {
4544
+ eventPayload: {event: 'test'},
4545
+ type: ['diagnostic-event'],
4546
+ });
3884
4547
  });
3885
4548
  });
3886
4549
 
@@ -4081,12 +4744,14 @@ describe('internal-plugin-metrics', () => {
4081
4744
  payload: {
4082
4745
  meetingSummaryInfo: {
4083
4746
  featureName: 'syncSystemMuteStatus',
4084
- featureActions: [{
4085
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4086
- actionId: '14200',
4087
- isInitialValue: false,
4088
- clickCount: '1'
4089
- }]
4747
+ featureActions: [
4748
+ {
4749
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4750
+ actionId: '14200',
4751
+ isInitialValue: false,
4752
+ clickCount: '1',
4753
+ },
4754
+ ],
4090
4755
  },
4091
4756
  },
4092
4757
  options,
@@ -4104,24 +4769,31 @@ describe('internal-plugin-metrics', () => {
4104
4769
  orgId: 'orgId',
4105
4770
  locusUrl: 'locus/url',
4106
4771
  locusId: 'url',
4772
+ locusSessionId: 'locusSessionId',
4107
4773
  locusStartTime: 'lastActive',
4108
4774
  },
4109
- eventData: { webClientDomain: 'whatever'},
4775
+ eventData: {webClientDomain: 'whatever'},
4110
4776
  userType: 'host',
4111
4777
  loginType: 'login-ci',
4778
+ telemetryOptOut: undefined,
4112
4779
  isConvergedArchitectureEnabled: undefined,
4113
4780
  webexSubServiceType: undefined,
4114
4781
  webClientPreload: undefined,
4782
+ isVipMeeting: false,
4783
+ isAutomatedUser: false,
4784
+ userActivation: undefined,
4115
4785
  meetingSummaryInfo: {
4116
4786
  featureName: 'syncSystemMuteStatus',
4117
- featureActions: [{
4118
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4119
- actionId: '14200',
4120
- isInitialValue: false,
4121
- clickCount: '1'
4122
- }]
4787
+ featureActions: [
4788
+ {
4789
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4790
+ actionId: '14200',
4791
+ isInitialValue: false,
4792
+ clickCount: '1',
4793
+ },
4794
+ ],
4123
4795
  },
4124
- key: "UcfFeatureUsage",
4796
+ key: 'UcfFeatureUsage',
4125
4797
  },
4126
4798
  options
4127
4799
  );
@@ -4134,32 +4806,39 @@ describe('internal-plugin-metrics', () => {
4134
4806
  },
4135
4807
  event: {
4136
4808
  canProceed: true,
4137
- eventData: { webClientDomain: 'whatever'},
4809
+ eventData: {webClientDomain: 'whatever'},
4138
4810
  identifiers: {
4139
4811
  correlationId: 'correlationId',
4140
4812
  deviceId: 'deviceUrl',
4141
4813
  locusId: 'url',
4142
4814
  locusStartTime: 'lastActive',
4143
4815
  locusUrl: 'locus/url',
4816
+ locusSessionId: 'locusSessionId',
4144
4817
  orgId: 'orgId',
4145
4818
  userId: 'userId',
4146
4819
  },
4147
4820
  loginType: 'login-ci',
4821
+ telemetryOptOut: undefined,
4148
4822
  name: 'client.feature.meeting.summary',
4149
4823
  userType: 'host',
4150
4824
  isConvergedArchitectureEnabled: undefined,
4151
4825
  webexSubServiceType: undefined,
4152
4826
  webClientPreload: undefined,
4827
+ isVipMeeting: false,
4828
+ isAutomatedUser: false,
4829
+ userActivation: undefined,
4153
4830
  meetingSummaryInfo: {
4154
4831
  featureName: 'syncSystemMuteStatus',
4155
- featureActions: [{
4156
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4157
- actionId: '14200',
4158
- isInitialValue: false,
4159
- clickCount: '1'
4160
- }]
4832
+ featureActions: [
4833
+ {
4834
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4835
+ actionId: '14200',
4836
+ isInitialValue: false,
4837
+ clickCount: '1',
4838
+ },
4839
+ ],
4161
4840
  },
4162
- key: "UcfFeatureUsage",
4841
+ key: 'UcfFeatureUsage',
4163
4842
  },
4164
4843
  originTime: {
4165
4844
  sent: 'not_defined_yet',
@@ -4200,12 +4879,14 @@ describe('internal-plugin-metrics', () => {
4200
4879
  payload: {
4201
4880
  meetingSummaryInfo: {
4202
4881
  featureName: 'syncSystemMuteStatus',
4203
- featureActions: [{
4204
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4205
- actionId: '14200',
4206
- isInitialValue: false,
4207
- clickCount: '1'
4208
- }]
4882
+ featureActions: [
4883
+ {
4884
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4885
+ actionId: '14200',
4886
+ isInitialValue: false,
4887
+ clickCount: '1',
4888
+ },
4889
+ ],
4209
4890
  },
4210
4891
  },
4211
4892
  delaySubmitEvent: true,
@@ -4217,12 +4898,14 @@ describe('internal-plugin-metrics', () => {
4217
4898
  payload: {
4218
4899
  meetingSummaryInfo: {
4219
4900
  featureName: 'syncSystemVideoStatus',
4220
- featureActions: [{
4221
- actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4222
- actionId: '13400',
4223
- isInitialValue: false,
4224
- clickCount: '1'
4225
- }]
4901
+ featureActions: [
4902
+ {
4903
+ actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4904
+ actionId: '13400',
4905
+ isInitialValue: false,
4906
+ clickCount: '1',
4907
+ },
4908
+ ],
4226
4909
  },
4227
4910
  },
4228
4911
  delaySubmitEvent: true,
@@ -4240,12 +4923,14 @@ describe('internal-plugin-metrics', () => {
4240
4923
  payload: {
4241
4924
  meetingSummaryInfo: {
4242
4925
  featureName: 'syncSystemMuteStatus',
4243
- featureActions: [{
4244
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4245
- actionId: '14200',
4246
- isInitialValue: false,
4247
- clickCount: '1'
4248
- }]
4926
+ featureActions: [
4927
+ {
4928
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4929
+ actionId: '14200',
4930
+ isInitialValue: false,
4931
+ clickCount: '1',
4932
+ },
4933
+ ],
4249
4934
  },
4250
4935
  },
4251
4936
  options: {
@@ -4258,12 +4943,14 @@ describe('internal-plugin-metrics', () => {
4258
4943
  payload: {
4259
4944
  meetingSummaryInfo: {
4260
4945
  featureName: 'syncSystemVideoStatus',
4261
- featureActions: [{
4262
- actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4263
- actionId: '13400',
4264
- isInitialValue: false,
4265
- clickCount: '1'
4266
- }]
4946
+ featureActions: [
4947
+ {
4948
+ actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4949
+ actionId: '13400',
4950
+ isInitialValue: false,
4951
+ clickCount: '1',
4952
+ },
4953
+ ],
4267
4954
  },
4268
4955
  },
4269
4956
  options: {
@@ -4287,17 +4974,17 @@ describe('internal-plugin-metrics', () => {
4287
4974
 
4288
4975
  it('should clear event limits for specific correlationId only', () => {
4289
4976
  // Use the actual correlationIds from our fakeMeeting fixtures
4290
- const correlationId1 = fakeMeeting.correlationId; // e.g. 'correlationId1'
4291
- const correlationId2 = fakeMeeting2.correlationId; // e.g. 'correlationId2'
4292
- const options1 = { meetingId: fakeMeeting.id };
4293
- const options2 = { meetingId: fakeMeeting2.id };
4294
- const payload = { mediaType: 'video' as const };
4977
+ const correlationId1 = fakeMeeting.correlationId; // e.g. 'correlationId1'
4978
+ const correlationId2 = fakeMeeting2.correlationId; // e.g. 'correlationId2'
4979
+ const options1 = {meetingId: fakeMeeting.id};
4980
+ const options2 = {meetingId: fakeMeeting2.id};
4981
+ const payload = {mediaType: 'video' as const};
4295
4982
 
4296
4983
  // Set up events for both correlations to trigger limits
4297
- cd.submitClientEvent({ name: 'client.media.render.start', payload, options: options1 });
4298
- cd.submitClientEvent({ name: 'client.media.render.start', payload, options: options2 });
4299
- cd.submitClientEvent({ name: 'client.media.render.start', payload, options: options1 });
4300
- cd.submitClientEvent({ name: 'client.media.render.start', payload, options: options2 });
4984
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options1});
4985
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options2});
4986
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options1});
4987
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options2});
4301
4988
  assert.isTrue(cd.eventLimitTracker.size > 0);
4302
4989
  assert.isTrue(cd.eventLimitWarningsLogged.size > 0);
4303
4990
 
@@ -4308,17 +4995,17 @@ describe('internal-plugin-metrics', () => {
4308
4995
  const remainingWarningKeys = Array.from(cd.eventLimitWarningsLogged.keys());
4309
4996
 
4310
4997
  // Should have no keys with correlationId1
4311
- assert.isFalse(remainingTrackerKeys.some(key => key.split(':')[1] === correlationId1));
4312
- assert.isFalse(remainingWarningKeys.some(key => key.split(':')[1] === correlationId1));
4998
+ assert.isFalse(remainingTrackerKeys.some((key) => key.split(':')[1] === correlationId1));
4999
+ assert.isFalse(remainingWarningKeys.some((key) => key.split(':')[1] === correlationId1));
4313
5000
 
4314
5001
  // Should still have keys with correlationId2
4315
- assert.isTrue(remainingTrackerKeys.some(key => key.split(':')[1] === correlationId2));
4316
- assert.isTrue(remainingWarningKeys.some(key => key.split(':')[1] === correlationId2));
5002
+ assert.isTrue(remainingTrackerKeys.some((key) => key.split(':')[1] === correlationId2));
5003
+ assert.isTrue(remainingWarningKeys.some((key) => key.split(':')[1] === correlationId2));
4317
5004
  });
4318
5005
 
4319
5006
  it('should handle empty correlationId gracefully', () => {
4320
- const options = { meetingId: fakeMeeting.id };
4321
- const payload = { mediaType: 'video' as const };
5007
+ const options = {meetingId: fakeMeeting.id};
5008
+ const payload = {mediaType: 'video' as const};
4322
5009
 
4323
5010
  // Set up some tracking data
4324
5011
  cd.submitClientEvent({
@@ -4346,8 +5033,8 @@ describe('internal-plugin-metrics', () => {
4346
5033
  });
4347
5034
 
4348
5035
  it('should handle non-existent correlationId gracefully', () => {
4349
- const options = { meetingId: fakeMeeting.id };
4350
- const payload = { mediaType: 'video' as const };
5036
+ const options = {meetingId: fakeMeeting.id};
5037
+ const payload = {mediaType: 'video' as const};
4351
5038
 
4352
5039
  // Set up some tracking data
4353
5040
  cd.submitClientEvent({
@@ -4368,10 +5055,10 @@ describe('internal-plugin-metrics', () => {
4368
5055
 
4369
5056
  it('should clear multiple event types for the same correlationId', () => {
4370
5057
  const correlationId = fakeMeeting.correlationId;
4371
- const options = { meetingId: fakeMeeting.id };
4372
- const videoPayload = { mediaType: 'video' as const };
4373
- const audioPayload = { mediaType: 'audio' as const };
4374
- const roapPayload = { roap: { messageType: 'OFFER' as const } };
5058
+ const options = {meetingId: fakeMeeting.id};
5059
+ const videoPayload = {mediaType: 'video' as const};
5060
+ const audioPayload = {mediaType: 'audio' as const};
5061
+ const roapPayload = {roap: {messageType: 'OFFER' as const}};
4375
5062
 
4376
5063
  // Set up multiple event types for the same correlation
4377
5064
  cd.submitClientEvent({
@@ -4424,8 +5111,8 @@ describe('internal-plugin-metrics', () => {
4424
5111
 
4425
5112
  it('should allow events to be sent again after clearing limits for correlationId', () => {
4426
5113
  const correlationId = fakeMeeting.correlationId;
4427
- const options = { meetingId: fakeMeeting.id };
4428
- const payload = { mediaType: 'video' as const };
5114
+ const options = {meetingId: fakeMeeting.id};
5115
+ const payload = {mediaType: 'video' as const};
4429
5116
  const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
4430
5117
 
4431
5118
  // Send first event (should succeed)