@webex/plugin-meetings 3.12.0-task-refactor.1 → 3.12.0-webex-services-ready.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 (302) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +197 -0
  3. package/dist/aiEnableRequest/index.js.map +1 -0
  4. package/dist/aiEnableRequest/utils.js +36 -0
  5. package/dist/aiEnableRequest/utils.js.map +1 -0
  6. package/dist/annotation/index.js +14 -5
  7. package/dist/annotation/index.js.map +1 -1
  8. package/dist/breakouts/breakout.js +8 -3
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/index.js +26 -2
  11. package/dist/breakouts/index.js.map +1 -1
  12. package/dist/common/errors/webex-errors.js +49 -5
  13. package/dist/common/errors/webex-errors.js.map +1 -1
  14. package/dist/config.js +9 -3
  15. package/dist/config.js.map +1 -1
  16. package/dist/constants.js +59 -10
  17. package/dist/constants.js.map +1 -1
  18. package/dist/controls-options-manager/constants.js +11 -1
  19. package/dist/controls-options-manager/constants.js.map +1 -1
  20. package/dist/controls-options-manager/index.js +67 -29
  21. package/dist/controls-options-manager/index.js.map +1 -1
  22. package/dist/controls-options-manager/util.js +91 -0
  23. package/dist/controls-options-manager/util.js.map +1 -1
  24. package/dist/hashTree/constants.js +34 -0
  25. package/dist/hashTree/constants.js.map +1 -0
  26. package/dist/hashTree/hashTree.js +533 -0
  27. package/dist/hashTree/hashTree.js.map +1 -0
  28. package/dist/hashTree/hashTreeParser.js +2068 -36
  29. package/dist/hashTree/hashTreeParser.js.map +1 -1
  30. package/dist/hashTree/types.js +13 -3
  31. package/dist/hashTree/types.js.map +1 -1
  32. package/dist/hashTree/utils.js +111 -0
  33. package/dist/hashTree/utils.js.map +1 -0
  34. package/dist/index.js +18 -2
  35. package/dist/index.js.map +1 -1
  36. package/dist/interceptors/constant.js +12 -0
  37. package/dist/interceptors/constant.js.map +1 -0
  38. package/dist/interceptors/dataChannelAuthToken.js +350 -0
  39. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  40. package/dist/interceptors/index.js +7 -0
  41. package/dist/interceptors/index.js.map +1 -1
  42. package/dist/interceptors/locusRetry.js +23 -8
  43. package/dist/interceptors/locusRetry.js.map +1 -1
  44. package/dist/interceptors/locusRouteToken.js +27 -5
  45. package/dist/interceptors/locusRouteToken.js.map +1 -1
  46. package/dist/interceptors/utils.js +27 -0
  47. package/dist/interceptors/utils.js.map +1 -0
  48. package/dist/interpretation/index.js +11 -2
  49. package/dist/interpretation/index.js.map +1 -1
  50. package/dist/interpretation/interpretation.types.js +7 -0
  51. package/dist/interpretation/interpretation.types.js.map +1 -0
  52. package/dist/interpretation/siLanguage.js +1 -1
  53. package/dist/locus-info/controlsUtils.js +11 -4
  54. package/dist/locus-info/controlsUtils.js.map +1 -1
  55. package/dist/locus-info/index.js +896 -277
  56. package/dist/locus-info/index.js.map +1 -1
  57. package/dist/locus-info/infoUtils.js +36 -5
  58. package/dist/locus-info/infoUtils.js.map +1 -1
  59. package/dist/locus-info/selfUtils.js +1 -0
  60. package/dist/locus-info/selfUtils.js.map +1 -1
  61. package/dist/locus-info/types.js +19 -0
  62. package/dist/locus-info/types.js.map +1 -1
  63. package/dist/media/MediaConnectionAwaiter.js +72 -3
  64. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  65. package/dist/media/index.js +8 -2
  66. package/dist/media/index.js.map +1 -1
  67. package/dist/media/properties.js +5 -2
  68. package/dist/media/properties.js.map +1 -1
  69. package/dist/meeting/in-meeting-actions.js +11 -1
  70. package/dist/meeting/in-meeting-actions.js.map +1 -1
  71. package/dist/meeting/index.js +2075 -1096
  72. package/dist/meeting/index.js.map +1 -1
  73. package/dist/meeting/locusMediaRequest.js +229 -82
  74. package/dist/meeting/locusMediaRequest.js.map +1 -1
  75. package/dist/meeting/muteState.js +10 -1
  76. package/dist/meeting/muteState.js.map +1 -1
  77. package/dist/meeting/request.js +55 -2
  78. package/dist/meeting/request.js.map +1 -1
  79. package/dist/meeting/request.type.js.map +1 -1
  80. package/dist/meeting/util.js +168 -5
  81. package/dist/meeting/util.js.map +1 -1
  82. package/dist/meeting-info/meeting-info-v2.js +2 -2
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meetings/index.js +369 -173
  85. package/dist/meetings/index.js.map +1 -1
  86. package/dist/meetings/meetings.types.js +6 -1
  87. package/dist/meetings/meetings.types.js.map +1 -1
  88. package/dist/meetings/request.js +39 -0
  89. package/dist/meetings/request.js.map +1 -1
  90. package/dist/meetings/util.js +127 -25
  91. package/dist/meetings/util.js.map +1 -1
  92. package/dist/member/index.js +20 -0
  93. package/dist/member/index.js.map +1 -1
  94. package/dist/member/types.js.map +1 -1
  95. package/dist/member/util.js +40 -0
  96. package/dist/member/util.js.map +1 -1
  97. package/dist/members/index.js +101 -43
  98. package/dist/members/index.js.map +1 -1
  99. package/dist/members/util.js +8 -1
  100. package/dist/members/util.js.map +1 -1
  101. package/dist/metrics/constants.js +11 -1
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/multistream/codec/constants.js +63 -0
  104. package/dist/multistream/codec/constants.js.map +1 -0
  105. package/dist/multistream/mediaRequestManager.js +64 -68
  106. package/dist/multistream/mediaRequestManager.js.map +1 -1
  107. package/dist/multistream/receiveSlot.js +9 -0
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/remoteMediaManager.js +11 -0
  110. package/dist/multistream/remoteMediaManager.js.map +1 -1
  111. package/dist/multistream/sendSlotManager.js +116 -2
  112. package/dist/multistream/sendSlotManager.js.map +1 -1
  113. package/dist/reachability/clusterReachability.js +171 -18
  114. package/dist/reachability/clusterReachability.js.map +1 -1
  115. package/dist/reachability/index.js +142 -94
  116. package/dist/reachability/index.js.map +1 -1
  117. package/dist/reachability/reachability.types.js +2 -0
  118. package/dist/reachability/reachability.types.js.map +1 -1
  119. package/dist/reachability/reachabilityPeerConnection.js +1 -1
  120. package/dist/reachability/reachabilityPeerConnection.js.map +1 -1
  121. package/dist/reachability/util.js +45 -0
  122. package/dist/reachability/util.js.map +1 -1
  123. package/dist/reactions/reactions.type.js.map +1 -1
  124. package/dist/reconnection-manager/index.js +0 -1
  125. package/dist/reconnection-manager/index.js.map +1 -1
  126. package/dist/recording-controller/index.js +1 -3
  127. package/dist/recording-controller/index.js.map +1 -1
  128. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  129. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  130. package/dist/types/common/browser-detection.d.ts +1 -0
  131. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  132. package/dist/types/common/events/events-scope.d.ts +1 -0
  133. package/dist/types/common/events/events.d.ts +1 -0
  134. package/dist/types/config.d.ts +7 -2
  135. package/dist/types/constants.d.ts +35 -1
  136. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  137. package/dist/types/controls-options-manager/index.d.ts +16 -0
  138. package/dist/types/hashTree/constants.d.ts +11 -0
  139. package/dist/types/hashTree/hashTree.d.ts +136 -0
  140. package/dist/types/hashTree/hashTreeParser.d.ts +392 -14
  141. package/dist/types/hashTree/types.d.ts +20 -0
  142. package/dist/types/hashTree/utils.d.ts +40 -0
  143. package/dist/types/index.d.ts +4 -0
  144. package/dist/types/interceptors/constant.d.ts +5 -0
  145. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  146. package/dist/types/interceptors/index.d.ts +2 -1
  147. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  148. package/dist/types/interceptors/locusRouteToken.d.ts +2 -0
  149. package/dist/types/interceptors/utils.d.ts +1 -0
  150. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  151. package/dist/types/locus-info/index.d.ts +116 -51
  152. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  153. package/dist/types/locus-info/types.d.ts +48 -12
  154. package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
  155. package/dist/types/media/properties.d.ts +3 -1
  156. package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
  157. package/dist/types/meeting/index.d.ts +196 -15
  158. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  159. package/dist/types/meeting/request.d.ts +17 -1
  160. package/dist/types/meeting/request.type.d.ts +5 -0
  161. package/dist/types/meeting/util.d.ts +40 -0
  162. package/dist/types/meeting-info/util.d.ts +1 -0
  163. package/dist/types/meeting-info/utilv2.d.ts +1 -0
  164. package/dist/types/meetings/index.d.ts +34 -20
  165. package/dist/types/meetings/meetings.types.d.ts +15 -0
  166. package/dist/types/meetings/request.d.ts +14 -0
  167. package/dist/types/member/index.d.ts +2 -0
  168. package/dist/types/member/types.d.ts +5 -4
  169. package/dist/types/member/util.d.ts +14 -0
  170. package/dist/types/members/index.d.ts +15 -2
  171. package/dist/types/members/util.d.ts +1 -5
  172. package/dist/types/metrics/constants.d.ts +10 -0
  173. package/dist/types/multistream/codec/constants.d.ts +7 -0
  174. package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
  175. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  176. package/dist/types/reachability/clusterReachability.d.ts +33 -6
  177. package/dist/types/reachability/index.d.ts +10 -3
  178. package/dist/types/reachability/reachability.types.d.ts +7 -0
  179. package/dist/types/reachability/util.d.ts +17 -0
  180. package/dist/types/reactions/reactions.type.d.ts +4 -0
  181. package/dist/types/recording-controller/util.d.ts +5 -5
  182. package/dist/types/roap/index.d.ts +1 -1
  183. package/dist/types/webinar/utils.d.ts +6 -0
  184. package/dist/webinar/index.js +585 -164
  185. package/dist/webinar/index.js.map +1 -1
  186. package/dist/webinar/utils.js +25 -0
  187. package/dist/webinar/utils.js.map +1 -0
  188. package/package.json +26 -24
  189. package/src/aiEnableRequest/README.md +84 -0
  190. package/src/aiEnableRequest/index.ts +186 -0
  191. package/src/aiEnableRequest/utils.ts +25 -0
  192. package/src/annotation/index.ts +27 -7
  193. package/src/breakouts/breakout.ts +3 -1
  194. package/src/breakouts/index.ts +31 -0
  195. package/src/common/errors/webex-errors.ts +50 -3
  196. package/src/config.ts +7 -2
  197. package/src/constants.ts +49 -3
  198. package/src/controls-options-manager/constants.ts +14 -1
  199. package/src/controls-options-manager/index.ts +87 -28
  200. package/src/controls-options-manager/util.ts +81 -1
  201. package/src/hashTree/constants.ts +26 -0
  202. package/src/hashTree/hashTree.ts +480 -0
  203. package/src/hashTree/hashTreeParser.ts +1911 -29
  204. package/src/hashTree/types.ts +24 -1
  205. package/src/hashTree/utils.ts +98 -0
  206. package/src/index.ts +14 -1
  207. package/src/interceptors/constant.ts +6 -0
  208. package/src/interceptors/dataChannelAuthToken.ts +246 -0
  209. package/src/interceptors/index.ts +2 -1
  210. package/src/interceptors/locusRetry.ts +25 -4
  211. package/src/interceptors/locusRouteToken.ts +22 -5
  212. package/src/interceptors/utils.ts +16 -0
  213. package/src/interpretation/index.ts +29 -11
  214. package/src/interpretation/interpretation.types.ts +11 -0
  215. package/src/locus-info/controlsUtils.ts +20 -1
  216. package/src/locus-info/index.ts +958 -250
  217. package/src/locus-info/infoUtils.ts +41 -6
  218. package/src/locus-info/selfUtils.ts +1 -0
  219. package/src/locus-info/types.ts +51 -12
  220. package/src/media/MediaConnectionAwaiter.ts +62 -5
  221. package/src/media/index.ts +10 -1
  222. package/src/media/properties.ts +4 -1
  223. package/src/meeting/in-meeting-actions.ts +20 -0
  224. package/src/meeting/index.ts +1025 -146
  225. package/src/meeting/locusMediaRequest.ts +106 -6
  226. package/src/meeting/muteState.ts +10 -1
  227. package/src/meeting/request.ts +53 -0
  228. package/src/meeting/request.type.ts +6 -0
  229. package/src/meeting/util.ts +207 -7
  230. package/src/meeting-info/meeting-info-v2.ts +4 -2
  231. package/src/meetings/index.ts +307 -132
  232. package/src/meetings/meetings.types.ts +19 -0
  233. package/src/meetings/request.ts +43 -0
  234. package/src/meetings/util.ts +127 -13
  235. package/src/member/index.ts +20 -0
  236. package/src/member/types.ts +1 -0
  237. package/src/member/util.ts +41 -0
  238. package/src/members/index.ts +70 -7
  239. package/src/members/util.ts +12 -4
  240. package/src/metrics/constants.ts +11 -0
  241. package/src/multistream/codec/constants.ts +58 -0
  242. package/src/multistream/mediaRequestManager.ts +117 -76
  243. package/src/multistream/receiveSlot.ts +18 -0
  244. package/src/multistream/remoteMediaManager.ts +13 -0
  245. package/src/multistream/sendSlotManager.ts +97 -3
  246. package/src/reachability/clusterReachability.ts +156 -29
  247. package/src/reachability/index.ts +62 -17
  248. package/src/reachability/reachability.types.ts +11 -0
  249. package/src/reachability/reachabilityPeerConnection.ts +3 -1
  250. package/src/reachability/util.ts +36 -0
  251. package/src/reactions/reactions.type.ts +4 -0
  252. package/src/reconnection-manager/index.ts +0 -1
  253. package/src/recording-controller/index.ts +1 -2
  254. package/src/webinar/index.ts +448 -11
  255. package/src/webinar/utils.ts +16 -0
  256. package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
  257. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  258. package/test/unit/spec/annotation/index.ts +69 -7
  259. package/test/unit/spec/breakouts/breakout.ts +9 -3
  260. package/test/unit/spec/breakouts/index.ts +49 -0
  261. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  262. package/test/unit/spec/controls-options-manager/index.js +244 -29
  263. package/test/unit/spec/controls-options-manager/util.js +165 -0
  264. package/test/unit/spec/hashTree/hashTree.ts +721 -0
  265. package/test/unit/spec/hashTree/hashTreeParser.ts +5328 -0
  266. package/test/unit/spec/hashTree/utils.ts +264 -0
  267. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
  268. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  269. package/test/unit/spec/interceptors/locusRouteToken.ts +44 -0
  270. package/test/unit/spec/interceptors/utils.ts +75 -0
  271. package/test/unit/spec/interpretation/index.ts +26 -4
  272. package/test/unit/spec/locus-info/controlsUtils.js +222 -52
  273. package/test/unit/spec/locus-info/index.js +2000 -171
  274. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  275. package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
  276. package/test/unit/spec/media/index.ts +92 -0
  277. package/test/unit/spec/media/properties.ts +12 -3
  278. package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
  279. package/test/unit/spec/meeting/index.js +2925 -209
  280. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  281. package/test/unit/spec/meeting/muteState.js +81 -0
  282. package/test/unit/spec/meeting/request.js +82 -0
  283. package/test/unit/spec/meeting/utils.js +595 -27
  284. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  285. package/test/unit/spec/meetings/index.js +1214 -75
  286. package/test/unit/spec/meetings/request.js +141 -0
  287. package/test/unit/spec/meetings/utils.js +453 -52
  288. package/test/unit/spec/member/index.js +35 -4
  289. package/test/unit/spec/member/util.js +154 -27
  290. package/test/unit/spec/members/index.js +216 -0
  291. package/test/unit/spec/members/request.js +37 -1
  292. package/test/unit/spec/members/utils.js +63 -0
  293. package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
  294. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
  295. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  296. package/test/unit/spec/reachability/clusterReachability.ts +125 -1
  297. package/test/unit/spec/reachability/index.ts +154 -49
  298. package/test/unit/spec/reachability/util.ts +31 -0
  299. package/test/unit/spec/reconnection-manager/index.js +4 -8
  300. package/test/unit/spec/recording-controller/index.js +9 -8
  301. package/test/unit/spec/webinar/index.ts +837 -39
  302. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -1,5 +1,7 @@
