@webex/plugin-meetings 3.8.0-next.2 → 3.8.0-next.20

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 (56) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/config.js +1 -0
  4. package/dist/config.js.map +1 -1
  5. package/dist/constants.js +1 -0
  6. package/dist/constants.js.map +1 -1
  7. package/dist/interpretation/index.js +4 -4
  8. package/dist/interpretation/index.js.map +1 -1
  9. package/dist/interpretation/siLanguage.js +1 -1
  10. package/dist/locus-info/controlsUtils.js +1 -1
  11. package/dist/locus-info/controlsUtils.js.map +1 -1
  12. package/dist/meeting/index.js +43 -3
  13. package/dist/meeting/index.js.map +1 -1
  14. package/dist/meeting/locusMediaRequest.js +21 -5
  15. package/dist/meeting/locusMediaRequest.js.map +1 -1
  16. package/dist/meetings/index.js +1 -1
  17. package/dist/meetings/index.js.map +1 -1
  18. package/dist/multistream/remoteMediaManager.js +40 -8
  19. package/dist/multistream/remoteMediaManager.js.map +1 -1
  20. package/dist/reachability/clusterReachability.js +52 -8
  21. package/dist/reachability/clusterReachability.js.map +1 -1
  22. package/dist/reachability/index.js +70 -45
  23. package/dist/reachability/index.js.map +1 -1
  24. package/dist/reachability/reachability.types.js +14 -0
  25. package/dist/reachability/reachability.types.js.map +1 -1
  26. package/dist/recording-controller/util.js +5 -5
  27. package/dist/recording-controller/util.js.map +1 -1
  28. package/dist/types/config.d.ts +1 -0
  29. package/dist/types/constants.d.ts +1 -0
  30. package/dist/types/meeting/index.d.ts +22 -0
  31. package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
  32. package/dist/types/reachability/clusterReachability.d.ts +13 -1
  33. package/dist/types/reachability/index.d.ts +2 -1
  34. package/dist/types/reachability/reachability.types.d.ts +5 -0
  35. package/dist/webinar/index.js +1 -1
  36. package/package.json +22 -22
  37. package/src/config.ts +1 -0
  38. package/src/constants.ts +1 -0
  39. package/src/interpretation/index.ts +3 -3
  40. package/src/locus-info/controlsUtils.ts +2 -2
  41. package/src/meeting/index.ts +39 -1
  42. package/src/meeting/locusMediaRequest.ts +27 -4
  43. package/src/meetings/index.ts +1 -1
  44. package/src/multistream/remoteMediaManager.ts +32 -10
  45. package/src/reachability/clusterReachability.ts +47 -1
  46. package/src/reachability/index.ts +15 -0
  47. package/src/reachability/reachability.types.ts +6 -0
  48. package/src/recording-controller/util.ts +17 -13
  49. package/test/unit/spec/interpretation/index.ts +39 -1
  50. package/test/unit/spec/locus-info/controlsUtils.js +8 -0
  51. package/test/unit/spec/meeting/index.js +163 -104
  52. package/test/unit/spec/meeting/locusMediaRequest.ts +96 -58
  53. package/test/unit/spec/meetings/index.js +13 -0
  54. package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
  55. package/test/unit/spec/reachability/clusterReachability.ts +47 -1
  56. package/test/unit/spec/reachability/index.ts +12 -0
@@ -9,7 +9,9 @@ import {
9
9
  ResultEventData,
10
10
  Events,
11
11
  ClientMediaIpsUpdatedEventData,
12
+ NatTypeUpdatedEventData,
12
13
  } from '@webex/plugin-meetings/src/reachability/clusterReachability'; // replace with actual path
14
+ import { NatType } from 'packages/@webex/plugin-meetings/dist/reachability/reachability.types';
13
15
 
