@webex/internal-plugin-metrics 3.11.0 → 3.12.0-llmrefactor.2

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 (74) 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 +168 -76
  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 +105 -26
  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/privacy-and-security-permission-enricher/constants.js +18 -0
  27. package/dist/privacy-and-security-permission-enricher/constants.js.map +1 -0
  28. package/dist/privacy-and-security-permission-enricher/index.js +143 -0
  29. package/dist/privacy-and-security-permission-enricher/index.js.map +1 -0
  30. package/dist/privacy-and-security-permission-enricher/types.js +7 -0
  31. package/dist/privacy-and-security-permission-enricher/types.js.map +1 -0
  32. package/dist/privacy-and-security-permission-enricher/utils.js +71 -0
  33. package/dist/privacy-and-security-permission-enricher/utils.js.map +1 -0
  34. package/dist/types/automated-user.d.ts +2 -0
  35. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +208 -5
  36. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +79 -15
  37. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +5 -0
  38. package/dist/types/call-diagnostic/config.d.ts +5 -0
  39. package/dist/types/config.d.ts +1 -0
  40. package/dist/types/index.d.ts +6 -3
  41. package/dist/types/metrics.types.d.ts +9 -4
  42. package/dist/types/new-metrics.d.ts +29 -1
  43. package/dist/types/prelogin-metrics.d.ts +47 -0
  44. package/dist/types/privacy-and-security-permission-enricher/constants.d.ts +6 -0
  45. package/dist/types/privacy-and-security-permission-enricher/index.d.ts +40 -0
  46. package/dist/types/privacy-and-security-permission-enricher/types.d.ts +14 -0
  47. package/dist/types/privacy-and-security-permission-enricher/utils.d.ts +5 -0
  48. package/package.json +12 -11
  49. package/src/automated-user.ts +16 -0
  50. package/src/batcher.js +4 -0
  51. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +800 -75
  52. package/src/call-diagnostic/call-diagnostic-metrics.ts +102 -15
  53. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +22 -2
  54. package/src/call-diagnostic/config.ts +15 -0
  55. package/src/config.js +1 -0
  56. package/src/generic-metrics.ts +6 -6
  57. package/src/index.ts +9 -0
  58. package/src/metrics.types.ts +27 -5
  59. package/src/new-metrics.ts +95 -6
  60. package/src/prelogin-metrics.ts +94 -0
  61. package/src/privacy-and-security-permission-enricher/constants.ts +33 -0
  62. package/src/privacy-and-security-permission-enricher/index.ts +142 -0
  63. package/src/privacy-and-security-permission-enricher/types.ts +21 -0
  64. package/src/privacy-and-security-permission-enricher/utils.ts +82 -0
  65. package/test/unit/spec/automated-user.ts +43 -0
  66. package/test/unit/spec/batcher.js +43 -0
  67. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +47 -11
  68. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1550 -416
  69. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +887 -159
  70. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +61 -3
  71. package/test/unit/spec/new-metrics.ts +183 -50
  72. package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
  73. package/test/unit/spec/prelogin-metrics.ts +132 -0
  74. package/test/unit/spec/privacy-and-security-permission-enricher.ts +318 -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
 
@@ -360,6 +364,23 @@ describe('internal-plugin-metrics', () => {
360
364
  });
361
365
  });
362
366
 
367
+ it('should build origin correctly when the meetings plugin is not available (before webex is ready)', () => {
368
+ // meetings plugin, geoHintInfo and meetingCollection are all absent before webex.ready
369
+ webex.meetings = undefined;
370
+
371
+ //@ts-ignore
372
+ const res = cd.getOrigin(
373
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
374
+ fakeMeeting.id
375
+ );
376
+
377
+ assert.equal(res.clientInfo.clientType, 'TEAMS_CLIENT');
378
+ assert.equal(res.clientInfo.subClientType, 'WEB_APP');
379
+ assert.isUndefined(res.clientInfo.publicNetworkPrefix);
380
+ assert.isUndefined(res.clientInfo.localNetworkPrefix);
381
+ assert.equal(res.name, 'endpoint');
382
+ });
383
+
363
384
  it('builds origin correctly, when overriding clientVersion', () => {
364
385
  webex.meetings.config.metrics.clientVersion = '43.9.0.1234';
365
386
 
@@ -390,6 +411,64 @@ describe('internal-plugin-metrics', () => {
390
411
  });
391
412
  });
392
413
 