1
+ import 'jsdom-global/register';
1
2
  import {assert} from '@webex/test-helper-chai';
2
3
  import MockWebex from '@webex/test-helper-mock-webex';
4
+ import { CapabilityState, WebCapabilities } from '@webex/web-capabilities';
3
5
  import sinon from 'sinon';
4
6
  import EventEmitter from 'events';
5
7
  import testUtils from '../../../utils/testUtils';
@@ -8,6 +10,7 @@ import {ClusterNode} from '../../../../src/reachability/request';
8
10
  import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
9
11
  import * as ClusterReachabilityModule from '@webex/plugin-meetings/src/reachability/clusterReachability';
10
12
  import Metrics from '@webex/plugin-meetings/src/metrics';
13
+ import * as InternalMediaCore from '@webex/internal-media-core';
11
14
 
12
15
  import {IP_VERSION} from '@webex/plugin-meetings/src/constants';
13
16
  import { ReachabilityResultsForBackend } from '@webex/plugin-meetings/src/reachability/reachability.types';
@@ -61,6 +64,13 @@ describe('isAnyPublicClusterReachable', () => {
61
64
  );
62
65
  });
63
66
 
67
+ it('returns false when only xtls is reachable', async () => {
68
+ await checkIsClusterReachable(
69
+ {x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}, xtls: {result: 'reachable'}}},
70
+ false
71
+ );
72
+ });
73
+
64
74
  it('returns false when both tcp and udp are unreachable', async () => {
65
75
  await checkIsClusterReachable(
66
76
  {x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}}},
@@ -68,6 +78,13 @@ describe('isAnyPublicClusterReachable', () => {
68
78
  );
69
79
  });
