@webex/plugin-meetings 3.7.0-wxcc.1 → 3.8.0

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 (220) hide show
  1. package/dist/annotation/annotation.types.d.ts +42 -0
  2. package/dist/annotation/constants.d.ts +31 -0
  3. package/dist/annotation/index.d.ts +117 -0
  4. package/dist/breakouts/breakout.d.ts +8 -0
  5. package/dist/breakouts/breakout.js +1 -1
  6. package/dist/breakouts/collection.d.ts +5 -0
  7. package/dist/breakouts/edit-lock-error.d.ts +15 -0
  8. package/dist/breakouts/events.d.ts +8 -0
  9. package/dist/breakouts/index.d.ts +5 -0
  10. package/dist/breakouts/index.js +1 -1
  11. package/dist/breakouts/request.d.ts +22 -0
  12. package/dist/breakouts/utils.d.ts +15 -0
  13. package/dist/common/browser-detection.d.ts +9 -0
  14. package/dist/common/collection.d.ts +48 -0
  15. package/dist/common/config.d.ts +2 -0
  16. package/dist/common/errors/captcha-error.d.ts +15 -0
  17. package/dist/common/errors/intent-to-join.d.ts +16 -0
  18. package/dist/common/errors/join-meeting.d.ts +17 -0
  19. package/dist/common/errors/media.d.ts +15 -0
  20. package/dist/common/errors/no-meeting-info.d.ts +14 -0
  21. package/dist/common/errors/parameter.d.ts +15 -0
  22. package/dist/common/errors/password-error.d.ts +15 -0
  23. package/dist/common/errors/permission.d.ts +14 -0
  24. package/dist/common/errors/reclaim-host-role-error.js +149 -0
  25. package/dist/common/errors/reclaim-host-role-error.js.map +1 -0
  26. package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
  27. package/dist/common/errors/reconnection-in-progress.d.ts +9 -0
  28. package/dist/common/errors/reconnection-in-progress.js +33 -0
  29. package/dist/common/errors/reconnection-in-progress.js.map +1 -0
  30. package/dist/common/errors/reconnection.d.ts +15 -0
  31. package/dist/common/errors/stats.d.ts +15 -0
  32. package/dist/common/errors/webex-errors.d.ts +93 -0
  33. package/dist/common/errors/webex-meetings-error.d.ts +20 -0
  34. package/dist/common/events/events-scope.d.ts +17 -0
  35. package/dist/common/events/events.d.ts +12 -0
  36. package/dist/common/events/trigger-proxy.d.ts +2 -0
  37. package/dist/common/events/util.d.ts +2 -0
  38. package/dist/common/logs/logger-config.d.ts +2 -0
  39. package/dist/common/logs/logger-proxy.d.ts +2 -0
  40. package/dist/common/logs/request.d.ts +36 -0
  41. package/dist/common/queue.d.ts +34 -0
  42. package/dist/config.d.ts +72 -0
  43. package/dist/constants.d.ts +1088 -0
  44. package/dist/constants.js +15 -3
  45. package/dist/constants.js.map +1 -1
  46. package/dist/controls-options-manager/constants.d.ts +4 -0
  47. package/dist/controls-options-manager/enums.d.ts +15 -0
  48. package/dist/controls-options-manager/index.d.ts +136 -0
  49. package/dist/controls-options-manager/types.d.ts +43 -0
  50. package/dist/controls-options-manager/util.d.ts +1 -0
  51. package/dist/index.d.ts +7 -0
  52. package/dist/interceptors/index.d.ts +2 -0
  53. package/dist/interceptors/locusRetry.d.ts +27 -0
  54. package/dist/interpretation/collection.d.ts +5 -0
  55. package/dist/interpretation/index.d.ts +5 -0
  56. package/dist/interpretation/index.js +1 -1
  57. package/dist/interpretation/siLanguage.d.ts +5 -0
  58. package/dist/interpretation/siLanguage.js +1 -1
  59. package/dist/locus-info/controlsUtils.d.ts +2 -0
  60. package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
  61. package/dist/locus-info/fullState.d.ts +2 -0
  62. package/dist/locus-info/hostUtils.d.ts +2 -0
  63. package/dist/locus-info/index.d.ts +322 -0
  64. package/dist/locus-info/infoUtils.d.ts +2 -0
  65. package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
  66. package/dist/locus-info/parser.d.ts +272 -0
  67. package/dist/locus-info/selfUtils.d.ts +2 -0
  68. package/dist/locus-info/selfUtils.js +5 -0
  69. package/dist/locus-info/selfUtils.js.map +1 -1
  70. package/dist/media/MediaConnectionAwaiter.js +1 -0
  71. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  72. package/dist/media/index.d.ts +34 -0
  73. package/dist/media/properties.d.ts +93 -0
  74. package/dist/media/properties.js +30 -16
  75. package/dist/media/properties.js.map +1 -1
  76. package/dist/media/util.d.ts +2 -0
  77. package/dist/mediaQualityMetrics/config.d.ts +241 -0
  78. package/dist/mediaQualityMetrics/config.js +502 -0
  79. package/dist/mediaQualityMetrics/config.js.map +1 -0
  80. package/dist/meeting/brbState.js +167 -0
  81. package/dist/meeting/brbState.js.map +1 -0
  82. package/dist/meeting/effectsState.js +260 -0
  83. package/dist/meeting/effectsState.js.map +1 -0
  84. package/dist/meeting/in-meeting-actions.d.ts +167 -0
  85. package/dist/meeting/index.d.ts +1825 -0
  86. package/dist/meeting/index.js +363 -295
  87. package/dist/meeting/index.js.map +1 -1
  88. package/dist/meeting/locusMediaRequest.d.ts +74 -0
  89. package/dist/meeting/muteState.d.ts +178 -0
  90. package/dist/meeting/muteState.js +1 -6
  91. package/dist/meeting/muteState.js.map +1 -1
  92. package/dist/meeting/request.d.ts +295 -0
  93. package/dist/meeting/request.type.d.ts +11 -0
  94. package/dist/meeting/state.d.ts +9 -0
  95. package/dist/meeting/util.d.ts +119 -0
  96. package/dist/meeting/voicea-meeting.d.ts +16 -0
  97. package/dist/meeting-info/collection.d.ts +20 -0
  98. package/dist/meeting-info/index.d.ts +69 -0
  99. package/dist/meeting-info/meeting-info-v2.d.ts +123 -0
  100. package/dist/meeting-info/meeting-info-v2.js +19 -12
  101. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  102. package/dist/meeting-info/request.d.ts +22 -0
  103. package/dist/meeting-info/util.d.ts +2 -0
  104. package/dist/meeting-info/utilv2.d.ts +2 -0
  105. package/dist/meeting-info/utilv2.js +5 -1
  106. package/dist/meeting-info/utilv2.js.map +1 -1
  107. package/dist/meetings/collection.d.ts +40 -0
  108. package/dist/meetings/index.d.ts +390 -0
  109. package/dist/meetings/meetings.types.d.ts +4 -0
  110. package/dist/meetings/request.d.ts +27 -0
  111. package/dist/meetings/util.d.ts +18 -0
  112. package/dist/member/index.d.ts +160 -0
  113. package/dist/member/member.types.js +17 -0
  114. package/dist/member/member.types.js.map +1 -0
  115. package/dist/member/types.d.ts +32 -0
  116. package/dist/member/util.d.ts +2 -0
  117. package/dist/members/collection.d.ts +29 -0
  118. package/dist/members/index.d.ts +353 -0
  119. package/dist/members/request.d.ts +114 -0
  120. package/dist/members/types.d.ts +25 -0
  121. package/dist/members/util.d.ts +215 -0
  122. package/dist/metrics/config.js +276 -0
  123. package/dist/metrics/config.js.map +1 -0
  124. package/dist/metrics/constants.d.ts +70 -0
  125. package/dist/metrics/constants.js +2 -0
  126. package/dist/metrics/constants.js.map +1 -1
  127. package/dist/metrics/index.d.ts +45 -0
  128. package/dist/multistream/mediaRequestManager.d.ts +119 -0
  129. package/dist/multistream/receiveSlot.d.ts +68 -0
  130. package/dist/multistream/receiveSlotManager.d.ts +56 -0
  131. package/dist/multistream/remoteMedia.d.ts +72 -0
  132. package/dist/multistream/remoteMediaGroup.d.ts +49 -0
  133. package/dist/multistream/remoteMediaManager.d.ts +300 -0
  134. package/dist/multistream/sendSlotManager.d.ts +69 -0
  135. package/dist/networkQualityMonitor/index.d.ts +70 -0
  136. package/dist/networkQualityMonitor/index.js +221 -0
  137. package/dist/networkQualityMonitor/index.js.map +1 -0
  138. package/dist/peer-connection-manager/index.js +671 -0
  139. package/dist/peer-connection-manager/index.js.map +1 -0
  140. package/dist/peer-connection-manager/util.js +109 -0
  141. package/dist/peer-connection-manager/util.js.map +1 -0
  142. package/dist/personal-meeting-room/index.d.ts +47 -0
  143. package/dist/personal-meeting-room/request.d.ts +14 -0
  144. package/dist/personal-meeting-room/util.d.ts +2 -0
  145. package/dist/reachability/clusterReachability.d.ts +109 -0
  146. package/dist/reachability/index.d.ts +105 -0
  147. package/dist/reachability/index.js +31 -3
  148. package/dist/reachability/index.js.map +1 -1
  149. package/dist/reachability/request.d.ts +39 -0
  150. package/dist/reachability/util.d.ts +8 -0
  151. package/dist/reactions/constants.d.ts +3 -0
  152. package/dist/reactions/reactions.d.ts +4 -0
  153. package/dist/reactions/reactions.type.d.ts +52 -0
  154. package/dist/reconnection-manager/index.d.ts +136 -0
  155. package/dist/recording-controller/enums.d.ts +7 -0
  156. package/dist/recording-controller/index.d.ts +207 -0
  157. package/dist/recording-controller/util.d.ts +14 -0
  158. package/dist/roap/collection.js +62 -0
  159. package/dist/roap/collection.js.map +1 -0
  160. package/dist/roap/handler.js +275 -0
  161. package/dist/roap/handler.js.map +1 -0
  162. package/dist/roap/index.d.ts +86 -0
  163. package/dist/roap/request.d.ts +39 -0
  164. package/dist/roap/state.js +126 -0
  165. package/dist/roap/state.js.map +1 -0
  166. package/dist/roap/turnDiscovery.d.ts +155 -0
  167. package/dist/roap/util.js +75 -0
  168. package/dist/roap/util.js.map +1 -0
  169. package/dist/rtcMetrics/constants.d.ts +4 -0
  170. package/dist/rtcMetrics/constants.js +11 -0
  171. package/dist/rtcMetrics/constants.js.map +1 -0
  172. package/dist/rtcMetrics/index.d.ts +61 -0
  173. package/dist/rtcMetrics/index.js +197 -0
  174. package/dist/rtcMetrics/index.js.map +1 -0
  175. package/dist/statsAnalyzer/global.d.ts +36 -0
  176. package/dist/statsAnalyzer/global.js +126 -0
  177. package/dist/statsAnalyzer/global.js.map +1 -0
  178. package/dist/statsAnalyzer/index.d.ts +217 -0
  179. package/dist/statsAnalyzer/index.js +1013 -0
  180. package/dist/statsAnalyzer/index.js.map +1 -0
  181. package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
  182. package/dist/statsAnalyzer/mqaUtil.js +179 -0
  183. package/dist/statsAnalyzer/mqaUtil.js.map +1 -0
  184. package/dist/transcription/index.d.ts +64 -0
  185. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  186. package/dist/types/constants.d.ts +9 -2
  187. package/dist/types/mediaQualityMetrics/config.d.ts +241 -0
  188. package/dist/types/meeting/brbState.d.ts +54 -0
  189. package/dist/types/meeting/index.d.ts +23 -0
  190. package/dist/types/meeting-info/meeting-info-v2.d.ts +3 -1
  191. package/dist/types/metrics/constants.d.ts +2 -0
  192. package/dist/types/networkQualityMonitor/index.d.ts +70 -0
  193. package/dist/types/reachability/index.d.ts +9 -1
  194. package/dist/types/rtcMetrics/constants.d.ts +4 -0
  195. package/dist/types/rtcMetrics/index.d.ts +71 -0
  196. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  197. package/dist/types/statsAnalyzer/index.d.ts +217 -0
  198. package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
  199. package/dist/webinar/collection.d.ts +16 -0
  200. package/dist/webinar/index.d.ts +5 -0
  201. package/dist/webinar/index.js +1 -1
  202. package/package.json +23 -23
  203. package/src/constants.ts +10 -2
  204. package/src/locus-info/selfUtils.ts +5 -0
  205. package/src/media/MediaConnectionAwaiter.ts +2 -0
  206. package/src/media/properties.ts +34 -13
  207. package/src/meeting/brbState.ts +169 -0
  208. package/src/meeting/index.ts +112 -26
  209. package/src/meeting/muteState.ts +1 -6
  210. package/src/meeting-info/meeting-info-v2.ts +9 -1
  211. package/src/meeting-info/utilv2.ts +14 -2
  212. package/src/metrics/constants.ts +2 -0
  213. package/src/reachability/index.ts +29 -1
  214. package/test/unit/spec/locus-info/selfUtils.js +10 -0
  215. package/test/unit/spec/media/properties.ts +15 -0
  216. package/test/unit/spec/meeting/brbState.ts +114 -0
  217. package/test/unit/spec/meeting/index.js +92 -30
  218. package/test/unit/spec/meeting/muteState.js +0 -24
  219. package/test/unit/spec/meeting-info/utilv2.js +9 -0
  220. package/test/unit/spec/reachability/index.ts +120 -10