414
+ it('builds origin correctly with browser details provided by the host client', () => {
415
+ // host resolves wrapper browsers (WebOS, Electron) to the engine that determines capability
416
+ webex.meetings.config.metrics.browser = 'WebOS Browser';
417
+ webex.meetings.config.metrics.browserVersion = '108.0.0.0';
418
+
419
+ //@ts-ignore
420
+ const res = cd.getOrigin(
421
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
422
+ fakeMeeting.id
423
+ );
424
+
425
+ assert.equal(res.clientInfo.browser, 'WebOS Browser');
426
+ assert.equal(res.clientInfo.browserVersion, '108.0.0.0');
427
+ });
428
+
429
+ it('falls back to SDK browser detection when the host provides nothing', () => {
430
+ //@ts-ignore
431
+ const res = cd.getOrigin(
432
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
433
+ fakeMeeting.id
434
+ );
435
+
436
+ assert.equal(res.clientInfo.browser, getBrowserName());
437
+ assert.equal(res.clientInfo.browserVersion, getBrowserVersion());
438
+ });
439
+
440
+ it('builds origin correctly with the browser support flags from config', () => {
441
+ // `false` is the meaningful "unsupported family" signal, so it must survive a truthy check
442
+ webex.meetings.config.metrics.isSupportedBrowserFamily = false;
443
+ webex.meetings.config.metrics.isOutdatedBrowserVersion = true;
444
+
445
+ //@ts-ignore
446
+ const res = cd.getOrigin(
447
+ {subClientType: 'WEB_APP', clientType: 'TEAMS_CLIENT'},
448
+ fakeMeeting.id
449
+ );
450
+
451
+ assert.deepEqual(res, {
452
+ clientInfo: {
453
+ browser: getBrowserName(),
454
+ browserVersion: getBrowserVersion(),
455
+ clientType: 'TEAMS_CLIENT',
456
+ clientVersion: 'webex-js-sdk/webex-version',
457
+ publicNetworkPrefix: '1.3.4.0',
458
+ localNetworkPrefix: '192.168.1.80',
459
+ os: getOSNameInternal(),
460
+ osVersion: getOSVersion() || 'unknown',
461
+ subClientType: 'WEB_APP',
462
+ isSupportedBrowserFamily: false,
463
+ isOutdatedBrowserVersion: true,
464
+ },
465
+ environment: 'meeting_evn',
466
+ name: 'endpoint',
467
+ networkType: 'unknown',
468
+ userAgent,
469
+ });
470
+ });
471
+
393
472
  it('should build origin correctly with no meeting or stats analyzer', () => {
394
473
  //@ts-ignore
395
474
  const res = cd.getOrigin();
@@ -431,6 +510,7 @@ describe('internal-plugin-metrics', () => {
431
510
  correlationId: 'correlationId',
432
511
  deviceId: 'deviceUrl',
433
512
  locusId: 'url',
513
+ locusSessionId: 'locusSessionId',
434
514
  locusStartTime: 'lastActive',
435
515
  locusUrl: 'locus/url',
436
516
  machineId: 'installationId',
@@ -460,6 +540,7 @@ describe('internal-plugin-metrics', () => {
460
540
  correlationId: 'correlationId',
461
541
  deviceId: 'deviceUrl',
462
542
  locusId: 'url',
543
+ locusSessionId: 'locusSessionId',
463
544
  locusStartTime: 'lastActive',
464
545
  locusUrl: 'locus/url',
465
546
  machineId: 'installationId',
@@ -490,6 +571,7 @@ describe('internal-plugin-metrics', () => {
490
571
  sessionCorrelationId: 'sessionCorrelationId',
491
572
  deviceId: 'deviceUrl',
492
573
  locusId: 'url',
574
+ locusSessionId: 'locusSessionId',
493
575
  locusStartTime: 'lastActive',
494
576
  locusUrl: 'locus/url',
495
577
  machineId: 'installationId',
@@ -519,6 +601,7 @@ describe('internal-plugin-metrics', () => {
519
601
  sessionCorrelationId: 'sessionCorrelationId',
520
602
  deviceId: 'deviceUrl',
521
603
  locusId: 'url',
604
+ locusSessionId: 'locusSessionId',
522
605
  locusStartTime: 'lastActive',
523
606
  locusUrl: 'locus/url',
524
607
  machineId: 'installationId',
@@ -554,6 +637,7 @@ describe('internal-plugin-metrics', () => {
554
637
  globalMeetingId: 'globalMeetingId1',
555
638
  deviceId: 'deviceUrl',
556
639
  locusId: 'url',
640
+ locusSessionId: 'locusSessionId',
557
641
  locusStartTime: 'lastActive',
558
642
  locusUrl: 'locus/url',
559
643
  mediaAgentAlias: 'mediaAgentAlias',
@@ -586,6 +670,7 @@ describe('internal-plugin-metrics', () => {
586
670
  globalMeetingId: 'globalMeetingId1',
587
671
  deviceId: 'deviceUrl',
588
672
  locusId: 'url',
673
+ locusSessionId: 'locusSessionId',
589
674
  locusStartTime: 'lastActive',
590
675
  locusUrl: 'locus/url',
591
676
  mediaAgentAlias: 'mediaAgentAlias',
@@ -620,6 +705,7 @@ describe('internal-plugin-metrics', () => {
620
705
  deviceId: 'deviceUrl',
621
706
  locusId: 'url',
622
707
  locusStartTime: 'lastActive',
708
+ locusSessionId: 'locusSessionId',
623
709
  locusUrl: 'locus/url',
624
710
  mediaAgentAlias: 'mediaAgentAlias',
625
711
  mediaAgentGroupId: 'mediaAgentGroupId',
@@ -655,6 +741,7 @@ describe('internal-plugin-metrics', () => {
655
741
  globalMeetingId: 'globalMeetingId1',
656
742
  deviceId: 'deviceUrl',
657
743
  locusId: 'url',
744
+ locusSessionId: 'locusSessionId',
658
745
  locusStartTime: 'lastActive',
659
746
  locusUrl: 'locus/url',
660
747
  mediaAgentAlias: 'mediaAgentAlias',
@@ -848,6 +935,103 @@ describe('internal-plugin-metrics', () => {
848
935
  });
849
936
  });
850
937
 
938
+ describe('#prepareDiagnosticEvent isAutomatedUser field', () => {
939
+ it('should set isAutomatedUser to false when window is not defined', () => {
940
+ const options = {meetingId: fakeMeeting.id};
941
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
942
+
943
+ const res = cd.prepareDiagnosticEvent(
944
+ {
945
+ canProceed: true,
946
+ identifiers: {correlationId: 'test-id'},
947
+ name: 'client.alert.displayed',
948
+ isAutomatedUser: false,
949
+ userActivation: undefined,
950
+ },
951
+ options
952
+ );
953
+
954
+ // In the test environment, isAutomatedUser should be false since we're not in a webdriver environment
955
+ assert.isFalse(
956
+ res.event.isAutomatedUser,
957
+ 'isAutomatedUser should be false in non-webdriver test environment'
958
+ );
959
+ });
960
+
961
+ it('should include isAutomatedUser field in the returned event', () => {
962
+ const options = {meetingId: fakeMeeting.id};
963
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
964
+
965
+ const res = cd.prepareDiagnosticEvent(
966
+ {
967
+ canProceed: true,
968
+ identifiers: {correlationId: 'test-id'},
969
+ name: 'client.alert.displayed',
970
+ isAutomatedUser: false,
971
+ userActivation: undefined,
972
+ },
973
+ options
974
+ );
975
+
976
+ // Verify the isAutomatedUser field is present in the event
977
+ assert.isDefined(res.event.isAutomatedUser, 'isAutomatedUser field should be defined');
978
+ assert.isBoolean(res.event.isAutomatedUser, 'isAutomatedUser should be a boolean');
979
+ });
980
+
981
+ it('should set isAutomatedUser to true when the user is automated', () => {
982
+ isAutomatedUserStub.returns(true);
983
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
984
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
985
+ cd.setMercuryConnectedStatus(true);
986
+
987
+ cd.submitClientEvent({
988
+ name: 'client.alert.displayed',
989
+ options: {correlationId: 'correlationId'},
990
+ });
991
+
992
+ assert.isTrue(
993
+ prepareDiagnosticEventSpy.firstCall.args[0].isAutomatedUser,
994
+ 'isAutomatedUser should be true for an automated user'
995
+ );
996
+ });
997
+ });
998
+
999
+ describe('#getUserActivation', () => {
1000
+ let originalDescriptor;
1001
+
1002
+ beforeEach(() => {
1003
+ originalDescriptor = Object.getOwnPropertyDescriptor(global, 'navigator');
1004
+ });
1005
+
1006
+ afterEach(() => {
1007
+ if (originalDescriptor) {
1008
+ Object.defineProperty(global, 'navigator', originalDescriptor);
1009
+ } else {
1010
+ delete (global as any).navigator;
1011
+ }
1012
+ });
1013
+
1014
+ it('should return the userActivation state when navigator.userActivation is available', () => {
1015
+ Object.defineProperty(global, 'navigator', {
1016
+ value: {userActivation: {hasBeenActive: true, isActive: false}},
1017
+ configurable: true,
1018
+ writable: true,
1019
+ });
1020
+
1021
+ assert.deepEqual(cd.getUserActivation(), {hasBeenActive: true, isActive: false});
1022
+ });
1023
+
1024
+ it('should return undefined when navigator.userActivation is not available', () => {
1025
+ Object.defineProperty(global, 'navigator', {
1026
+ value: {},
1027
+ configurable: true,
1028
+ writable: true,
1029
+ });
1030
+
1031
+ assert.isUndefined(cd.getUserActivation());
1032
+ });
1033
+ });
1034
+
851
1035
  describe('#submitClientEvent', () => {
852
1036
  it('should submit client event successfully with meetingId', () => {
853
1037
  const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
@@ -889,6 +1073,7 @@ describe('internal-plugin-metrics', () => {
889
1073
  correlationId: 'correlationId',
890
1074
  deviceId: 'deviceUrl',
891
1075
  locusId: 'url',
1076
+ locusSessionId: 'locusSessionId',
892
1077
  locusStartTime: 'lastActive',
893
1078
  locusUrl: 'locus/url',
894
1079
  mediaAgentAlias: 'alias',
@@ -897,11 +1082,15 @@ describe('internal-plugin-metrics', () => {
897
1082
  userId: 'userId',
898
1083
  },
899
1084
  loginType: 'login-ci',
1085
+ telemetryOptOut: undefined,
900
1086
  name: 'client.alert.displayed',
901
1087
  userType: 'host',
902
1088
  isConvergedArchitectureEnabled: undefined,
903
1089
  webexSubServiceType: undefined,
904
1090
  webClientPreload: undefined,
1091
+ isVipMeeting: false,
1092
+ isAutomatedUser: false,
1093
+ userActivation: undefined,
905
1094
  },
906
1095
  options
907
1096
  );
@@ -916,6 +1105,7 @@ describe('internal-plugin-metrics', () => {
916
1105
  correlationId: 'correlationId',
917
1106
  deviceId: 'deviceUrl',
918
1107
  locusId: 'url',
1108
+ locusSessionId: 'locusSessionId',
919
1109
  locusStartTime: 'lastActive',
920
1110
  locusUrl: 'locus/url',
921
1111
  mediaAgentAlias: 'alias',
@@ -924,11 +1114,15 @@ describe('internal-plugin-metrics', () => {
924
1114
  userId: 'userId',
925
1115
  },
926
1116
  loginType: 'login-ci',
1117
+ telemetryOptOut: undefined,
927
1118
  name: 'client.alert.displayed',
928
1119
  userType: 'host',
929
1120
  isConvergedArchitectureEnabled: undefined,
930
1121
  webexSubServiceType: undefined,
931
1122
  webClientPreload: undefined,
1123
+ isVipMeeting: false,
1124
+ isAutomatedUser: false,
1125
+ userActivation: undefined,
932
1126
  },
933
1127
  eventId: 'my-fake-id',
934
1128
  origin: {
@@ -954,6 +1148,7 @@ describe('internal-plugin-metrics', () => {
954
1148
  correlationId: 'correlationId',
955
1149
  deviceId: 'deviceUrl',
956
1150
  locusId: 'url',
1151
+ locusSessionId: 'locusSessionId',
957
1152
  locusStartTime: 'lastActive',
958
1153
  locusUrl: 'locus/url',
959
1154
  mediaAgentAlias: 'alias',
@@ -962,11 +1157,15 @@ describe('internal-plugin-metrics', () => {
962
1157
  userId: 'userId',
963
1158
  },
964
1159
  loginType: 'login-ci',
1160
+ telemetryOptOut: undefined,
965
1161
  name: 'client.alert.displayed',
966
1162
  userType: 'host',
967
1163
  isConvergedArchitectureEnabled: undefined,
968
1164
  webexSubServiceType: undefined,
969
1165
  webClientPreload: undefined,
1166
+ isVipMeeting: false,
1167
+ isAutomatedUser: false,
1168
+ userActivation: undefined,
970
1169
  },
971
1170
  eventId: 'my-fake-id',
972
1171
  origin: {
@@ -1028,6 +1227,7 @@ describe('internal-plugin-metrics', () => {
1028
1227
  correlationId: 'correlationId',
1029
1228
  deviceId: 'deviceUrl',
1030
1229
  locusId: 'url',
1230
+ locusSessionId: 'locusSessionId',
1031
1231
  locusStartTime: 'lastActive',
1032
1232
  locusUrl: 'locus/url',
1033
1233
  mediaAgentAlias: 'alias',
@@ -1036,11 +1236,15 @@ describe('internal-plugin-metrics', () => {
1036
1236
  userId: 'userId',
1037
1237
  },
1038
1238
  loginType: 'login-ci',
1239
+ telemetryOptOut: undefined,
1039
1240
  name: 'client.alert.displayed',
1040
1241
  userType: 'host',
1041
1242
  isConvergedArchitectureEnabled: undefined,
1042
1243
  webexSubServiceType: undefined,
1043
1244
  webClientPreload: undefined,
1245
+ isVipMeeting: false,
1246
+ isAutomatedUser: false,
1247
+ userActivation: undefined,
1044
1248
  },
1045
1249
  options
1046
1250
  );
@@ -1055,6 +1259,7 @@ describe('internal-plugin-metrics', () => {
1055
1259
  correlationId: 'correlationId',
1056
1260
  deviceId: 'deviceUrl',
1057
1261
  locusId: 'url',
1262
+ locusSessionId: 'locusSessionId',
1058
1263
  locusStartTime: 'lastActive',
1059
1264
  locusUrl: 'locus/url',
1060
1265
  mediaAgentAlias: 'alias',
@@ -1063,11 +1268,15 @@ describe('internal-plugin-metrics', () => {
1063
1268
  userId: 'userId',
1064
1269
  },
1065
1270
  loginType: 'login-ci',
1271
+ telemetryOptOut: undefined,
1066
1272
  name: 'client.alert.displayed',
1067
1273
  userType: 'host',
1068
1274
  isConvergedArchitectureEnabled: undefined,
1069
1275
  webexSubServiceType: undefined,
1070
1276
  webClientPreload: undefined,
1277
+ isVipMeeting: false,
1278
+ isAutomatedUser: false,
1279
+ userActivation: undefined,
1071
1280
  },
1072
1281
  eventId: 'my-fake-id',
1073
1282
  origin: {
@@ -1093,6 +1302,7 @@ describe('internal-plugin-metrics', () => {
1093
1302
  correlationId: 'correlationId',
1094
1303
  deviceId: 'deviceUrl',
1095
1304
  locusId: 'url',
1305
+ locusSessionId: 'locusSessionId',
1096
1306
  locusStartTime: 'lastActive',
1097
1307
  locusUrl: 'locus/url',
1098
1308
  mediaAgentAlias: 'alias',
@@ -1101,11 +1311,15 @@ describe('internal-plugin-metrics', () => {
1101
1311
  userId: 'userId',
1102
1312
  },
1103
1313
  loginType: 'login-ci',
1314
+ telemetryOptOut: undefined,
1104
1315
  name: 'client.alert.displayed',
1105
1316
  userType: 'host',
1106
1317
  isConvergedArchitectureEnabled: undefined,
1107
1318
  webexSubServiceType: undefined,
1108
1319
  webClientPreload: undefined,
1320
+ isVipMeeting: false,
1321
+ isAutomatedUser: false,
1322
+ userActivation: undefined,
1109
1323
  },
1110
1324
  eventId: 'my-fake-id',
1111
1325
  origin: {
@@ -1168,6 +1382,7 @@ describe('internal-plugin-metrics', () => {
1168
1382
  sessionCorrelationId: 'sessionCorrelationId3',
1169
1383
  deviceId: 'deviceUrl',
1170
1384
  locusId: 'url',
1385
+ locusSessionId: 'locusSessionId',
1171
1386
  locusStartTime: 'lastActive',
1172
1387
  locusUrl: 'locus/url',
1173
1388
  mediaAgentAlias: 'alias',
@@ -1176,11 +1391,15 @@ describe('internal-plugin-metrics', () => {
1176
1391
  userId: 'userId',
1177
1392
  },
1178
1393
  loginType: 'login-ci',
1394
+ telemetryOptOut: undefined,
1179
1395
  name: 'client.alert.displayed',
1180
1396
  userType: 'host',
1181
1397
  isConvergedArchitectureEnabled: undefined,
1182
1398
  webexSubServiceType: undefined,
1183
1399
  webClientPreload: undefined,
1400
+ isVipMeeting: false,
1401
+ isAutomatedUser: false,
1402
+ userActivation: undefined,
1184
1403
  },
1185
1404
  options
1186
1405
  );
@@ -1196,6 +1415,7 @@ describe('internal-plugin-metrics', () => {
1196
1415
  sessionCorrelationId: 'sessionCorrelationId3',
1197
1416
  deviceId: 'deviceUrl',
1198
1417
  locusId: 'url',
1418
+ locusSessionId: 'locusSessionId',
1199
1419
  locusStartTime: 'lastActive',
1200
1420
  locusUrl: 'locus/url',
1201
1421
  mediaAgentAlias: 'alias',
@@ -1204,11 +1424,15 @@ describe('internal-plugin-metrics', () => {
1204
1424
  userId: 'userId',
1205
1425
  },
1206
1426
  loginType: 'login-ci',
1427
+ telemetryOptOut: undefined,
1207
1428
  name: 'client.alert.displayed',
1208
1429
  userType: 'host',
1209
1430
  isConvergedArchitectureEnabled: undefined,
1210
1431
  webexSubServiceType: undefined,
1211
1432
  webClientPreload: undefined,
1433
+ isVipMeeting: false,
1434
+ isAutomatedUser: false,
1435
+ userActivation: undefined,
1212
1436
  },
1213
1437
  eventId: 'my-fake-id',
1214
1438
  origin: {
@@ -1235,6 +1459,7 @@ describe('internal-plugin-metrics', () => {
1235
1459
  sessionCorrelationId: 'sessionCorrelationId3',
1236
1460
  deviceId: 'deviceUrl',
1237
1461
  locusId: 'url',
1462
+ locusSessionId: 'locusSessionId',
1238
1463
  locusStartTime: 'lastActive',
1239
1464
  locusUrl: 'locus/url',
1240
1465
  mediaAgentAlias: 'alias',
@@ -1243,11 +1468,15 @@ describe('internal-plugin-metrics', () => {
1243
1468
  userId: 'userId',
1244
1469
  },
1245
1470
  loginType: 'login-ci',
1471
+ telemetryOptOut: undefined,
1246
1472
  name: 'client.alert.displayed',
1247
1473
  userType: 'host',
1248
1474
  isConvergedArchitectureEnabled: undefined,
1249
1475
  webexSubServiceType: undefined,
1250
1476
  webClientPreload: undefined,
1477
+ isVipMeeting: false,
1478
+ isAutomatedUser: false,
1479
+ userActivation: undefined,
1251
1480
  },
1252
1481
  eventId: 'my-fake-id',
1253
1482
  origin: {
@@ -1309,6 +1538,7 @@ describe('internal-plugin-metrics', () => {
1309
1538
  correlationId: 'correlationId',
1310
1539
  deviceId: 'deviceUrl',
1311
1540
  locusId: 'url',
1541
+ locusSessionId: 'locusSessionId',
1312
1542
  locusStartTime: 'lastActive',
1313
1543
  locusUrl: 'locus/url',
1314
1544
  mediaAgentAlias: 'alias',
@@ -1317,11 +1547,15 @@ describe('internal-plugin-metrics', () => {
1317
1547
  userId: 'userId',
1318
1548
  },
1319
1549
  loginType: 'login-ci',
1550
+ telemetryOptOut: undefined,
1320
1551
  webClientPreload: undefined,
1321
1552
  name: 'client.alert.displayed',
1322
1553
  userType: 'host',
1323
1554
  isConvergedArchitectureEnabled: undefined,
1324
1555
  webexSubServiceType: undefined,
1556
+ isVipMeeting: false,
1557
+ isAutomatedUser: false,
1558
+ userActivation: undefined,
1325
1559
  },
1326
1560
  options
1327
1561
  );
@@ -1337,6 +1571,7 @@ describe('internal-plugin-metrics', () => {
1337
1571
  correlationId: 'correlationId',
1338
1572
  deviceId: 'deviceUrl',
1339
1573
  locusId: 'url',
1574
+ locusSessionId: 'locusSessionId',
1340
1575
  locusStartTime: 'lastActive',
1341
1576
  locusUrl: 'locus/url',
1342
1577
  mediaAgentAlias: 'alias',
@@ -1345,11 +1580,15 @@ describe('internal-plugin-metrics', () => {
1345
1580
  userId: 'userId',
1346
1581
  },
1347
1582
  loginType: 'login-ci',
1583
+ telemetryOptOut: undefined,
1348
1584
  webClientPreload: undefined,
1349
1585
  name: 'client.alert.displayed',
1350
1586
  userType: 'host',
1351
1587
  isConvergedArchitectureEnabled: undefined,
1352
1588
  webexSubServiceType: undefined,
1589
+ isVipMeeting: false,
1590
+ isAutomatedUser: false,
1591
+ userActivation: undefined,
1353
1592
  },
1354
1593
  eventId: 'my-fake-id',
1355
1594
  origin: {
@@ -1376,6 +1615,7 @@ describe('internal-plugin-metrics', () => {
1376
1615
  correlationId: 'correlationId',
1377
1616
  deviceId: 'deviceUrl',
1378
1617
  locusId: 'url',
1618
+ locusSessionId: 'locusSessionId',
1379
1619
  locusStartTime: 'lastActive',
1380
1620
  locusUrl: 'locus/url',
1381
1621
  mediaAgentAlias: 'alias',
@@ -1384,11 +1624,15 @@ describe('internal-plugin-metrics', () => {
1384
1624
  userId: 'userId',
1385
1625
  },
1386
1626
  loginType: 'login-ci',
1627
+ telemetryOptOut: undefined,
1387
1628
  webClientPreload: undefined,
1388
1629
  name: 'client.alert.displayed',
1389
1630
  userType: 'host',
1390
1631
  isConvergedArchitectureEnabled: undefined,
1391
1632
  webexSubServiceType: undefined,
1633
+ isVipMeeting: false,
1634
+ isAutomatedUser: false,
1635
+ userActivation: undefined,
1392
1636
  },
1393
1637
  eventId: 'my-fake-id',
1394
1638
  origin: {
@@ -1450,6 +1694,7 @@ describe('internal-plugin-metrics', () => {
1450
1694
  sessionCorrelationId: 'sessionCorrelationId5',
1451
1695
  deviceId: 'deviceUrl',
1452
1696
  locusId: 'url',
1697
+ locusSessionId: 'locusSessionId',
1453
1698
  locusStartTime: 'lastActive',
1454
1699
  locusUrl: 'locus/url',
1455
1700
  mediaAgentAlias: 'alias',
@@ -1458,6 +1703,7 @@ describe('internal-plugin-metrics', () => {
1458
1703
  userId: 'userId',
1459
1704
  },
1460
1705
  loginType: 'login-ci',
1706
+ telemetryOptOut: undefined,
1461
1707
  name: 'client.alert.displayed',
1462
1708
  userType: 'host',
1463
1709
  userNameInput: 'test',
@@ -1465,6 +1711,9 @@ describe('internal-plugin-metrics', () => {
1465
1711
  isConvergedArchitectureEnabled: undefined,
1466
1712
  webexSubServiceType: undefined,
1467
1713
  webClientPreload: undefined,
1714
+ isVipMeeting: false,
1715
+ isAutomatedUser: false,
1716
+ userActivation: undefined,
1468
1717
  },
1469
1718
  options
1470
1719
  );
@@ -1480,6 +1729,7 @@ describe('internal-plugin-metrics', () => {
1480
1729
  sessionCorrelationId: 'sessionCorrelationId5',
1481
1730
  deviceId: 'deviceUrl',
1482
1731
  locusId: 'url',
1732
+ locusSessionId: 'locusSessionId',
1483
1733
  locusStartTime: 'lastActive',
1484
1734
  locusUrl: 'locus/url',
1485
1735
  mediaAgentAlias: 'alias',
@@ -1488,6 +1738,7 @@ describe('internal-plugin-metrics', () => {
1488
1738
  userId: 'userId',
1489
1739
  },
1490
1740
  loginType: 'login-ci',
1741
+ telemetryOptOut: undefined,
1491
1742
  name: 'client.alert.displayed',
1492
1743
  userType: 'host',
1493
1744
  userNameInput: 'test',
@@ -1495,6 +1746,9 @@ describe('internal-plugin-metrics', () => {
1495
1746
  isConvergedArchitectureEnabled: undefined,
1496
1747
  webexSubServiceType: undefined,
1497
1748
  webClientPreload: undefined,
1749
+ isVipMeeting: false,
1750
+ isAutomatedUser: false,
1751
+ userActivation: undefined,
1498
1752
  },
1499
1753
  eventId: 'my-fake-id',
1500
1754
  origin: {
@@ -1521,6 +1775,7 @@ describe('internal-plugin-metrics', () => {
1521
1775
  sessionCorrelationId: 'sessionCorrelationId5',
1522
1776
  deviceId: 'deviceUrl',
1523
1777
  locusId: 'url',
1778
+ locusSessionId: 'locusSessionId',
1524
1779
  locusStartTime: 'lastActive',
1525
1780
  locusUrl: 'locus/url',
1526
1781
  mediaAgentAlias: 'alias',
@@ -1529,6 +1784,7 @@ describe('internal-plugin-metrics', () => {
1529
1784
  userId: 'userId',
1530
1785
  },
1531
1786
  loginType: 'login-ci',
1787
+ telemetryOptOut: undefined,
1532
1788
  name: 'client.alert.displayed',
1533
1789
  userType: 'host',
1534
1790
  userNameInput: 'test',
@@ -1536,6 +1792,9 @@ describe('internal-plugin-metrics', () => {
1536
1792
  isConvergedArchitectureEnabled: undefined,
1537
1793
  webexSubServiceType: undefined,
1538
1794
  webClientPreload: undefined,
1795
+ isVipMeeting: false,
1796
+ isAutomatedUser: false,
1797
+ userActivation: undefined,
1539
1798
  },
1540
1799
  eventId: 'my-fake-id',
1541
1800
  origin: {
@@ -1660,8 +1919,11 @@ describe('internal-plugin-metrics', () => {
1660
1919
  userId: 'userId',
1661
1920
  },
1662
1921
  loginType: 'login-ci',
1922
+ telemetryOptOut: undefined,
1663
1923
  name: 'client.alert.displayed',
1664
1924
  webClientPreload: undefined,
1925
+ isAutomatedUser: false,
1926
+ userActivation: undefined,
1665
1927
  },
1666
1928
  options
1667
1929
  );
@@ -1683,8 +1945,11 @@ describe('internal-plugin-metrics', () => {
1683
1945
  userId: 'userId',
1684
1946
  },
1685
1947
  loginType: 'login-ci',
1948
+ telemetryOptOut: undefined,
1686
1949
  name: 'client.alert.displayed',
1687
1950
  webClientPreload: undefined,
1951
+ isAutomatedUser: false,
1952
+ userActivation: undefined,
1688
1953
  },
1689
1954
  eventId: 'my-fake-id',
1690
1955
  origin: {
@@ -1758,8 +2023,11 @@ describe('internal-plugin-metrics', () => {
1758
2023
  userId: 'myPreLoginId',
1759
2024
  },
1760
2025
  loginType: 'login-ci',
2026
+ telemetryOptOut: undefined,
1761
2027
  name: 'client.alert.displayed',
1762
2028
  webClientPreload: undefined,
2029
+ isAutomatedUser: false,
2030
+ userActivation: undefined,
1763
2031
  },
1764
2032
  options
1765
2033
  );
@@ -1787,7 +2055,10 @@ describe('internal-plugin-metrics', () => {
1787
2055
  },
1788
2056
  eventData: {webClientDomain: 'whatever', isMercuryConnected: true},
1789
2057
  loginType: 'login-ci',
2058
+ telemetryOptOut: undefined,
1790
2059
  webClientPreload: undefined,
2060
+ isAutomatedUser: false,
2061
+ userActivation: undefined,
1791
2062
  },
1792
2063
  },
1793
2064
  options.preLoginId
@@ -1849,8 +2120,11 @@ describe('internal-plugin-metrics', () => {
1849
2120
  userNameInput: 'current',
1850
2121
  emailInput: 'current',
1851
2122
  loginType: 'login-ci',
2123
+ telemetryOptOut: undefined,
1852
2124
  name: 'client.alert.displayed',
1853
2125
  webClientPreload: undefined,
2126
+ isAutomatedUser: false,
2127
+ userActivation: undefined,
1854
2128
  },
1855
2129
  options
1856
2130
  );
@@ -1878,9 +2152,12 @@ describe('internal-plugin-metrics', () => {
1878
2152
  },
1879
2153
  eventData: {webClientDomain: 'whatever', isMercuryConnected: true},
1880
2154
  loginType: 'login-ci',
2155
+ telemetryOptOut: undefined,
1881
2156
  userNameInput: 'current',
1882
2157
  emailInput: 'current',
1883
2158
  webClientPreload: undefined,
2159
+ isAutomatedUser: false,
2160
+ userActivation: undefined,
1884
2161
  },
1885
2162
  },
1886
2163
  options.preLoginId
@@ -1911,6 +2188,7 @@ describe('internal-plugin-metrics', () => {
1911
2188
  correlationId: 'correlationId2',
1912
2189
  deviceId: 'deviceUrl',
1913
2190
  locusId: 'url',
2191
+ locusSessionId: 'locusSessionId',
1914
2192
  locusStartTime: 'lastActive',
1915
2193
  locusUrl: 'locus/url',
1916
2194
  mediaAgentAlias: 'alias',
@@ -1919,12 +2197,16 @@ describe('internal-plugin-metrics', () => {
1919
2197
  userId: 'userId',
1920
2198
  },
1921
2199
  loginType: 'fakeLoginType',
2200
+ telemetryOptOut: undefined,
1922
2201
  name: 'client.alert.displayed',
1923
2202
  userType: 'host',
1924
2203
  joinFlowVersion: 'Other',
1925
2204
  isConvergedArchitectureEnabled: undefined,
1926
2205
  webexSubServiceType: undefined,
1927
2206
  webClientPreload: undefined,
2207
+ isVipMeeting: false,
2208
+ isAutomatedUser: false,
2209
+ userActivation: undefined,
1928
2210
  },
1929
2211
  eventId: 'my-fake-id',
1930
2212
  origin: {
@@ -1965,6 +2247,7 @@ describe('internal-plugin-metrics', () => {
1965
2247
  sessionCorrelationId: 'sessionCorrelationId1',
1966
2248
  deviceId: 'deviceUrl',
1967
2249
  locusId: 'url',
2250
+ locusSessionId: 'locusSessionId',
1968
2251
  locusStartTime: 'lastActive',
1969
2252
  locusUrl: 'locus/url',
1970
2253
  mediaAgentAlias: 'alias',
@@ -1973,12 +2256,16 @@ describe('internal-plugin-metrics', () => {
1973
2256
  userId: 'userId',
1974
2257
  },
1975
2258
  loginType: 'fakeLoginType',
2259
+ telemetryOptOut: undefined,
1976
2260
  name: 'client.alert.displayed',
1977
2261
  userType: 'host',
1978
2262
  joinFlowVersion: 'Other',
1979
2263
  isConvergedArchitectureEnabled: undefined,
1980
2264
  webexSubServiceType: undefined,
1981
2265
  webClientPreload: undefined,
2266
+ isVipMeeting: false,
2267
+ isAutomatedUser: false,
2268
+ userActivation: undefined,
1982
2269
  },
1983
2270
  eventId: 'my-fake-id',
1984
2271
  origin: {
@@ -2033,8 +2320,11 @@ describe('internal-plugin-metrics', () => {
2033
2320
  userId: 'userId',
2034
2321
  },
2035
2322
  loginType: 'login-ci',
2323
+ telemetryOptOut: undefined,
2036
2324
  name: 'client.alert.displayed',
2037
2325
  webClientPreload: true,
2326
+ isAutomatedUser: false,
2327
+ userActivation: undefined,
2038
2328
  },
2039
2329
  options
2040
2330
  );
@@ -2056,8 +2346,221 @@ describe('internal-plugin-metrics', () => {
2056
2346
  userId: 'userId',
2057
2347
  },
2058
2348
  loginType: 'login-ci',
2349
+ telemetryOptOut: undefined,
2059
2350
  name: 'client.alert.displayed',
2060
2351
  webClientPreload: true,
2352
+ isAutomatedUser: false,
2353
+ userActivation: undefined,
2354
+ },
2355
+ eventId: 'my-fake-id',
2356
+ origin: {
2357
+ origin: 'fake-origin',
2358
+ },
2359
+ originTime: {
2360
+ sent: 'not_defined_yet',
2361
+ triggered: now.toISOString(),
2362
+ },
2363
+ senderCountryCode: 'UK',
2364
+ version: 1,
2365
+ });
2366
+ });
2367
+
2368
+ it('should submit client event with isVipMeeting: false when vipMeeting is false', () => {
2369
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
2370
+ const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
2371
+ const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
2372
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
2373
+
2374
+ webex.meetings.getBasicMeetingInformation = sinon.stub().returns({
2375
+ ...fakeMeeting,
2376
+ meetingInfo: {
2377
+ vipmeeting: false,
2378
+ },
2379
+ });
2380
+
2381
+ const options = {
2382
+ correlationId: 'correlationId',
2383
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2384
+ globalMeetingId: 'globalMeetingId1',
2385
+ sessionCorrelationId: 'sessionCorrelationId1',
2386
+ meetingId: fakeMeeting.id,
2387
+ };
2388
+ cd.setMercuryConnectedStatus(true);
2389
+ cd.submitClientEvent({
2390
+ name: 'client.alert.displayed',
2391
+ options,
2392
+ });
2393
+
2394
+ assert.notCalled(generateClientEventErrorPayloadSpy);
2395
+ assert.calledWith(
2396
+ prepareDiagnosticEventSpy,
2397
+ {
2398
+ canProceed: true,
2399
+ eventData: {
2400
+ webClientDomain: 'whatever',
2401
+ isMercuryConnected: true,
2402
+ },
2403
+ identifiers: {
2404
+ correlationId: 'correlationId',
2405
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2406
+ globalMeetingId: 'globalMeetingId1',
2407
+ sessionCorrelationId: 'sessionCorrelationId1',
2408
+ deviceId: 'deviceUrl',
2409
+ locusId: 'url',
2410
+ locusSessionId: 'locusSessionId',
2411
+ locusStartTime: 'lastActive',
2412
+ locusUrl: 'locus/url',
2413
+ orgId: 'orgId',
2414
+ userId: 'userId',
2415
+ },
2416
+ loginType: 'login-ci',
2417
+ telemetryOptOut: undefined,
2418
+ name: 'client.alert.displayed',
2419
+ userType: 'host',
2420
+ isConvergedArchitectureEnabled: undefined,
2421
+ webexSubServiceType: undefined,
2422
+ webClientPreload: undefined,
2423
+ isVipMeeting: false,
2424
+ isAutomatedUser: false,
2425
+ userActivation: undefined,
2426
+ },
2427
+ options
2428
+ );
2429
+ assert.calledWith(submitToCallDiagnosticsSpy, {
2430
+ event: {
2431
+ canProceed: true,
2432
+ eventData: {
2433
+ webClientDomain: 'whatever',
2434
+ isMercuryConnected: true,
2435
+ },
2436
+ identifiers: {
2437
+ correlationId: 'correlationId',
2438
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2439
+ globalMeetingId: 'globalMeetingId1',
2440
+ sessionCorrelationId: 'sessionCorrelationId1',
2441
+ deviceId: 'deviceUrl',
2442
+ locusId: 'url',
2443
+ locusSessionId: 'locusSessionId',
2444
+ locusStartTime: 'lastActive',
2445
+ locusUrl: 'locus/url',
2446
+ orgId: 'orgId',
2447
+ userId: 'userId',
2448
+ },
2449
+ loginType: 'login-ci',
2450
+ telemetryOptOut: undefined,
2451
+ name: 'client.alert.displayed',
2452
+ userType: 'host',
2453
+ isConvergedArchitectureEnabled: undefined,
2454
+ webexSubServiceType: undefined,
2455
+ webClientPreload: undefined,
2456
+ isVipMeeting: false,
2457
+ isAutomatedUser: false,
2458
+ userActivation: undefined,
2459
+ },
2460
+ eventId: 'my-fake-id',
2461
+ origin: {
2462
+ origin: 'fake-origin',
2463
+ },
2464
+ originTime: {
2465
+ sent: 'not_defined_yet',
2466
+ triggered: now.toISOString(),
2467
+ },
2468
+ senderCountryCode: 'UK',
2469
+ version: 1,
2470
+ });
2471
+ });
2472
+
2473
+ it('should submit client event with isVipMeeting: true when vipMeeting is true', () => {
2474
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
2475
+ const submitToCallDiagnosticsSpy = sinon.spy(cd, 'submitToCallDiagnostics');
2476
+ const generateClientEventErrorPayloadSpy = sinon.spy(cd, 'generateClientEventErrorPayload');
2477
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
2478
+
2479
+ webex.meetings.getBasicMeetingInformation = sinon.stub().returns({
2480
+ ...fakeMeeting,
2481
+ meetingInfo: {
2482
+ vipmeeting: true,
2483
+ },
2484
+ });
2485
+
2486
+ const options = {
2487
+ correlationId: 'correlationId',
2488
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2489
+ globalMeetingId: 'globalMeetingId1',
2490
+ sessionCorrelationId: 'sessionCorrelationId1',
2491
+ meetingId: fakeMeeting.id,
2492
+ };
2493
+ cd.setMercuryConnectedStatus(true);
2494
+ cd.submitClientEvent({
2495
+ name: 'client.alert.displayed',
2496
+ options,
2497
+ });
2498
+
2499
+ assert.notCalled(generateClientEventErrorPayloadSpy);
2500
+ assert.calledWith(
2501
+ prepareDiagnosticEventSpy,
2502
+ {
2503
+ canProceed: true,
2504
+ eventData: {
2505
+ webClientDomain: 'whatever',
2506
+ isMercuryConnected: true,
2507
+ },
2508
+ identifiers: {
2509
+ correlationId: 'correlationId',
2510
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2511
+ globalMeetingId: 'globalMeetingId1',
2512
+ sessionCorrelationId: 'sessionCorrelationId1',
2513
+ deviceId: 'deviceUrl',
2514
+ locusId: 'url',
2515
+ locusSessionId: 'locusSessionId',
2516
+ locusStartTime: 'lastActive',
2517
+ locusUrl: 'locus/url',
2518
+ orgId: 'orgId',
2519
+ userId: 'userId',
2520
+ },
2521
+ loginType: 'login-ci',
2522
+ telemetryOptOut: undefined,
2523
+ name: 'client.alert.displayed',
2524
+ userType: 'host',
2525
+ isConvergedArchitectureEnabled: undefined,
2526
+ webexSubServiceType: undefined,
2527
+ webClientPreload: undefined,
2528
+ isVipMeeting: true,
2529
+ isAutomatedUser: false,
2530
+ userActivation: undefined,
2531
+ },
2532
+ options
2533
+ );
2534
+ assert.calledWith(submitToCallDiagnosticsSpy, {
2535
+ event: {
2536
+ canProceed: true,
2537
+ eventData: {
2538
+ webClientDomain: 'whatever',
2539
+ isMercuryConnected: true,
2540
+ },
2541
+ identifiers: {
2542
+ correlationId: 'correlationId',
2543
+ webexConferenceIdStr: 'webexConferenceIdStr1',
2544
+ globalMeetingId: 'globalMeetingId1',
2545
+ sessionCorrelationId: 'sessionCorrelationId1',
2546
+ deviceId: 'deviceUrl',
2547
+ locusId: 'url',
2548
+ locusSessionId: 'locusSessionId',
2549
+ locusStartTime: 'lastActive',
2550
+ locusUrl: 'locus/url',
2551
+ orgId: 'orgId',
2552
+ userId: 'userId',
2553
+ },
2554
+ loginType: 'login-ci',
2555
+ telemetryOptOut: undefined,
2556
+ name: 'client.alert.displayed',
2557
+ userType: 'host',
2558
+ isConvergedArchitectureEnabled: undefined,
2559
+ webexSubServiceType: undefined,
2560
+ webClientPreload: undefined,
2561
+ isVipMeeting: true,
2562
+ isAutomatedUser: false,
2563
+ userActivation: undefined,
2061
2564
  },
2062
2565
  eventId: 'my-fake-id',
2063
2566
  origin: {
@@ -2106,6 +2609,7 @@ describe('internal-plugin-metrics', () => {
2106
2609
  globalMeetingId: 'globalMeetingId1',
2107
2610
  deviceId: 'deviceUrl',
2108
2611
  locusId: 'url',
2612
+ locusSessionId: 'locusSessionId',
2109
2613
  locusStartTime: 'lastActive',
2110
2614
  locusUrl: 'locus/url',
2111
2615
  mediaAgentAlias: 'alias',
@@ -2126,11 +2630,15 @@ describe('internal-plugin-metrics', () => {
2126
2630
  },
2127
2631
  ],
2128
2632
  loginType: 'login-ci',
2633
+ telemetryOptOut: undefined,
2129
2634
  name: 'client.alert.displayed',
2130
2635
  userType: 'host',
2131
2636
  isConvergedArchitectureEnabled: undefined,
2132
2637
  webexSubServiceType: undefined,
2133
2638
  webClientPreload: undefined,
2639
+ isVipMeeting: false,
2640
+ isAutomatedUser: false,
2641
+ userActivation: undefined,
2134
2642
  },
2135
2643
  eventId: 'my-fake-id',
2136
2644
  origin: {
@@ -2184,6 +2692,7 @@ describe('internal-plugin-metrics', () => {
2184
2692
  correlationId: 'correlationId',
2185
2693
  deviceId: 'deviceUrl',
2186
2694
  locusId: 'url',
2695
+ locusSessionId: 'locusSessionId',
2187
2696
  locusStartTime: 'lastActive',
2188
2697
  locusUrl: 'locus/url',
2189
2698
  mediaAgentAlias: 'alias',
@@ -2207,11 +2716,15 @@ describe('internal-plugin-metrics', () => {
2207
2716
  },
2208
2717
  ],
2209
2718
  loginType: 'login-ci',
2719
+ telemetryOptOut: undefined,
2210
2720
  name: 'client.alert.displayed',
2211
2721
  userType: 'host',
2212
2722
  isConvergedArchitectureEnabled: undefined,
2213
2723
  webexSubServiceType: undefined,
2214
2724
  webClientPreload: undefined,
2725
+ isVipMeeting: false,
2726
+ isAutomatedUser: false,
2727
+ userActivation: undefined,
2215
2728
  },
2216
2729
  eventId: 'my-fake-id',
2217
2730
  origin: {
@@ -2283,8 +2796,11 @@ describe('internal-plugin-metrics', () => {
2283
2796
  },
2284
2797
  ],
2285
2798
  loginType: 'login-ci',
2799
+ telemetryOptOut: undefined,
2286
2800
  name: 'client.alert.displayed',
2287
2801
  webClientPreload: undefined,
2802
+ isAutomatedUser: false,
2803
+ userActivation: undefined,
2288
2804
  },
2289
2805
  eventId: 'my-fake-id',
2290
2806
  origin: {
@@ -2358,8 +2874,11 @@ describe('internal-plugin-metrics', () => {
2358
2874
  },
2359
2875
  ],
2360
2876
  loginType: 'login-ci',
2877
+ telemetryOptOut: undefined,
2361
2878
  name: 'client.alert.displayed',
2362
2879
  webClientPreload: undefined,
2880
+ isAutomatedUser: false,
2881
+ userActivation: undefined,
2363
2882
  },
2364
2883
  eventId: 'my-fake-id',
2365
2884
  origin: {
@@ -2423,6 +2942,7 @@ describe('internal-plugin-metrics', () => {
2423
2942
  correlationId: 'correlationId',
2424
2943
  deviceId: 'deviceUrl',
2425
2944
  locusId: 'url',
2945
+ locusSessionId: 'locusSessionId',
2426
2946
  locusStartTime: 'lastActive',
2427
2947
  locusUrl: 'locus/url',
2428
2948
  mediaAgentAlias: 'alias',
@@ -2439,11 +2959,15 @@ describe('internal-plugin-metrics', () => {
2439
2959
  },
2440
2960
  ],
2441
2961
  loginType: 'login-ci',
2962
+ telemetryOptOut: undefined,
2442
2963
  name: 'client.alert.displayed',
2443
2964
  userType: 'host',
2444
2965
  isConvergedArchitectureEnabled: undefined,
2445
2966
  webexSubServiceType: undefined,
2446
2967
  webClientPreload: undefined,
2968
+ isVipMeeting: false,
2969
+ isAutomatedUser: false,
2970
+ userActivation: undefined,
2447
2971
  },
2448
2972
  eventId: 'my-fake-id',
2449
2973
  origin: {
@@ -2534,16 +3058,18 @@ describe('internal-plugin-metrics', () => {
2534
3058
  });
2535
3059
 
2536
3060
  assert.calledThrice(submitToCallDiagnosticsStub);
2537
- });
3061
+ });
2538
3062
 
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]) => {
3063
+ (
3064
+ [
3065
+ ['client.media.render.start'],
3066
+ ['client.media.render.stop'],
3067
+ ['client.media.rx.start'],
3068
+ ['client.media.rx.stop'],
3069
+ ['client.media.tx.start'],
3070
+ ['client.media.tx.stop'],
3071
+ ] as const
3072
+ ).forEach(([name]) => {
2547
3073
  it(`should only send ${name} once per mediaType`, () => {
2548
3074
  const options = {
2549
3075
  meetingId: fakeMeeting.id,
@@ -2587,7 +3113,8 @@ describe('internal-plugin-metrics', () => {
2587
3113
  });
2588
3114
 
2589
3115
  assert.notCalled(submitToCallDiagnosticsStub);
2590
- assert.neverCalledWithMatch(webex.logger.log,
3116
+ assert.neverCalledWithMatch(
3117
+ webex.logger.log,
2591
3118
  'call-diagnostic-events -> ',
2592
3119
  sinon.match(createEventLimitRegex(name, 'mediaType video'))
2593
3120
  );
@@ -2630,7 +3157,7 @@ describe('internal-plugin-metrics', () => {
2630
3157
  // Send event with different shareInstanceId
2631
3158
  cd.submitClientEvent({
2632
3159
  name,
2633
- payload: { ...payload, shareInstanceId: 'instance-2' },
3160
+ payload: {...payload, shareInstanceId: 'instance-2'},
2634
3161
  options,
2635
3162
  });
2636
3163
 
@@ -2638,89 +3165,88 @@ describe('internal-plugin-metrics', () => {
2638
3165
  });
2639
3166
  });
2640
3167
 
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,
3168
+ ([['client.roap-message.received'], ['client.roap-message.sent']] as const).forEach(
3169
+ ([name]) => {
3170
+ it(`should not send third event of same type and not log warning again for ${name}`, () => {
3171
+ const options = {
3172
+ meetingId: fakeMeeting.id,
3173
+ };
3174
+ const payload = {
3175
+ roap: {
3176
+ messageType: 'OFFER' as const,
3177
+ },
3178
+ };
3179
+ const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
3180
+
3181
+ // Clear any existing call history to get accurate counts
3182
+ webex.logger.log.resetHistory();
3183
+
3184
+ // Send first event
3185
+ cd.submitClientEvent({
3186
+ name,
3187
+ payload,
3188
+ options,
3189
+ });
3190
+
3191
+ assert.calledOnce(submitToCallDiagnosticsStub);
3192
+ submitToCallDiagnosticsStub.resetHistory();
3193
+
3194
+ // Send second event (should trigger warning)
3195
+ cd.submitClientEvent({
3196
+ name,
3197
+ payload,
3198
+ options,
3199
+ });
3200
+
3201
+ assert.notCalled(submitToCallDiagnosticsStub);
3202
+ assert.calledWith(
3203
+ webex.logger.log,
3204
+ 'call-diagnostic-events -> ',
3205
+ sinon.match(createEventLimitRegex(name, 'ROAP type OFFER'))
3206
+ );
3207
+ webex.logger.log.resetHistory();
3208
+
3209
+ cd.submitClientEvent({
3210
+ name,
3211
+ payload,
3212
+ options,
3213
+ });
3214
+
3215
+ assert.notCalled(submitToCallDiagnosticsStub);
3216
+ assert.neverCalledWithMatch(
3217
+ webex.logger.log,
3218
+ 'call-diagnostic-events -> ',
3219
+ sinon.match(createEventLimitRegex(name, 'ROAP type OFFER'))
3220
+ );
2664
3221
  });
2665
3222
 
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
- });
3223
+ it(`should handle roap.type instead of roap.messageType for ${name}`, () => {
3224
+ const options = {
3225
+ meetingId: fakeMeeting.id,
3226
+ };
3227
+ const payload = {
3228
+ roap: {
3229
+ type: 'ANSWER' as const,
3230
+ },
3231
+ };
3232
+ const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
2675
3233
 
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,
2688
- });
3234
+ cd.submitClientEvent({
3235
+ name,
3236
+ payload,
3237
+ options,
3238
+ });
2689
3239
 
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
- });
3240
+ cd.submitClientEvent({
3241
+ name,
3242
+ payload,
3243
+ options,
3244
+ });
2697
3245
 
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');
2708
-
2709
- cd.submitClientEvent({
2710
- name,
2711
- payload,
2712
- options,
2713
- });
2714
-
2715
- cd.submitClientEvent({
2716
- name,
2717
- payload,
2718
- options,
3246
+ assert.calledOnce(submitToCallDiagnosticsStub);
2719
3247
  });
2720
-
2721
- assert.calledOnce(submitToCallDiagnosticsStub);
2722
- });
2723
- });
3248
+ }
3249
+ );
2724
3250
  });
2725
3251
  });
2726
3252
 
@@ -2731,7 +3257,10 @@ describe('internal-plugin-metrics', () => {
2731
3257
  cd.callDiagnosticEventsBatcher = {request: requestStub};
2732
3258
  //@ts-ignore
2733
3259
  cd.submitToCallDiagnostics({event: 'test'});
2734
- assert.calledWith(requestStub, {eventPayload: {event: 'test'}, type: ['diagnostic-event']});
3260
+ assert.calledWith(requestStub, {
3261
+ eventPayload: {event: 'test'},
3262
+ type: ['diagnostic-event'],
3263
+ });
2735
3264
  });
2736
3265
  });
2737
3266
 
@@ -2784,6 +3313,7 @@ describe('internal-plugin-metrics', () => {
2784
3313
  orgId: 'orgId',
2785
3314
  locusUrl: 'locus/url',
2786
3315
  locusId: 'url',
3316
+ locusSessionId: 'locusSessionId',
2787
3317
  locusStartTime: 'lastActive',
2788
3318
  },
2789
3319
  eventData: {webClientDomain: 'whatever'},
@@ -2799,6 +3329,7 @@ describe('internal-plugin-metrics', () => {
2799
3329
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
2800
3330
  startTime: now.toISOString(),
2801
3331
  },
3332
+ webexSubServiceType: undefined,
2802
3333
  },
2803
3334
  options
2804
3335
  );
@@ -2823,6 +3354,7 @@ describe('internal-plugin-metrics', () => {
2823
3354
  orgId: 'orgId',
2824
3355
  locusUrl: 'locus/url',
2825
3356
  locusId: 'url',
3357
+ locusSessionId: 'locusSessionId',
2826
3358
  locusStartTime: 'lastActive',
2827
3359
  },
2828
3360
  eventData: {webClientDomain: 'whatever'},
@@ -2838,6 +3370,7 @@ describe('internal-plugin-metrics', () => {
2838
3370
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
2839
3371
  startTime: now.toISOString(),
2840
3372
  },
3373
+ webexSubServiceType: undefined,
2841
3374
  },
2842
3375
  },
2843
3376
  });
@@ -2860,6 +3393,7 @@ describe('internal-plugin-metrics', () => {
2860
3393
  orgId: 'orgId',
2861
3394
  locusUrl: 'locus/url',
2862
3395
  locusId: 'url',
3396
+ locusSessionId: 'locusSessionId',
2863
3397
  locusStartTime: 'lastActive',
2864
3398
  },
2865
3399
  eventData: {webClientDomain: 'whatever'},
@@ -2875,10 +3409,48 @@ describe('internal-plugin-metrics', () => {
2875
3409
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
2876
3410
  startTime: now.toISOString(),
2877
3411
  },
3412
+ webexSubServiceType: undefined,
2878
3413
  },
2879
3414
  });
2880
3415
  });
2881
3416
 
3417
+ it('includes webexSubServiceType in the media quality event payload', () => {
3418
+ const meeting = {
3419
+ ...fakeMeeting,
3420
+ meetingInfo: {
3421
+ enableConvergedArchitecture: true,
3422
+ enableEvent: true,
3423
+ enableConvergedWebinarLargeScale: true,
3424
+ },
3425
+ };
3426
+ const prepareDiagnosticEventSpy = sinon.spy(cd, 'prepareDiagnosticEvent');
3427
+ sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
3428
+ webex.meetings.getBasicMeetingInformation = sinon.stub().returns(meeting);
3429
+
3430
+ const options = {
3431
+ networkType: 'wifi' as const,
3432
+ meetingId: fakeMeeting.id,
3433
+ };
3434
+
3435
+ cd.submitMQE({
3436
+ name: 'client.mediaquality.event',
3437
+ payload: {
3438
+ //@ts-ignore
3439
+ intervals: [{}],
3440
+ },
3441
+ options,
3442
+ });
3443
+
3444
+ assert.calledOnceWithExactly(
3445
+ prepareDiagnosticEventSpy,
3446
+ sinon.match({
3447
+ name: 'client.mediaquality.event',
3448
+ webexSubServiceType: 'LargeScaleWebinar',
3449
+ }),
3450
+ options
3451
+ );
3452
+ });
3453
+
2882
3454
  it('throws if meeting id not provided', () => {
2883
3455
  assert.throws(() =>
2884
3456
  cd.submitMQE({
@@ -3599,6 +4171,97 @@ describe('internal-plugin-metrics', () => {
3599
4171
  });
3600
4172
  });
3601
4173
 
4174
+ describe('#getTelemetryOptOut', () => {
4175
+ it('returns "manual" when manual telemetry opt-out is enabled', () => {
4176
+ cd.setIsTelemetryOptOutManual(true);
4177
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4178
+ });
4179
+
4180
+ it('returns "automatic" when automatic telemetry opt-out is enabled', () => {
4181
+ cd.setIsTelemetryOptOutAutomatic(true);
4182
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4183
+ });
4184
+
4185
+ it('returns "manual" when manual opt-out takes precedence over automatic', () => {
4186
+ cd.setIsTelemetryOptOutManual(true);
4187
+ cd.setIsTelemetryOptOutAutomatic(true);
4188
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4189
+ });
4190
+
4191
+ it('returns undefined when neither manual nor automatic opt-out is set', () => {
4192
+ assert.isUndefined(cd.getTelemetryOptOut());
4193
+ });
4194
+
4195
+ it('returns undefined after disabling manual opt-out', () => {
4196
+ cd.setIsTelemetryOptOutManual(true);
4197
+ cd.setIsTelemetryOptOutManual(false);
4198
+ assert.isUndefined(cd.getTelemetryOptOut());
4199
+ });
4200
+ });
4201
+
4202
+ describe('#setIsTelemetryOptOutManual', () => {
4203
+ it('sets manual telemetry opt-out to true', () => {
4204
+ cd.setIsTelemetryOptOutManual(true);
4205
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4206
+ });
4207
+
4208
+ it('sets manual telemetry opt-out to false', () => {
4209
+ cd.setIsTelemetryOptOutManual(true);
4210
+ cd.setIsTelemetryOptOutManual(false);
4211
+ assert.isUndefined(cd.getTelemetryOptOut());
4212
+ });
4213
+
4214
+ it('can toggle manual telemetry opt-out multiple times', () => {
4215
+ cd.setIsTelemetryOptOutManual(true);
4216
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4217
+
4218
+ cd.setIsTelemetryOptOutManual(false);
4219
+ assert.isUndefined(cd.getTelemetryOptOut());
4220
+
4221
+ cd.setIsTelemetryOptOutManual(true);
4222
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4223
+ });
4224
+
4225
+ it('manual opt-out takes precedence when automatic is also set', () => {
4226
+ cd.setIsTelemetryOptOutAutomatic(true);
4227
+ cd.setIsTelemetryOptOutManual(true);
4228
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4229
+ });
4230
+ });
4231
+
4232
+ describe('#setIsTelemetryOptOutAutomatic', () => {
4233
+ it('sets automatic telemetry opt-out to true', () => {
4234
+ cd.setIsTelemetryOptOutAutomatic(true);
4235
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4236
+ });
4237
+
4238
+ it('sets automatic telemetry opt-out to false', () => {
4239
+ cd.setIsTelemetryOptOutAutomatic(true);
4240
+ cd.setIsTelemetryOptOutAutomatic(false);
4241
+ assert.isUndefined(cd.getTelemetryOptOut());
4242
+ });
4243
+
4244
+ it('can toggle automatic telemetry opt-out multiple times', () => {
4245
+ cd.setIsTelemetryOptOutAutomatic(true);
4246
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4247
+
4248
+ cd.setIsTelemetryOptOutAutomatic(false);
4249
+ assert.isUndefined(cd.getTelemetryOptOut());
4250
+
4251
+ cd.setIsTelemetryOptOutAutomatic(true);
4252
+ assert.equal(cd.getTelemetryOptOut(), 'automatic');
4253
+ });
4254
+
4255
+ it('does not override manual opt-out', () => {
4256
+ cd.setIsTelemetryOptOutManual(true);
4257
+ cd.setIsTelemetryOptOutAutomatic(true);
4258
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4259
+
4260
+ cd.setIsTelemetryOptOutAutomatic(false);
4261
+ assert.equal(cd.getTelemetryOptOut(), 'manual');
4262
+ });
4263
+ });
4264
+
3602
4265
  describe('#getSubServiceType', () => {
3603
4266
  it('returns subServicetype as PMR when PMR meeting', () => {
3604
4267
  fakeMeeting.meetingInfo = {
@@ -3648,6 +4311,15 @@ describe('internal-plugin-metrics', () => {
3648
4311
  assert.deepEqual(cd.getSubServiceType(fakeMeeting), 'Webcast');
3649
4312
  });
3650
4313
 
4314
+ it('returns subServicetype as LargeScaleWebinar when meeting is converged Webinar and enable large scale', () => {
4315
+ fakeMeeting.meetingInfo = {
4316
+ enableEvent: true,
4317
+ enableConvergedArchitecture: true,
4318
+ enableConvergedWebinarLargeScale: true,
4319
+ };
4320
+ assert.deepEqual(cd.getSubServiceType(fakeMeeting), 'LargeScaleWebinar');
4321
+ });
4322
+
3651
4323
  it('returns subServicetype as undefined when correct parameters are not found', () => {
3652
4324
  fakeMeeting.meetingInfo = {};
3653
4325
  assert.deepEqual(cd.getSubServiceType(fakeMeeting), undefined);
@@ -3701,18 +4373,23 @@ describe('internal-plugin-metrics', () => {
3701
4373
  correlationId: 'correlationId',
3702
4374
  deviceId: 'deviceUrl',
3703
4375
  locusId: 'url',
4376
+ locusSessionId: 'locusSessionId',
3704
4377
  locusStartTime: 'lastActive',
3705
4378
  locusUrl: 'locus/url',
3706
4379
  orgId: 'orgId',
3707
4380
  userId: 'userId',
3708
4381
  },
3709
4382
  loginType: 'login-ci',
4383
+ telemetryOptOut: undefined,
3710
4384
  name: 'client.exit.app',
3711
4385
  trigger: 'user-interaction',
3712
4386
  userType: 'host',
3713
4387
  isConvergedArchitectureEnabled: undefined,
3714
4388
  webexSubServiceType: undefined,
3715
4389
  webClientPreload: undefined,
4390
+ isVipMeeting: false,
4391
+ isAutomatedUser: false,
4392
+ userActivation: undefined,
3716
4393
  },
3717
4394
  eventId: 'my-fake-id',
3718
4395
  origin: {
@@ -3867,6 +4544,30 @@ describe('internal-plugin-metrics', () => {
3867
4544
  options.meetingJoinPhase
3868
4545
  );
3869
4546
  });
4547
+
4548
+ it('builds request options before webex is ready (no meetings plugin or internal metrics config)', async () => {
4549
+ // before webex.ready the meetings plugin and internal metrics config are not available
4550
+ webex.meetings = undefined;
4551
+ webex.internal.metrics = undefined;
4552
+
4553
+ const options = {
4554
+ correlationId: 'myCorrelationId',
4555
+ clientType: 'TEAMS_CLIENT',
4556
+ subClientType: 'WEB_APP',
4557
+ };
4558
+
4559
+ const fetchOptions = await cd.buildClientEventFetchRequestOptions({
4560
+ name: 'client.exit.app',
4561
+ payload: {trigger: 'user-interaction', canProceed: false},
4562
+ options,
4563
+ });
4564
+
4565
+ const eventPayload = fetchOptions.body.metrics[0].eventPayload;
4566
+ assert.equal(eventPayload.event.name, 'client.exit.app');
4567
+ assert.isUndefined(eventPayload.senderCountryCode);
4568
+ assert.isUndefined(fetchOptions.waitForServiceTimeout);
4569
+ assert.equal(fetchOptions.resource, 'clientmetrics');
4570
+ });
3870
4571
  });
3871
4572
 
3872
4573
  describe('#submitToCallDiagnosticsPreLogin', () => {
@@ -3880,7 +4581,10 @@ describe('internal-plugin-metrics', () => {
3880
4581
  cd.submitToCallDiagnosticsPreLogin({event: 'test'}, preLoginId);
3881
4582
  //@ts-ignore
3882
4583
  assert.calledWith(cd.preLoginMetricsBatcher.savePreLoginId, preLoginId);
3883
- assert.calledWith(requestStub, {eventPayload: {event: 'test'}, type: ['diagnostic-event']});
4584
+ assert.calledWith(requestStub, {
4585
+ eventPayload: {event: 'test'},
4586
+ type: ['diagnostic-event'],
4587
+ });
3884
4588
  });
3885
4589
  });
3886
4590
 
@@ -4081,12 +4785,14 @@ describe('internal-plugin-metrics', () => {
4081
4785
  payload: {
4082
4786
  meetingSummaryInfo: {
4083
4787
  featureName: 'syncSystemMuteStatus',
4084
- featureActions: [{
4085
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4086
- actionId: '14200',
4087
- isInitialValue: false,
4088
- clickCount: '1'
4089
- }]
4788
+ featureActions: [
4789
+ {
4790
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4791
+ actionId: '14200',
4792
+ isInitialValue: false,
4793
+ clickCount: '1',
4794
+ },
4795
+ ],
4090
4796
  },
4091
4797
  },
4092
4798
  options,
@@ -4104,24 +4810,31 @@ describe('internal-plugin-metrics', () => {
4104
4810
  orgId: 'orgId',
4105
4811
  locusUrl: 'locus/url',
4106
4812
  locusId: 'url',
4813
+ locusSessionId: 'locusSessionId',
4107
4814
  locusStartTime: 'lastActive',
4108
4815
  },
4109
- eventData: { webClientDomain: 'whatever'},
4816
+ eventData: {webClientDomain: 'whatever'},
4110
4817
  userType: 'host',
4111
4818
  loginType: 'login-ci',
4819
+ telemetryOptOut: undefined,
4112
4820
  isConvergedArchitectureEnabled: undefined,
4113
4821
  webexSubServiceType: undefined,
4114
4822
  webClientPreload: undefined,
4823
+ isVipMeeting: false,
4824
+ isAutomatedUser: false,
4825
+ userActivation: undefined,
4115
4826
  meetingSummaryInfo: {
4116
4827
  featureName: 'syncSystemMuteStatus',
4117
- featureActions: [{
4118
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4119
- actionId: '14200',
4120
- isInitialValue: false,
4121
- clickCount: '1'
4122
- }]
4828
+ featureActions: [
4829
+ {
4830
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4831
+ actionId: '14200',
4832
+ isInitialValue: false,
4833
+ clickCount: '1',
4834
+ },
4835
+ ],
4123
4836
  },
4124
- key: "UcfFeatureUsage",
4837
+ key: 'UcfFeatureUsage',
4125
4838
  },
4126
4839
  options
4127
4840
  );
@@ -4134,32 +4847,39 @@ describe('internal-plugin-metrics', () => {
4134
4847
  },
4135
4848
  event: {
4136
4849
  canProceed: true,
4137
- eventData: { webClientDomain: 'whatever'},
4850
+ eventData: {webClientDomain: 'whatever'},
4138
4851
  identifiers: {
4139
4852
  correlationId: 'correlationId',
4140
4853
  deviceId: 'deviceUrl',
4141
4854
  locusId: 'url',
4142
4855
  locusStartTime: 'lastActive',
4143
4856
  locusUrl: 'locus/url',
4857
+ locusSessionId: 'locusSessionId',
4144
4858
  orgId: 'orgId',
4145
4859
  userId: 'userId',
4146
4860
  },
4147
4861
  loginType: 'login-ci',
4862
+ telemetryOptOut: undefined,
4148
4863
  name: 'client.feature.meeting.summary',
4149
4864
  userType: 'host',
4150
4865
  isConvergedArchitectureEnabled: undefined,
4151
4866
  webexSubServiceType: undefined,
4152
4867
  webClientPreload: undefined,
4868
+ isVipMeeting: false,
4869
+ isAutomatedUser: false,
4870
+ userActivation: undefined,
4153
4871
  meetingSummaryInfo: {
4154
4872
  featureName: 'syncSystemMuteStatus',
4155
- featureActions: [{
4156
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4157
- actionId: '14200',
4158
- isInitialValue: false,
4159
- clickCount: '1'
4160
- }]
4873
+ featureActions: [
4874
+ {
4875
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4876
+ actionId: '14200',
4877
+ isInitialValue: false,
4878
+ clickCount: '1',
4879
+ },
4880
+ ],
4161
4881
  },
4162
- key: "UcfFeatureUsage",
4882
+ key: 'UcfFeatureUsage',
4163
4883
  },
4164
4884
  originTime: {
4165
4885
  sent: 'not_defined_yet',
@@ -4200,12 +4920,14 @@ describe('internal-plugin-metrics', () => {
4200
4920
  payload: {
4201
4921
  meetingSummaryInfo: {
4202
4922
  featureName: 'syncSystemMuteStatus',
4203
- featureActions: [{
4204
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4205
- actionId: '14200',
4206
- isInitialValue: false,
4207
- clickCount: '1'
4208
- }]
4923
+ featureActions: [
4924
+ {
4925
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4926
+ actionId: '14200',
4927
+ isInitialValue: false,
4928
+ clickCount: '1',
4929
+ },
4930
+ ],
4209
4931
  },
4210
4932
  },
4211
4933
  delaySubmitEvent: true,
@@ -4217,12 +4939,14 @@ describe('internal-plugin-metrics', () => {
4217
4939
  payload: {
4218
4940
  meetingSummaryInfo: {
4219
4941
  featureName: 'syncSystemVideoStatus',
4220
- featureActions: [{
4221
- actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4222
- actionId: '13400',
4223
- isInitialValue: false,
4224
- clickCount: '1'
4225
- }]
4942
+ featureActions: [
4943
+ {
4944
+ actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4945
+ actionId: '13400',
4946
+ isInitialValue: false,
4947
+ clickCount: '1',
4948
+ },
4949
+ ],
4226
4950
  },
4227
4951
  },
4228
4952
  delaySubmitEvent: true,
@@ -4240,12 +4964,14 @@ describe('internal-plugin-metrics', () => {
4240
4964
  payload: {
4241
4965
  meetingSummaryInfo: {
4242
4966
  featureName: 'syncSystemMuteStatus',
4243
- featureActions: [{
4244
- actionName: 'syncMeetingMicUnmuteStatusToSystem',
4245
- actionId: '14200',
4246
- isInitialValue: false,
4247
- clickCount: '1'
4248
- }]
4967
+ featureActions: [
4968
+ {
4969
+ actionName: 'syncMeetingMicUnmuteStatusToSystem',
4970
+ actionId: '14200',
4971
+ isInitialValue: false,
4972
+ clickCount: '1',
4973
+ },
4974
+ ],
4249
4975
  },
4250
4976
  },
4251
4977
  options: {
@@ -4258,12 +4984,14 @@ describe('internal-plugin-metrics', () => {
4258
4984
  payload: {
4259
4985
  meetingSummaryInfo: {
4260
4986
  featureName: 'syncSystemVideoStatus',
4261
- featureActions: [{
4262
- actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4263
- actionId: '13400',
4264
- isInitialValue: false,
4265
- clickCount: '1'
4266
- }]
4987
+ featureActions: [
4988
+ {
4989
+ actionName: 'syncMeetingVideoUnmuteStatusToSystem',
4990
+ actionId: '13400',
4991
+ isInitialValue: false,
4992
+ clickCount: '1',
4993
+ },
4994
+ ],
4267
4995
  },
4268
4996
  },
4269
4997
  options: {
@@ -4287,17 +5015,17 @@ describe('internal-plugin-metrics', () => {
4287
5015
 
4288
5016
  it('should clear event limits for specific correlationId only', () => {
4289
5017
  // 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 };
5018
+ const correlationId1 = fakeMeeting.correlationId; // e.g. 'correlationId1'
5019
+ const correlationId2 = fakeMeeting2.correlationId; // e.g. 'correlationId2'
5020
+ const options1 = {meetingId: fakeMeeting.id};
5021
+ const options2 = {meetingId: fakeMeeting2.id};
5022
+ const payload = {mediaType: 'video' as const};
4295
5023
 
4296
5024
  // 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 });
5025
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options1});
5026
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options2});
5027
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options1});
5028
+ cd.submitClientEvent({name: 'client.media.render.start', payload, options: options2});
4301
5029
  assert.isTrue(cd.eventLimitTracker.size > 0);
4302
5030
  assert.isTrue(cd.eventLimitWarningsLogged.size > 0);
4303
5031
 
@@ -4308,17 +5036,17 @@ describe('internal-plugin-metrics', () => {
4308
5036
  const remainingWarningKeys = Array.from(cd.eventLimitWarningsLogged.keys());
4309
5037
 
4310
5038
  // 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));
5039
+ assert.isFalse(remainingTrackerKeys.some((key) => key.split(':')[1] === correlationId1));
5040
+ assert.isFalse(remainingWarningKeys.some((key) => key.split(':')[1] === correlationId1));
4313
5041
 
4314
5042
  // 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));
5043
+ assert.isTrue(remainingTrackerKeys.some((key) => key.split(':')[1] === correlationId2));
5044
+ assert.isTrue(remainingWarningKeys.some((key) => key.split(':')[1] === correlationId2));
4317
5045
  });
4318
5046
 
4319
5047
  it('should handle empty correlationId gracefully', () => {
4320
- const options = { meetingId: fakeMeeting.id };
4321
- const payload = { mediaType: 'video' as const };
5048
+ const options = {meetingId: fakeMeeting.id};
5049
+ const payload = {mediaType: 'video' as const};
4322
5050
 
4323
5051
  // Set up some tracking data
4324
5052
  cd.submitClientEvent({
@@ -4346,8 +5074,8 @@ describe('internal-plugin-metrics', () => {
4346
5074
  });
4347
5075
 
4348
5076
  it('should handle non-existent correlationId gracefully', () => {
4349
- const options = { meetingId: fakeMeeting.id };
4350
- const payload = { mediaType: 'video' as const };
5077
+ const options = {meetingId: fakeMeeting.id};
5078
+ const payload = {mediaType: 'video' as const};
4351
5079
 
4352
5080
  // Set up some tracking data
4353
5081
  cd.submitClientEvent({
@@ -4368,10 +5096,10 @@ describe('internal-plugin-metrics', () => {
4368
5096
 
4369
5097
  it('should clear multiple event types for the same correlationId', () => {
4370
5098
  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 } };
5099
+ const options = {meetingId: fakeMeeting.id};
5100
+ const videoPayload = {mediaType: 'video' as const};
5101
+ const audioPayload = {mediaType: 'audio' as const};
5102
+ const roapPayload = {roap: {messageType: 'OFFER' as const}};
4375
5103
 
4376
5104
  // Set up multiple event types for the same correlation
4377
5105
  cd.submitClientEvent({
@@ -4424,8 +5152,8 @@ describe('internal-plugin-metrics', () => {
4424
5152
 
4425
5153
  it('should allow events to be sent again after clearing limits for correlationId', () => {
4426
5154
  const correlationId = fakeMeeting.correlationId;
4427
- const options = { meetingId: fakeMeeting.id };
4428
- const payload = { mediaType: 'video' as const };
5155
+ const options = {meetingId: fakeMeeting.id};
5156
+ const payload = {mediaType: 'video' as const};
4429
5157
  const submitToCallDiagnosticsStub = sinon.stub(cd, 'submitToCallDiagnostics');
4430
5158
 
4431
5159
  // Send first event (should succeed)