14
16
  describe('ClusterReachability', () => {
15
17
  let previousRTCPeerConnection;
@@ -17,15 +19,17 @@ describe('ClusterReachability', () => {
17
19
  let fakePeerConnection;
18
20
  let gatherIceCandidatesSpy;
19
21
 
20
- const emittedEvents: Record<Events, (ResultEventData | ClientMediaIpsUpdatedEventData)[]> = {
22
+ const emittedEvents: Record<Events, (ResultEventData | ClientMediaIpsUpdatedEventData | NatTypeUpdatedEventData)[]> = {
21
23
  [Events.resultReady]: [],
22
24
  [Events.clientMediaIpsUpdated]: [],
25
+ [Events.natTypeUpdated]: [],
23
26
  };
24
27
  const FAKE_OFFER = {type: 'offer', sdp: 'fake sdp'};
25
28
 
26
29
  const resetEmittedEvents = () => {
27
30
  emittedEvents[Events.resultReady].length = 0;
28
31
  emittedEvents[Events.clientMediaIpsUpdated].length = 0;
32
+ emittedEvents[Events.natTypeUpdated].length = 0;
29
33
  };
30
34
  beforeEach(() => {
31
35
  fakePeerConnection = {
@@ -56,6 +60,10 @@ describe('ClusterReachability', () => {
56
60
  clusterReachability.on(Events.clientMediaIpsUpdated, (data: ClientMediaIpsUpdatedEventData) => {
57
61
  emittedEvents[Events.clientMediaIpsUpdated].push(data);
58
62
  });
63
+
64
+ clusterReachability.on(Events.natTypeUpdated, (data: NatTypeUpdatedEventData) => {
65
+ emittedEvents[Events.natTypeUpdated].push(data);
66
+ });
59
67
  });
60
68
 
61
69
  afterEach(() => {
@@ -440,5 +448,43 @@ describe('ClusterReachability', () => {
440
448
  xtls: {result: 'reachable', latencyInMilliseconds: 40},
441
449
  });
442
450
  });
451
+
452
+ it('determines correctly if symmetric-nat is detected', async () => {
453
+ const promise = clusterReachability.start();
454
+
455
+ // generate candidates with duplicate addresses
456
+ await clock.tickAsync(10);
457
+ fakePeerConnection.onicecandidate({candidate: {type: 'srflx', address: 'somePublicIp1', relatedPort: 3478, port: 1000}});
458
+
459
+ // check events emitted: there shouldn't be any natTypeUpdated emitted
460
+ assert.equal(emittedEvents[Events.natTypeUpdated].length, 0);
461
+
462
+ await clock.tickAsync(10);
463
+ fakePeerConnection.onicecandidate({candidate: {type: 'srflx', address: 'somePublicIp1', relatedPort: 3478, port: 2000}});
464
+
465
+ // should emit natTypeUpdated event
466
+ assert.equal(emittedEvents[Events.natTypeUpdated].length, 1);
467
+ assert.deepEqual(emittedEvents[Events.natTypeUpdated][0], {
468
+ natType: 'symmetric-nat',
469
+ });
470
+
471
+ // send also a relay candidate so that the reachability check finishes
472
+ fakePeerConnection.onicecandidate({candidate: {type: 'relay', address: 'someTurnRelayIp'}});
473
+ fakePeerConnection.onicecandidate({
474
+ candidate: {type: 'relay', address: 'someTurnRelayIp', port: 443},
475
+ });
476
+
477
+ await promise;
478
+
479
+ assert.deepEqual(clusterReachability.getResult(), {
480
+ udp: {
481
+ result: 'reachable',
482
+ latencyInMilliseconds: 10,
483
+ clientMediaIPs: ['somePublicIp1'],
484
+ },
485
+ tcp: {result: 'reachable', latencyInMilliseconds: 20},
486
+ xtls: {result: 'reachable', latencyInMilliseconds: 20},
487
+ });
488
+ });
443
489
  });
444
490
  });
@@ -538,6 +538,14 @@ describe('gatherReachability', () => {
538
538
  assert.equal(storedResultForJoinCookie, JSON.stringify(expectedJoinCookie));
539
539
  };
540
540
 
541
+ it('rejects if reachability is disabled in config', async () => {
542
+ webex.config.meetings.enableReachabilityChecks = false;
543
+
544
+ const reachability = new Reachability(webex);
545
+
546
+ await assert.isRejected(reachability.gatherReachability('test'), 'enableReachabilityChecks is disabled in config');
547
+ });
548
+
541
549
  [
542
550
  // ========================================================================
543
551
  {
@@ -2148,6 +2156,7 @@ describe('getReachabilityMetrics', () => {
2148
2156
  reachability_vmn_tcp_failed: 0,
2149
2157
  reachability_vmn_xtls_success: 0,
2150
2158
  reachability_vmn_xtls_failed: 0,
2159
+ natType: 'unknown'
2151
2160
  });
2152
2161
  });
2153
2162
 
@@ -2215,6 +2224,7 @@ describe('getReachabilityMetrics', () => {
2215
2224
  reachability_vmn_tcp_failed: 1,
2216
2225
  reachability_vmn_xtls_success: 0,
2217
2226
  reachability_vmn_xtls_failed: 0,
2227
+ natType: 'unknown'
2218
2228
  }
2219
2229
  );
2220
2230
  });
@@ -2276,6 +2286,7 @@ describe('getReachabilityMetrics', () => {
2276
2286
  reachability_vmn_tcp_failed: 0,
2277
2287
  reachability_vmn_xtls_success: 0,
2278
2288
  reachability_vmn_xtls_failed: 0,
2289
+ natType: 'unknown'
2279
2290
  }
2280
2291
  );
2281
2292
  });
@@ -2337,6 +2348,7 @@ describe('getReachabilityMetrics', () => {
2337
2348
  reachability_vmn_tcp_failed: 3,
2338
2349
  reachability_vmn_xtls_success: 1,
2339
2350
  reachability_vmn_xtls_failed: 1,
2351
+ natType: 'unknown'
2340
2352
  }
2341
2353
  );
2342
2354
  });