@@ -114,6 +114,7 @@ import {ERROR_DESCRIPTIONS} from '@webex/internal-plugin-metrics/src/call-diagno
114
114
  import MeetingCollection from '@webex/plugin-meetings/src/meetings/collection';
115
115
 
116
116
  import {EVENT_TRIGGERS as VOICEAEVENTS} from '@webex/internal-plugin-voicea';
117
+ import { createBrbState } from '@webex/plugin-meetings/src/meeting/brbState';
117
118
  import JoinForbiddenError from '../../../../src/common/errors/join-forbidden-error';
118
119
 
119
120
  describe('plugin-meetings', () => {
@@ -246,6 +247,7 @@ describe('plugin-meetings', () => {
246
247
  isAnyPublicClusterReachable: sinon.stub().resolves(true),
247
248
  getReachabilityResults: sinon.stub().resolves(undefined),
248
249
  getReachabilityMetrics: sinon.stub().resolves({}),
250
+ stopReachability: sinon.stub(),
249
251
  };
250
252
  webex.internal.llm.on = sinon.stub();
251
253
  webex.internal.newMetrics.callDiagnosticLatencies = new CallDiagnosticLatencies(
@@ -2095,6 +2097,7 @@ describe('plugin-meetings', () => {
2095
2097
  someReachabilityMetric1: 'some value1',
2096
2098
  someReachabilityMetric2: 'some value2',
2097
2099
  }),
2100
+ stopReachability: sinon.stub(),
2098
2101
  };
2099
2102
 
2100
2103
  const forceRtcMetricsSend = sinon.stub().resolves();
@@ -2514,6 +2517,7 @@ describe('plugin-meetings', () => {
2514
2517
  assert.calledOnce(meeting.setMercuryListener);
2515
2518
  assert.calledOnce(fakeMediaConnection.initiateOffer);
2516
2519
  assert.equal(meeting.allowMediaInLobby, allowMediaInLobby);
2520
+ assert.calledOnce(webex.meetings.reachability.stopReachability);
2517
2521
  };
2518
2522
 
2519
2523
  it('should attach the media and return promise', async () => {
@@ -2709,6 +2713,7 @@ describe('plugin-meetings', () => {
2709
2713
  webex.meetings.reachability = {
2710
2714
  isWebexMediaBackendUnreachable: sinon.stub().resolves(false),
2711
2715
  getReachabilityMetrics: sinon.stub().resolves(),
2716
+ stopReachability: sinon.stub(),
2712
2717
  };
2713
2718
  const MOCK_CLIENT_ERROR_CODE = 2004;
2714
2719
  const generateClientErrorCodeForIceFailureStub = sinon
@@ -2917,6 +2922,7 @@ describe('plugin-meetings', () => {
2917
2922
  .onCall(2)
2918
2923
  .resolves(false),
2919
2924
  getReachabilityMetrics: sinon.stub().resolves({}),
2925
+ stopReachability: sinon.stub(),
2920
2926
  };
2921
2927
  const getErrorPayloadForClientErrorCodeStub =
2922
2928
  (webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode =
@@ -3211,6 +3217,7 @@ describe('plugin-meetings', () => {
3211
3217
  someReachabilityMetric1: 'some value1',
3212
3218
  someReachabilityMetric2: 'some value2',
3213
3219
  }),
3220
+ stopReachability: sinon.stub(),
3214
3221
  };
3215
3222
  meeting.iceCandidatesCount = 3;
3216
3223
  meeting.iceCandidateErrors.set('701_error', 3);
@@ -3715,6 +3722,7 @@ describe('plugin-meetings', () => {
3715
3722
 
3716
3723
  webex.meetings.reachability = {
3717
3724
  isWebexMediaBackendUnreachable: sinon.stub().resolves(unreachable || false),
3725
+ stopReachability: sinon.stub(),
3718
3726
  };
3719
3727
 
3720
3728
  const generateClientErrorCodeForIceFailureStub = sinon
@@ -3812,7 +3820,6 @@ describe('plugin-meetings', () => {
3812
3820
  };
3813
3821
 
3814
3822
  beforeEach(() => {
3815
- meeting.meetingRequest.setBrb = sinon.stub().resolves({body: 'test'});
3816
3823
  meeting.mediaProperties.webrtcMediaConnection = {createSendSlot: sinon.stub()};
3817
3824
  meeting.sendSlotManager.createSlot(
3818
3825
  fakeMultistreamRoapMediaConnection,
@@ -3822,6 +3829,8 @@ describe('plugin-meetings', () => {
3822
3829
  meeting.locusUrl = 'locus url';
3823
3830
  meeting.deviceUrl = 'device url';
3824
3831
  meeting.selfId = 'self id';
3832
+ meeting.brbState = createBrbState(meeting, false);
3833
+ meeting.brbState.enable = sinon.stub().resolves();
3825
3834
  });
3826
3835
 
3827
3836
  afterEach(() => {
@@ -3843,7 +3852,7 @@ describe('plugin-meetings', () => {
3843
3852
 
3844
3853
  await brbResult;
3845
3854
  assert.exists(brbResult.then);
3846
- assert.calledOnce(meeting.meetingRequest.setBrb);
3855
+ assert.calledOnce(meeting.brbState.enable);
3847
3856
  })
3848
3857
 
3849
3858
  it('should disable #beRightBack and return a promise', async () => {
@@ -3851,12 +3860,12 @@ describe('plugin-meetings', () => {
3851
3860
 
3852
3861
  await brbResult;
3853
3862
  assert.exists(brbResult.then);
3854
- assert.calledOnce(meeting.meetingRequest.setBrb);
3863
+ assert.calledOnce(meeting.brbState.enable);
3855
3864
  })
3856
3865
 
3857
3866
  it('should throw an error and reject the promise if setBrb fails', async () => {
3858
3867
  const error = new Error('setBrb failed');
3859
- meeting.meetingRequest.setBrb.rejects(error);
3868
+ meeting.brbState.enable.rejects(error);
3860
3869
 
3861
3870
  try {
3862
3871
  await meeting.beRightBack(true);
@@ -3867,27 +3876,6 @@ describe('plugin-meetings', () => {
3867
3876
  }
3868
3877
  })
3869
3878
  });
3870
-
3871
- describe('when in a transcoded meeting', () => {
3872
-
3873
- beforeEach(() => {
3874
- meeting.isMultistream = false;
3875
- });
3876
-
3877
- it('should ignore enabling #beRightBack', async () => {
3878
- meeting.beRightBack(true);
3879
-
3880
- assert.isRejected((Promise.reject()));
3881
- assert.notCalled(meeting.meetingRequest.setBrb);
3882
- })
3883
-
3884
- it('should ignore disabling #beRightBack', async () => {
3885
- meeting.beRightBack(false);
3886
-
3887
- assert.isRejected((Promise.reject()));
3888
- assert.notCalled(meeting.meetingRequest.setBrb);
3889
- })
3890
- });
3891
3879
  });
3892
3880
 
3893
3881
  /* This set of tests are like semi-integration tests, they use real MuteState, Media, LocusMediaRequest and Roap classes.
@@ -6804,7 +6792,7 @@ describe('plugin-meetings', () => {
6804
6792
  assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
6805
6793
  assert.equal(
6806
6794
  meeting.meetingInfoFailureReason,
6807
- MEETING_INFO_FAILURE_REASON.WEBINAR_NEED_REGISTRATIONID
6795
+ MEETING_INFO_FAILURE_REASON.WEBINAR_NEED_REGISTRATION_ID
6808
6796
  );
6809
6797
  });
6810
6798
  });
@@ -6864,7 +6852,8 @@ describe('plugin-meetings', () => {
6864
6852
  'fake-installed-org-id',
6865
6853
  'locus-id',
6866
6854
  {extraParam1: 'value1', permissionToken: FAKE_PERMISSION_TOKEN},
6867
- {meetingId: meeting.id, sendCAevents: true}
6855
+ {meetingId: meeting.id, sendCAevents: true},
6856
+ null
6868
6857
  );
6869
6858
  assert.deepEqual(meeting.meetingInfo, {
6870
6859
  ...FAKE_MEETING_INFO,
@@ -6909,7 +6898,8 @@ describe('plugin-meetings', () => {
6909
6898
  'fake-installed-org-id',
6910
6899
  'locus-id',
6911
6900
  {extraParam1: 'value1', permissionToken: FAKE_PERMISSION_TOKEN},
6912
- {meetingId: meeting.id, sendCAevents: true}
6901
+ {meetingId: meeting.id, sendCAevents: true},
6902
+ null
6913
6903
  );
6914
6904
  assert.deepEqual(meeting.meetingInfo, {
6915
6905
  ...FAKE_MEETING_INFO,
@@ -6963,7 +6953,8 @@ describe('plugin-meetings', () => {
6963
6953
  extraParam1: 'value1',
6964
6954
  permissionToken: FAKE_PERMISSION_TOKEN,
6965
6955
  },
6966
- {meetingId: meeting.id, sendCAevents: true}
6956
+ {meetingId: meeting.id, sendCAevents: true},
6957
+ null
6967
6958
  );
6968
6959
  assert.deepEqual(meeting.meetingInfo, {
6969
6960
  ...FAKE_MEETING_INFO,
@@ -9230,6 +9221,7 @@ describe('plugin-meetings', () => {
9230
9221
 
9231
9222
  it('listens to the brb state changed event', () => {
9232
9223
  const assertBrb = (enabled) => {
9224
+ meeting.brbState = createBrbState(meeting, false);
9233
9225
  meeting.locusInfo.emit(
9234
9226
  { function: 'test', file: 'test' },
9235
9227
  LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
@@ -13260,7 +13252,7 @@ describe('plugin-meetings', () => {
13260
13252
 
13261
13253
  describe('#roapMessageReceived', () => {
13262
13254
  it('calls roapMessageReceived on the webrtc media connection', () => {
13263
- const fakeMessage = {messageType: 'fake', sdp: 'fake sdp'};
13255
+ const fakeMessage = {messageType: 'ANSWER', sdp: 'fake sdp'};
13264
13256
 
13265
13257
  const getMediaServer = sinon.stub(MeetingsUtil, 'getMediaServer').returns('homer');
13266
13258
 
@@ -13298,5 +13290,75 @@ describe('plugin-meetings', () => {
13298
13290
 
13299
13291
  assert.notCalled(meeting.mediaProperties.webrtcMediaConnection.roapMessageReceived);
13300
13292
  });
13293
+
13294
+ it('does not call getMediaServer for a roap message other than ANSWER', async () => {
13295
+ const fakeMessage = {messageType: 'ERROR', sdp: 'fake sdp'};
13296
+
13297
+ meeting.isMultistream = true;
13298
+ meeting.mediaProperties.webrtcMediaConnection = {
13299
+ roapMessageReceived: sinon.stub(),
13300
+ };
13301
+ meeting.mediaProperties.webrtcMediaConnection.mediaServer = 'linus';
13302
+
13303
+ const getMediaServerStub = sinon.stub(MeetingsUtil, 'getMediaServer').returns('something');
13304
+
13305
+ meeting.roapMessageReceived(fakeMessage);
13306
+
13307
+ assert.calledOnceWithExactly(
13308
+ meeting.mediaProperties.webrtcMediaConnection.roapMessageReceived,
13309
+ fakeMessage
13310
+ );
13311
+ assert.notCalled(getMediaServerStub);
13312
+ assert.equal(meeting.mediaProperties.webrtcMediaConnection.mediaServer, 'linus'); // check that it hasn't been overwritten
13313
+ });
13314
+ });
13315
+
13316
+ describe('#verifyRegistrationId', () => {
13317
+ it('calls fetchMeetingInfo() with the passed registrationId and captcha code', async () => {
13318
+ // simulate successful case
13319
+ meeting.fetchMeetingInfo = sinon.stub().resolves();
13320
+ const result = await meeting.verifyRegistrationId('registrationId', 'captcha id');
13321
+
13322
+ assert(Metrics.sendBehavioralMetric.calledOnce);
13323
+ assert.calledWith(
13324
+ Metrics.sendBehavioralMetric,
13325
+ BEHAVIORAL_METRICS.VERIFY_REGISTRATION_ID_SUCCESS
13326
+ );
13327
+ assert.equal(result.isRegistrationIdValid, true);
13328
+ assert.equal(result.requiredCaptcha, null);
13329
+ assert.equal(result.failureReason, MEETING_INFO_FAILURE_REASON.NONE);
13330
+ assert.calledWith(meeting.fetchMeetingInfo, {
13331
+ registrationId: 'registrationId',
13332
+ captchaCode: 'captcha id',
13333
+ sendCAevents: false,
13334
+ });
13335
+ });
13336
+ it('handles registrationIdError returned by fetchMeetingInfo', async () => {
13337
+ meeting.fetchMeetingInfo = sinon.stub().callsFake(() => {
13338
+ meeting.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.WRONG_REGISTRATIONID;
13339
+
13340
+ return Promise.reject(new JoinWebinarError());
13341
+ });
13342
+ const result = await meeting.verifyRegistrationId('registrationId', 'captcha id');
13343
+
13344
+ assert.equal(result.isRegistrationIdValid, false);
13345
+ assert.equal(result.requiredCaptcha, null);
13346
+ assert.equal(result.failureReason, MEETING_INFO_FAILURE_REASON.WRONG_REGISTRATION_ID);
13347
+ });
13348
+ it('handles CaptchaError returned by fetchMeetingInfo', async () => {
13349
+ const FAKE_CAPTCHA = {captchaId: 'some catcha id...'};
13350
+
13351
+ meeting.fetchMeetingInfo = sinon.stub().callsFake(() => {
13352
+ meeting.meetingInfoFailureReason = MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA;
13353
+ meeting.requiredCaptcha = FAKE_CAPTCHA;
13354
+
13355
+ return Promise.reject(new CaptchaError());
13356
+ });
13357
+ const result = await meeting.verifyRegistrationId('registrationId', 'captcha id');
13358
+
13359
+ assert.equal(result.isRegistrationIdValid, false);
13360
+ assert.deepEqual(result.requiredCaptcha, FAKE_CAPTCHA);
13361
+ assert.equal(result.failureReason, MEETING_INFO_FAILURE_REASON.WRONG_CAPTCHA);
13362
+ });
13301
13363
  });
13302
13364
  });
@@ -113,30 +113,6 @@ describe('plugin-meetings', () => {
113
113
  assert.isTrue(audio.isRemotelyMuted());
114
114
  });
115
115
 
116
- it('does not locally unmute on a server unmute', async () => {
117
- const setServerMutedSpy = meeting.mediaProperties.audioStream.setServerMuted;
118
-
119
- // simulate remote mute
120
- audio.handleServerRemoteMuteUpdate(meeting, true, true);
121
-
122
- assert.isTrue(audio.isRemotelyMuted());
123
- assert.isTrue(audio.isLocallyMuted());
124
-
125
- // mutes local
126
- assert.calledOnceWithExactly(setServerMutedSpy, true, 'remotelyMuted');
127
-
128
- setServerMutedSpy.resetHistory();
129
-
130
- // simulate remote unmute
131
- audio.handleServerRemoteMuteUpdate(meeting, false, true);
132
-
133
- assert.isFalse(audio.isRemotelyMuted());
134
- assert.isTrue(audio.isLocallyMuted());
135
-
136
- // does not unmute local
137
- assert.notCalled(setServerMutedSpy);
138
- });
139
-
140
116
  it('does local audio unmute if localAudioUnmuteRequired is received', async () => {
141
117
  // first we need to have the local stream user muted
142
118
  meeting.mediaProperties.audioStream.userMuted = true;
@@ -192,6 +192,15 @@ describe('plugin-meetings', () => {
192
192
  assert.equal(res.meetingUUID, 'xsddsdsdsdssdsdsdsdsd');
193
193
  });
194
194
 
195
+ it('for registrationId', () => {
196
+ const res = MeetingInfoUtil.getRequestBody({
197
+ type: DESTINATION_TYPE.MEETING_UUID,
198
+ registrationId: 'registrationId',
199
+ });
200
+
201
+ assert.equal(res.registrationId, 'registrationId');
202
+ });
203
+
195
204
  it('for DESTINATION_TYPE.LOCUS_ID', () => {
196
205
  const res = MeetingInfoUtil.getRequestBody({
197
206
  type: DESTINATION_TYPE.LOCUS_ID,
@@ -1050,6 +1050,7 @@ describe('gatherReachability', () => {
1050
1050
 
1051
1051
  // the metrics related to ipver and trigger are not tested in these tests and are all the same, so setting them up here
1052
1052
  const expectedMetricsFull = {
1053
+ aborted: false,
1053
1054
  ...expectedMetrics,
1054
1055
  ipver_firstIpV4: -1,
1055
1056
  ipver_firstIpV6: -1,
@@ -1238,6 +1239,7 @@ describe('gatherReachability', () => {
1238
1239
 
1239
1240
  // finally, check the metrics - they should contain values from ipNetworkDetector
1240
1241
  assert.calledWith(Metrics.sendBehavioralMetric, 'js_sdk_reachability_completed', {
1242
+ aborted: false,
1241
1243
  vmn_udp_min: -1,
1242
1244
  vmn_udp_max: -1,
1243
1245
  vmn_udp_average: -1,
@@ -1622,14 +1624,14 @@ describe('gatherReachability', () => {
1622
1624
  const reachability = new Reachability(webex);
1623
1625
 
1624
1626
  let getClustersCallCount = 0;
1625
-
1627
+
1626
1628
  reachability.reachabilityRequest.getClusters = sinon.stub().callsFake(() => {
1627
1629
  getClustersCallCount++;
1628
1630
 
1629
1631
  if (getClustersCallCount == 1) {
1630
1632
  throw new Error('fake error');
1631
1633
  }
1632
-
1634
+
1633
1635
  return getClustersResult;
1634
1636
  });
1635
1637
 
@@ -1637,7 +1639,7 @@ describe('gatherReachability', () => {
1637
1639
 
1638
1640
  await simulateTimeout();
1639
1641
  await promise;
1640
-
1642
+
1641
1643
  assert.equal(getClustersCallCount, 2);
1642
1644
 
1643
1645
  assert.calledOnce(clusterReachabilityCtorStub);
@@ -1647,7 +1649,7 @@ describe('gatherReachability', () => {
1647
1649
  const reachability = new Reachability(webex);
1648
1650
 
1649
1651
  let getClustersCallCount = 0;
1650
-
1652
+
1651
1653
  reachability.reachabilityRequest.getClusters = sinon.stub().callsFake(() => {
1652
1654
  getClustersCallCount++;
1653
1655
 
@@ -1657,9 +1659,9 @@ describe('gatherReachability', () => {
1657
1659
  const promise = reachability.gatherReachability('test');
1658
1660
 
1659
1661
  await simulateTimeout();
1660
-
1662
+
1661
1663
  await promise;
1662
-
1664
+
1663
1665
  assert.equal(getClustersCallCount, 2);
1664
1666
 
1665
1667
  assert.neverCalledWith(clusterReachabilityCtorStub);
@@ -1927,7 +1929,86 @@ describe('gatherReachability', () => {
1927
1929
  });
1928
1930
  });
1929
1931
 
1930
-
1932
+ describe('stopReachability', () => {
1933
+ let reachability;
1934
+ let receivedEvents;
1935
+ let sendMetricSpy;
1936
+
1937
+ beforeEach(() => {
1938
+ reachability = new Reachability(webex);
1939
+
1940
+ receivedEvents = {};
1941
+
1942
+ sendMetricSpy = sinon.stub(reachability, 'sendMetric').resolves();
1943
+ });
1944
+
1945
+ const setListener = (event) => {
1946
+ reachability.on(event, () => {
1947
+ receivedEvents[event] = receivedEvents[event] + 1 || 1;
1948
+ });
1949
+ };
1950
+ it('works as expected', async () => {
1951
+ setListener('reachability:stopped');
1952
+ setListener('reachability:done');
1953
+ setListener('reachability:firstResultAvailable');
1954
+
1955
+ const mockGetClustersResult = {
1956
+ clusters: {
1957
+ clusterA: {
1958
+ udp: ['udp-urlA'],
1959
+ tcp: ['tcp-urlA'],
1960
+ xtls: ['xtls-urlA'],
1961
+ isVideoMesh: false,
1962
+ },
1963
+ clusterB: {
1964
+ udp: ['udp-urlB'],
1965
+ tcp: ['tcp-urlB'],
1966
+ xtls: ['xtls-urlB'],
1967
+ isVideoMesh: false,
1968
+ },
1969
+ },
1970
+ joinCookie: {id: 'id'},
1971
+ };
1972
+
1973
+ reachability.reachabilityRequest.getClusters = sinon.stub().returns(mockGetClustersResult);
1974
+
1975
+ const gatherReachabilityFallbackSpy = sinon.spy(reachability, 'gatherReachabilityFallback');
1976
+
1977
+ const resultPromise = reachability.gatherReachability('test');
1978
+
1979
+ await testUtils.flushPromises();
1980
+
1981
+ reachability.stopReachability();
1982
+
1983
+ await resultPromise;
1984
+
1985
+ // simulate a lot of time passing to check that all timers were stopped and nothing else happens
1986
+ clock.tick(99000);
1987
+
1988
+ assert.calledOnceWithExactly(mockClusterReachabilityInstances['clusterA'].abort);
1989
+ assert.calledOnceWithExactly(mockClusterReachabilityInstances['clusterB'].abort);
1990
+
1991
+ assert.calledOnceWithExactly(sendMetricSpy, true);
1992
+
1993
+ assert.equal(receivedEvents['reachability:stopped'], 1);
1994
+ assert.equal(receivedEvents['reachability:done'], undefined);
1995
+ assert.equal(receivedEvents['reachability:firstResultAvailable'], undefined);
1996
+
1997
+ assert.notCalled(gatherReachabilityFallbackSpy);
1998
+ });
1999
+
2000
+ it('does nothing if called without reachability being started', async () => {
2001
+ const reachability = new Reachability(webex);
2002
+
2003
+ reachability.stopReachability();
2004
+
2005
+ assert.notCalled(sendMetricSpy);
2006
+
2007
+ assert.equal(receivedEvents['reachability:stopped'], undefined);
2008
+ assert.equal(receivedEvents['reachability:done'], undefined);
2009
+ assert.equal(receivedEvents['reachability:firstResultAvailable'], undefined);
2010
+ });
2011
+ });
1931
2012
  });
1932
2013
 
1933
2014
  describe('getReachabilityResults', () => {
@@ -2489,19 +2570,18 @@ describe('getStatistics', () => {
2489
2570
  describe('sendMetric', () => {
2490
2571
  let webex;
2491
2572
  let reachability;
2573
+ let getStatisticsStub;
2492
2574
 
2493
2575
  beforeEach(() => {
2494
2576
  webex = new MockWebex();
2495
2577
  reachability = new TestReachability(webex);
2496
2578
 
2497
2579
  sinon.stub(Metrics, 'sendBehavioralMetric');
2498
- });
2499
2580
 
2500
- it('works as expected', async () => {
2501
2581
  // setup stub for getStatistics to return values that show what parameters it was called with,
2502
2582
  // this way we can verify that the correct results of calls to getStatistics are placed
2503
2583
  // in correct data fields when sendBehavioralMetric() is called
2504
- const getStatisticsStub = sinon
2584
+ getStatisticsStub = sinon
2505
2585
  .stub(reachability, 'getStatistics')
2506
2586
  .callsFake((results, protocol, isVideoMesh) => {
2507
2587
  return {result: 'fake', protocol, isVideoMesh};
@@ -2522,7 +2602,13 @@ describe('sendMetric', () => {
2522
2602
  isVideoMesh: false,
2523
2603
  },
2524
2604
  });
2605
+ });
2606
+
2607
+ afterEach(() => {
2608
+ sinon.restore();
2609
+ });
2525
2610
 
2611
+ it('works as expected', async () => {
2526
2612
  await reachability.sendMetric();
2527
2613
 
2528
2614
  // each call to getStatistics should be made with all the results from all fake clusterReachability:
@@ -2546,6 +2632,30 @@ describe('sendMetric', () => {
2546
2632
  assert.alwaysCalledWith(getStatisticsStub, expectedResults, sinon.match.any, sinon.match.any);
2547
2633
 
2548
2634
  assert.calledWith(Metrics.sendBehavioralMetric, 'js_sdk_reachability_completed', {
2635
+ aborted: false,
2636
+ vmn_udp_result: 'fake',
2637
+ vmn_udp_protocol: 'udp',
2638
+ vmn_udp_isVideoMesh: true,
2639
+
2640
+ public_udp_result: 'fake',
2641
+ public_udp_protocol: 'udp',
2642
+ public_udp_isVideoMesh: false,
2643
+
2644
+ public_tcp_result: 'fake',
2645
+ public_tcp_protocol: 'tcp',
2646
+ public_tcp_isVideoMesh: false,
2647
+
2648
+ public_xtls_result: 'fake',
2649
+ public_xtls_protocol: 'xtls',
2650
+ public_xtls_isVideoMesh: false,
2651
+ });
2652
+ });
2653
+
2654
+ it('sends metric with "aborted:true" if called with aborted=true arg', async () => {
2655
+ await reachability.sendMetric(true);
2656
+
2657
+ assert.calledWith(Metrics.sendBehavioralMetric, 'js_sdk_reachability_completed', {
2658
+ aborted: true,
2549
2659
  vmn_udp_result: 'fake',
2550
2660
  vmn_udp_protocol: 'udp',
2551
2661
  vmn_udp_isVideoMesh: true,