70
80
 
81
+ it('returns false when udp, tcp and xtls are all unreachable', async () => {
82
+ await checkIsClusterReachable(
83
+ {x: {udp: {result: 'unreachable'}, tcp: {result: 'unreachable'}, xtls: {result: 'unreachable'}}},
84
+ false
85
+ );
86
+ });
87
+
71
88
  it('returns false when reachability result is empty', async () => {
72
89
  await checkIsClusterReachable({x: {}}, false);
73
90
  });
@@ -143,6 +160,75 @@ describe('isAnyPublicClusterReachable', () => {
143
160
  });
144
161
  });
145
162
 
163
+ describe('isAnyClusterReachableViaProtocol', () => {
164
+ let webex;
165
+
166
+ beforeEach(() => {
167
+ webex = new MockWebex();
168
+ sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
169
+ });
170
+
171
+ afterEach(() => {
172
+ sinon.restore();
173
+ });
174
+
175
+ const checkReachableViaProtocol = async (
176
+ mockStorage: any,
177
+ protocol: 'udp' | 'tcp' | 'xtls',
178
+ expectedValue: boolean
179
+ ) => {
180
+ if (mockStorage) {
181
+ await webex.boundedStorage.put(
182
+ 'Reachability',
183
+ 'reachability.result',
184
+ JSON.stringify(mockStorage)
185
+ );
186
+ }
187
+ const reachability = new Reachability(webex);
188
+
189
+ const result = await reachability.isAnyClusterReachableViaProtocol(protocol);
190
+
191
+ assert.equal(result, expectedValue);
192
+ };
193
+
194
+ ['udp', 'tcp', 'xtls'].forEach((protocol: 'udp' | 'tcp' | 'xtls') => {
195
+ it(`returns true when at least one cluster is reachable via ${protocol}`, async () => {
196
+ await checkReachableViaProtocol(
197
+ {
198
+ clusterA: {[protocol]: {result: 'reachable'}},
199
+ clusterB: {[protocol]: {result: 'unreachable'}},
200
+ },
201
+ protocol,
202
+ true
203
+ );
204
+ });
205
+
206
+ it(`returns false when no cluster is reachable via ${protocol}`, async () => {
207
+ await checkReachableViaProtocol(
208
+ {
209
+ clusterA: {[protocol]: {result: 'unreachable'}},
210
+ clusterB: {[protocol]: {result: 'unreachable'}},
211
+ },
212
+ protocol,
213
+ false
214
+ );
215
+ });
216
+ });
217
+
218
+ it('returns false when storage read throws an error', async () => {
219
+ // don't put anything in storage so .get() rejects
220
+ const reachability = new Reachability(webex);
221
+
222
+ const result = await reachability.isAnyClusterReachableViaProtocol('xtls');
223
+
224
+ assert.equal(result, false);
225
+ });
226
+
227
+ it('returns false when stored data is empty', async () => {
228
+ await checkReachableViaProtocol({}, 'xtls', false);
229
+ });
230
+ });
231
+
146
232
  describe('isWebexMediaBackendUnreachable', () => {
147
233
  let webex;
148
234
 
@@ -466,11 +552,13 @@ describe('gatherReachability', () => {
466
552
  let clock;
467
553
  let clusterReachabilityCtorStub;
468
554
  let mockClusterReachabilityInstances: Record<string, MockClusterReachability>;
555
+ let supportsRTCPeerConnectionStub;
469
556
 
470
557
  beforeEach(async () => {
471
558
  webex = new MockWebex();
472
559
 
473
560
  sinon.stub(Metrics, 'sendBehavioralMetric');
561
+ supportsRTCPeerConnectionStub = sinon.stub(WebCapabilities, 'supportsRTCPeerConnection').returns(CapabilityState.CAPABLE);
474
562
 
475
563
  await webex.boundedStorage.put(
476
564
  'Reachability',
@@ -506,10 +594,7 @@ describe('gatherReachability', () => {
506
594
  return mockInstance;
507
595
  });
508
596
 
509
- webex.config.meetings.experimental = {
510
- enableTcpReachability: false,
511
- enableTlsReachability: false,
512
- };
597
+ webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: false};
513
598
  });
514
599
 
515
600
  afterEach(() => {
@@ -545,6 +630,25 @@ describe('gatherReachability', () => {
545
630
  await assert.isRejected(reachability.gatherReachability('test'), 'enableReachabilityChecks is disabled in config');
546
631
  });
547
632
 
633
+ [CapabilityState.NOT_CAPABLE, CapabilityState.UNKNOWN].forEach((capabilityState) =>
634
+ it(`returns empty object if WebRTC API is not available (capabilityState=${capabilityState}`, async () => {
635
+ supportsRTCPeerConnectionStub.returns(capabilityState);
636
+
637
+ const reachability = new Reachability(webex);
638
+
639
+ const result = await reachability.gatherReachability('test');
640
+
641
+ assert.deepEqual(result, {});
642
+
643
+ // Verify that no new reachability result was stored - old results should remain unchanged
644
+ // This check is mainly to ensure that we don't put any "unreachable" results into storage
645
+ const storedResults = await webex.boundedStorage.get('Reachability', 'reachability.result');
646
+ assert.equal(storedResults, JSON.stringify({old: 'results'}));
647
+
648
+ assert.equal(await reachability.isWebexMediaBackendUnreachable(), false);
649
+ })
650
+ );
651
+
548
652
  [
549
653
  // ========================================================================
550
654
  {
@@ -1206,10 +1310,7 @@ describe('gatherReachability', () => {
1206
1310
  expectedMetrics,
1207
1311
  }) =>
1208
1312
  it(`works correctly for the case: ${title}`, async () => {
1209
- webex.config.meetings.experimental = {
1210
- enableTcpReachability: true,
1211
- enableTlsReachability: true,
1212
- };
1313
+ webex.config.meetings.enableReachabilityChecks = true;
1213
1314
 
1214
1315
  // the metrics related to ipver and trigger are not tested in these tests and are all the same, so setting them up here
1215
1316
  const expectedMetricsFull = {
@@ -1344,10 +1445,7 @@ describe('gatherReachability', () => {
1344
1445
  });
1345
1446
 
1346
1447
  it(`starts ip network version detection and includes the results in the metrics`, async () => {
1347
- webex.config.meetings.experimental = {
1348
- enableTcpReachability: true,
1349
- enableTlsReachability: true,
1350
- };
1448
+ webex.config.meetings.enableReachabilityChecks = true;
1351
1449
  webex.internal.device.ipNetworkDetector = {
1352
1450
  supportsIpV4: true,
1353
1451
  supportsIpV6: true,
@@ -1424,10 +1522,7 @@ describe('gatherReachability', () => {
1424
1522
  });
1425
1523
 
1426
1524
  it('keeps updating reachability results after the 3s public cloud timeout expires', async () => {
1427
- webex.config.meetings.experimental = {
1428
- enableTcpReachability: true,
1429
- enableTlsReachability: true,
1430
- };
1525
+ webex.config.meetings.enableReachabilityChecks = true;
1431
1526
 
1432
1527
  const reachability = new Reachability(webex);
1433
1528
 
@@ -1523,10 +1618,7 @@ describe('gatherReachability', () => {
1523
1618
  });
1524
1619
 
1525
1620
  it('handles clientMediaIpsUpdated event by updating clientMediaIps in results', async () => {
1526
- webex.config.meetings.experimental = {
1527
- enableTcpReachability: true,
1528
- enableTlsReachability: true,
1529
- };
1621
+ webex.config.meetings.enableReachabilityChecks = true;
1530
1622
 
1531
1623
  const reachability = new Reachability(webex);
1532
1624
 
@@ -1611,10 +1703,7 @@ describe('gatherReachability', () => {
1611
1703
  });
1612
1704
 
1613
1705
  it('starts ClusterReachability on each media cluster', async () => {
1614
- webex.config.meetings.experimental = {
1615
- enableTcpReachability: true,
1616
- enableTlsReachability: true,
1617
- };
1706
+ webex.config.meetings.enableReachabilityChecks = true;
1618
1707
 
1619
1708
  const getClustersResult = {
1620
1709
  clusters: {
@@ -1663,10 +1752,7 @@ describe('gatherReachability', () => {
1663
1752
  });
1664
1753
 
1665
1754
  it('does not do TCP reachability if it is disabled in config', async () => {
1666
- webex.config.meetings.experimental = {
1667
- enableTcpReachability: false,
1668
- enableTlsReachability: true,
1669
- };
1755
+ webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: true};
1670
1756
 
1671
1757
  const getClustersResult = {
1672
1758
  clusters: {
@@ -1693,14 +1779,11 @@ describe('gatherReachability', () => {
1693
1779
  udp: ['testUDP1', 'testUDP2'],
1694
1780
  tcp: [], // empty list because TCP is disabled in config
1695
1781
  xtls: ['testXTLS1', 'testXTLS2'],
1696
- });
1782
+ }, undefined);
1697
1783
  });
1698
1784
 
1699
1785
  it('does not do TLS reachability if it is disabled in config', async () => {
1700
- webex.config.meetings.experimental = {
1701
- enableTcpReachability: true,
1702
- enableTlsReachability: false,
1703
- };
1786
+ webex.config.meetings.enableReachabilityChecks = {tcp: true, tls: false};
1704
1787
 
1705
1788
  const getClustersResult = {
1706
1789
  clusters: {
@@ -1728,14 +1811,11 @@ describe('gatherReachability', () => {
1728
1811
  udp: ['testUDP1', 'testUDP2'],
1729
1812
  tcp: ['testTCP1', 'testTCP2'],
1730
1813
  xtls: [], // empty list because TLS is disabled in config
1731
- });
1814
+ }, undefined);
1732
1815
  });
1733
1816
 
1734
1817
  it('does not do TCP or TLS reachability if it is disabled in config', async () => {
1735
- webex.config.meetings.experimental = {
1736
- enableTcpReachability: false,
1737
- enableTlsReachability: false,
1738
- };
1818
+ webex.config.meetings.enableReachabilityChecks = {tcp: false, tls: false};
1739
1819
 
1740
1820
  const getClustersResult = {
1741
1821
  clusters: {
@@ -1763,15 +1843,43 @@ describe('gatherReachability', () => {
1763
1843
  udp: ['testUDP1', 'testUDP2'],
1764
1844
  tcp: [], // empty list because TCP is disabled in config
1765
1845
  xtls: [], // empty list because TLS is disabled in config
1766
- });
1846
+ }, undefined);
1767
1847
  });
1768
1848
 
1769
- it('retry of getClusters is succesfull', async () => {
1770
- webex.config.meetings.experimental = {
1771
- enableTcpReachability: true,
1772
- enableTlsReachability: false,
1849
+ it('does UDP, TCP and TLS reachability by default (enableReachabilityChecks=true)', async () => {
1850
+ webex.config.meetings.enableReachabilityChecks = true;
1851
+
1852
+ const getClustersResult = {
1853
+ clusters: {
1854
+ 'cluster name': {
1855
+ udp: ['testUDP1', 'testUDP2'],
1856
+ tcp: ['testTCP1', 'testTCP2'],
1857
+ xtls: ['testXTLS1', 'testXTLS2'],
1858
+ isVideoMesh: false,
1859
+ },
1860
+ },
1861
+ joinCookie: {id: 'id'},
1773
1862
  };
1774
1863
 
1864
+ const reachability = new Reachability(webex);
1865
+
1866
+ reachability.reachabilityRequest.getClusters = sinon.stub().returns(getClustersResult);
1867
+
1868
+ const promise = reachability.gatherReachability('test');
1869
+ await simulateTimeout();
1870
+ await promise;
1871
+
1872
+ assert.calledOnceWithExactly(clusterReachabilityCtorStub, 'cluster name', {
1873
+ isVideoMesh: false,
1874
+ udp: ['testUDP1', 'testUDP2'],
1875
+ tcp: ['testTCP1', 'testTCP2'],
1876
+ xtls: ['testXTLS1', 'testXTLS2'],
1877
+ }, undefined);
1878
+ });
1879
+
1880
+ it('retry of getClusters is succesfull', async () => {
1881
+ webex.config.meetings.enableReachabilityChecks = {tcp: true, tls: false};
1882
+
1775
1883
  const getClustersResult = {
1776
1884
  clusters: {
1777
1885
  'cluster name': {
@@ -1843,10 +1951,7 @@ describe('gatherReachability', () => {
1843
1951
  };
1844
1952
 
1845
1953
  beforeEach(() => {
1846
- webex.config.meetings.experimental = {
1847
- enableTcpReachability: true,
1848
- enableTlsReachability: true,
1849
- };
1954
+ webex.config.meetings.enableReachabilityChecks = true;
1850
1955
 
1851
1956
  receivedEvents = {
1852
1957
  done: 0,
@@ -2110,7 +2215,7 @@ describe('gatherReachability', () => {
2110
2215
  receivedEvents[event] = receivedEvents[event] + 1 || 1;
2111
2216
  });
2112
2217
  };
2113
-
2218
+
2114
2219
  it('works as expected', async () => {
2115
2220
  setListener('reachability:stopped');
2116
2221
  setListener('reachability:done');
@@ -2925,4 +3030,4 @@ describe('isSubnetReachable', () => {
2925
3030
  it(`returns false if the subnet is unreachable`, () => {
2926
3031
  assert(!reachability.isSubnetReachable('11'));
2927
3032
  });
2928
- });
3033
+ });
@@ -3,9 +3,40 @@ import {assert} from '@webex/test-helper-chai';
3
3
  import {
4
4
  convertStunUrlToTurn,
5
5
  convertStunUrlToTurnTls,
6
+ isReachabilityEnabled,
7
+ resolveReachabilityProtocols,
6
8
  } from '@webex/plugin-meetings/src/reachability/util';
7
9
 
8
10
  describe('plugin-meetings/src/reachability/util', () => {
11
+ describe('#resolveReachabilityProtocols()', () => {
12
+ [
13
+ {title: 'undefined defaults to all enabled', config: undefined, expected: {udp: true, tcp: true, tls: true}},
14
+ {title: 'true enables all protocols', config: true, expected: {udp: true, tcp: true, tls: true}},
15
+ {title: 'false disables all protocols', config: false, expected: {udp: false, tcp: false, tls: false}},
16
+ {title: 'empty object keeps udp on and defaults tcp/tls to enabled', config: {}, expected: {udp: true, tcp: true, tls: true}},
17
+ {title: 'object can disable tcp', config: {tcp: false}, expected: {udp: true, tcp: false, tls: true}},
18
+ {title: 'object can disable tls', config: {tls: false}, expected: {udp: true, tcp: true, tls: false}},
19
+ {title: 'object can disable both tcp and tls but udp stays on', config: {tcp: false, tls: false}, expected: {udp: true, tcp: false, tls: false}},
20
+ ].forEach(({title, config, expected}) => {
21
+ it(`resolves: ${title}`, () => {
22
+ assert.deepEqual(resolveReachabilityProtocols(config as any), expected);
23
+ });
24
+ });
25
+ });
26
+
27
+ describe('#isReachabilityEnabled()', () => {
28
+ [
29
+ {title: 'undefined', config: undefined, expected: true},
30
+ {title: 'true', config: true, expected: true},
31
+ {title: 'false', config: false, expected: false},
32
+ {title: 'object disabling tcp and tls (udp still on)', config: {tcp: false, tls: false}, expected: true},
33
+ ].forEach(({title, config, expected}) => {
34
+ it(`returns ${expected} for ${title}`, () => {
35
+ assert.equal(isReachabilityEnabled(config as any), expected);
36
+ });
37
+ });
38
+ });
39
+
9
40
  describe('#convertStunUrlToTurn()', () => {
10
41
  [
11
42
  {
@@ -54,8 +54,8 @@ describe('plugin-meetings', () => {
54
54
  webrtcMediaConnection: fakeMediaConnection,
55
55
  },
56
56
  mediaRequestManagers: {
57
- audio: {commit: sinon.stub(), clearPreviousRequests: sinon.stub()},
58
- video: {commit: sinon.stub(), clearPreviousRequests: sinon.stub()},
57
+ audio: {commit: sinon.stub()},
58
+ video: {commit: sinon.stub()},
59
59
  },
60
60
  roap: {
61
61
  doTurnDiscovery: sinon.stub().resolves({
@@ -179,26 +179,22 @@ describe('plugin-meetings', () => {
179
179
  });
180
180
  });
181
181
 
182
- it('does not clear previous requests and re-request media for non-multistream meetings', async () => {
182
+ it('does not re-request media for non-multistream meetings', async () => {
183
183
  fakeMeeting.isMultistream = false;
184
184
  const rm = new ReconnectionManager(fakeMeeting);
185
185
 
186
186
  await rm.reconnect();
187
187
 
188
- assert.notCalled(fakeMeeting.mediaRequestManagers.audio.clearPreviousRequests);
189
- assert.notCalled(fakeMeeting.mediaRequestManagers.video.clearPreviousRequests);
190
188
  assert.notCalled(fakeMeeting.mediaRequestManagers.audio.commit);
191
189
  assert.notCalled(fakeMeeting.mediaRequestManagers.video.commit);
192
190
  });
193
191
 
194
- it('does clear previous requests and re-request media for multistream meetings', async () => {
192
+ it('does re-request media for multistream meetings', async () => {
195
193
  fakeMeeting.isMultistream = true;
196
194
  const rm = new ReconnectionManager(fakeMeeting);
197
195
 
198
196
  await rm.reconnect();
199
197
 
200
- assert.calledOnce(fakeMeeting.mediaRequestManagers.audio.clearPreviousRequests);
201
- assert.calledOnce(fakeMeeting.mediaRequestManagers.video.clearPreviousRequests);
202
198
  assert.calledOnce(fakeMeeting.mediaRequestManagers.audio.commit);
203
199
  assert.calledOnce(fakeMeeting.mediaRequestManagers.video.commit);
204
200
  });
@@ -35,6 +35,7 @@ describe('plugin-meetings', () => {
35
35
  beforeEach(() => {
36
36
  request = {
37
37
  request: sinon.stub().returns(Promise.resolve()),
38
+ locusDeltaRequest: sinon.stub().returns(Promise.resolve()),
38
39
  };
39
40
 
40
41
  controller = new RecordingController(request);
@@ -69,13 +70,13 @@ describe('plugin-meetings', () => {
69
70
 
70
71
  const result = controller.startRecording();
71
72
 
72
- assert.calledWith(request.request, {
73
+ assert.calledWith(request.locusDeltaRequest, {
73
74
  uri: `${locusUrl}/controls`,
74
75
  body: {record: {recording: true, paused: false}},
75
76
  method: HTTP_VERBS.PATCH,
76
77
  });
77
78
 
78
- assert.deepEqual(result, request.request.firstCall.returnValue);
79
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
79
80
  });
80
81
  });
81
82
 
@@ -103,13 +104,13 @@ describe('plugin-meetings', () => {
103
104
 
104
105
  const result = controller.stopRecording();
105
106
 
106
- assert.calledWith(request.request, {
107
+ assert.calledWith(request.locusDeltaRequest, {
107
108
  uri: `${locusUrl}/controls`,
108
109
  body: {record: {recording: false, paused: false}},
109
110
  method: HTTP_VERBS.PATCH,
110
111
  });
111
112
 
112
- assert.deepEqual(result, request.request.firstCall.returnValue);
113
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
113
114
  });
114
115
  });
115
116
 
@@ -139,13 +140,13 @@ describe('plugin-meetings', () => {
139
140
 
140
141
  const result = controller.pauseRecording();
141
142
 
142
- assert.calledWith(request.request, {
143
+ assert.calledWith(request.locusDeltaRequest, {
143
144
  uri: `${locusUrl}/controls`,
144
145
  body: {record: {recording: true, paused: true}},
145
146
  method: HTTP_VERBS.PATCH,
146
147
  });
147
148
 
148
- assert.deepEqual(result, request.request.firstCall.returnValue);
149
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
149
150
  });
150
151
  });
151
152
 
@@ -176,13 +177,13 @@ describe('plugin-meetings', () => {
176
177
 
177
178
  const result = controller.resumeRecording();
178
179
 
179
- assert.calledWith(request.request, {
180
+ assert.calledWith(request.locusDeltaRequest, {
180
181
  uri: `${locusUrl}/controls`,
181
182
  body: {record: {recording: true, paused: false}},
182
183
  method: HTTP_VERBS.PATCH,
183
184
  });
184
185
 
185
- assert.deepEqual(result, request.request.firstCall.returnValue);
186
+ assert.deepEqual(result, request.locusDeltaRequest.firstCall.returnValue);
186
187
  });
187
188
  });
188
189
  });