@webex/plugin-meetings 3.0.0-stream-classes.3 → 3.0.0-stream-classes.4

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 (49) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/constants.js +2 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/interpretation/index.js +1 -1
  6. package/dist/interpretation/siLanguage.js +1 -1
  7. package/dist/meeting/locusMediaRequest.js +1 -1
  8. package/dist/meeting/locusMediaRequest.js.map +1 -1
  9. package/dist/meeting/request.js +23 -13
  10. package/dist/meeting/request.js.map +1 -1
  11. package/dist/meeting/util.js +33 -3
  12. package/dist/meeting/util.js.map +1 -1
  13. package/dist/meetings/index.js +3 -4
  14. package/dist/meetings/index.js.map +1 -1
  15. package/dist/metrics/constants.js +1 -0
  16. package/dist/metrics/constants.js.map +1 -1
  17. package/dist/reachability/index.js +2 -11
  18. package/dist/reachability/index.js.map +1 -1
  19. package/dist/reachability/request.js.map +1 -1
  20. package/dist/reconnection-manager/index.js +26 -22
  21. package/dist/reconnection-manager/index.js.map +1 -1
  22. package/dist/roap/index.js +5 -7
  23. package/dist/roap/index.js.map +1 -1
  24. package/dist/roap/request.js +1 -0
  25. package/dist/roap/request.js.map +1 -1
  26. package/dist/roap/turnDiscovery.js +3 -4
  27. package/dist/roap/turnDiscovery.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/constants.ts +2 -2
  30. package/src/meeting/locusMediaRequest.ts +2 -3
  31. package/src/meeting/request.ts +15 -5
  32. package/src/meeting/util.ts +36 -2
  33. package/src/meetings/index.ts +2 -2
  34. package/src/metrics/constants.ts +1 -0
  35. package/src/reachability/index.ts +4 -10
  36. package/src/reachability/request.ts +1 -1
  37. package/src/reconnection-manager/index.ts +13 -11
  38. package/src/roap/index.ts +2 -4
  39. package/src/roap/request.ts +2 -1
  40. package/src/roap/turnDiscovery.ts +2 -3
  41. package/test/unit/spec/meeting/index.js +7 -5
  42. package/test/unit/spec/meeting/locusMediaRequest.ts +1 -2
  43. package/test/unit/spec/meeting/request.js +23 -0
  44. package/test/unit/spec/meeting/utils.js +73 -4
  45. package/test/unit/spec/meetings/index.js +66 -1
  46. package/test/unit/spec/reachability/index.ts +8 -8
  47. package/test/unit/spec/reconnection-manager/index.js +21 -0
  48. package/test/unit/spec/roap/index.ts +5 -1
  49. package/test/unit/spec/roap/turnDiscovery.ts +11 -4
@@ -4,10 +4,9 @@ import Meetings from '@webex/plugin-meetings';
4
4
  import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
5
5
  import LoggerProxy from '@webex/plugin-meetings/src/common/logs/logger-proxy';
6
6
  import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
7
- import Metrics from '@webex/plugin-meetings/src/metrics/index';
8
- import {SELF_POLICY} from '@webex/plugin-meetings/src/constants';
9
- import {DISPLAY_HINTS} from '@webex/plugin-meetings/src/constants';
7
+ import {SELF_POLICY, IP_VERSION} from '@webex/plugin-meetings/src/constants';
10
8
  import MockWebex from '@webex/test-helper-mock-webex';
9
+ import * as BrowserDetectionModule from '@webex/plugin-meetings/src/common/browser-detection';
11
10
 
12
11
  describe('plugin-meetings', () => {
13
12
  let webex;
@@ -337,7 +336,6 @@ describe('plugin-meetings', () => {
337
336
  selfUrl: 'self url',
338
337
  sequence: {},
339
338
  type: 'LocalMute',
340
- ipVersion: 0,
341
339
  });
342
340
 
343
341
  assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
@@ -517,6 +515,26 @@ describe('plugin-meetings', () => {
517
515
  assert.isUndefined(parameter.inviteeAddress);
518
516
  assert.equal(parameter.meetingNumber, 'meetingNumber');
519
517
  });
518
+
519
+ it('should pass in the locusClusterUrl from meetingInfo', async () => {
520
+ const meeting = {
521
+ meetingInfo: {
522
+ locusClusterUrl: 'locusClusterUrl',
523
+ },
524
+ meetingRequest: {
525
+ joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}})),
526
+ },
527
+ getWebexObject: sinon.stub().returns(webex),
528
+ };
529
+
530
+ MeetingUtil.parseLocusJoin = sinon.stub();
531
+ await MeetingUtil.joinMeeting(meeting, {});
532
+
533
+ assert.calledOnce(meeting.meetingRequest.joinMeeting);
534
+ const parameter = meeting.meetingRequest.joinMeeting.getCall(0).args[0];
535
+
536
+ assert.equal(parameter.locusClusterUrl, 'locusClusterUrl');
537
+ });
520
538
  });
521
539
 
522
540
  describe('joinMeetingOptions', () => {
@@ -963,5 +981,56 @@ describe('plugin-meetings', () => {
963
981
  assert.equal(result, input);
964
982
  });
965
983
  });
984
+
985
+ describe('getIpVersion', () => {
986
+ let isBrowserStub;
987
+ beforeEach(() => {
988
+ isBrowserStub = sinon.stub().returns(false);
989
+
990
+ sinon.stub(BrowserDetectionModule, 'default').returns({
991
+ isBrowser: isBrowserStub,
992
+ });
993
+ });
994
+
995
+ afterEach(() => {
996
+ sinon.restore();
997
+ });
998
+
999
+ [
1000
+ {supportsIpV4: undefined, supportsIpV6: undefined, expectedOutput: IP_VERSION.unknown},
1001
+ {supportsIpV4: undefined, supportsIpV6: true, expectedOutput: IP_VERSION.only_ipv6},
1002
+ {supportsIpV4: undefined, supportsIpV6: false, expectedOutput: IP_VERSION.unknown},
1003
+ {supportsIpV4: true, supportsIpV6: undefined, expectedOutput: IP_VERSION.only_ipv4},
1004
+ {supportsIpV4: true, supportsIpV6: true, expectedOutput: IP_VERSION.ipv4_and_ipv6},
1005
+ {supportsIpV4: true, supportsIpV6: false, expectedOutput: IP_VERSION.only_ipv4},
1006
+ {supportsIpV4: false, supportsIpV6: undefined, expectedOutput: IP_VERSION.unknown},
1007
+ {supportsIpV4: false, supportsIpV6: true, expectedOutput: IP_VERSION.only_ipv6},
1008
+ {supportsIpV4: false, supportsIpV6: false, expectedOutput: IP_VERSION.unknown},
1009
+ ].forEach(({supportsIpV4, supportsIpV6, expectedOutput}) => {
1010
+ it(`returns ${expectedOutput} when supportsIpV4=${supportsIpV4} and supportsIpV6=${supportsIpV6}`, () => {
1011
+ sinon
1012
+ .stub(webex.internal.device.ipNetworkDetector, 'supportsIpV4')
1013
+ .get(() => supportsIpV4);
1014
+ sinon
1015
+ .stub(webex.internal.device.ipNetworkDetector, 'supportsIpV6')
1016
+ .get(() => supportsIpV6);
1017
+
1018
+ assert.equal(MeetingUtil.getIpVersion(webex), expectedOutput);
1019
+ });
1020
+
1021
+ it(`returns undefined when supportsIpV4=${supportsIpV4} and supportsIpV6=${supportsIpV6} and browser is firefox`, () => {
1022
+ sinon
1023
+ .stub(webex.internal.device.ipNetworkDetector, 'supportsIpV4')
1024
+ .get(() => supportsIpV4);
1025
+ sinon
1026
+ .stub(webex.internal.device.ipNetworkDetector, 'supportsIpV6')
1027
+ .get(() => supportsIpV6);
1028
+
1029
+ isBrowserStub.callsFake((name) => name === 'firefox');
1030
+
1031
+ assert.equal(MeetingUtil.getIpVersion(webex), undefined);
1032
+ });
1033
+ });
1034
+ });
966
1035
  });
967
1036
  });
@@ -20,6 +20,7 @@ import MeetingCollection from '@webex/plugin-meetings/src/meetings/collection';
20
20
  import MeetingsUtil from '@webex/plugin-meetings/src/meetings/util';
21
21
  import PersonalMeetingRoom from '@webex/plugin-meetings/src/personal-meeting-room';
22
22
  import Reachability from '@webex/plugin-meetings/src/reachability';
23
+ import Metrics from '@webex/plugin-meetings/src/metrics';
23
24
 
24
25
  import testUtils from '../../../utils/testUtils';
25
26
  import {
@@ -46,6 +47,8 @@ describe('plugin-meetings', () => {
46
47
  debug: () => {},
47
48
  };
48
49
 
50
+ let triggerProxyStub;
51
+
49
52
  beforeEach(() => {
50
53
  StaticConfig.set({
51
54
  bandwidth: {
@@ -57,7 +60,7 @@ describe('plugin-meetings', () => {
57
60
  verboseEvents: true,
58
61
  enable: false,
59
62
  });
60
- sinon.stub(TriggerProxy, 'trigger').returns(true);
63
+ triggerProxyStub = sinon.stub(TriggerProxy, 'trigger').returns(true);
61
64
  });
62
65
 
63
66
  let webex;
@@ -2092,5 +2095,67 @@ describe('plugin-meetings', () => {
2092
2095
  assert.calledWith(webex.meetings.handleLocusEvent, {locus: breakoutLocus, locusUrl: breakoutLocus.url});
2093
2096
  });
2094
2097
  });
2098
+
2099
+ describe('uploading of logs', () => {
2100
+ let metricsSpy;
2101
+ let meeting;
2102
+
2103
+ beforeEach(async () => {
2104
+ webex.meetings.config.autoUploadLogs = true;
2105
+ webex.meetings.loggerRequest.uploadLogs = sinon.stub().resolves();
2106
+
2107
+ sinon.stub(webex.meetings.meetingInfo, 'fetchInfoOptions').resolves({});
2108
+ sinon.stub(webex.meetings.meetingInfo, 'fetchMeetingInfo').resolves({});
2109
+
2110
+ triggerProxyStub.restore();
2111
+
2112
+ metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
2113
+
2114
+ meeting = await webex.meetings.create('test');
2115
+
2116
+ meeting.locusId = 'locus id';
2117
+ meeting.correlationId = 'correlation id';
2118
+ meeting.locusInfo = {
2119
+ fullState: { lastActive: 'last active'},
2120
+ info: { webExMeetingId: 'meeting id'}
2121
+ }
2122
+ });
2123
+
2124
+ afterEach(() => {
2125
+ sinon.restore();
2126
+ })
2127
+
2128
+ it('sends metrics on success', async () => {
2129
+
2130
+ await meeting.uploadLogs();
2131
+
2132
+ await testUtils.flushPromises();
2133
+
2134
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_upload_logs_success', {
2135
+ callStart: 'last active',
2136
+ correlationId: 'correlation id',
2137
+ feedbackId: 'correlation id',
2138
+ locusId: 'locus id',
2139
+ meetingId: 'meeting id',
2140
+ });
2141
+ });
2142
+
2143
+ it('sends metrics on failure', async () => {
2144
+ webex.meetings.loggerRequest.uploadLogs.rejects(new Error('fake error'));
2145
+
2146
+ await meeting.uploadLogs();
2147
+
2148
+ await testUtils.flushPromises();
2149
+
2150
+ assert.calledOnceWithExactly(metricsSpy, 'js_sdk_upload_logs_failure', sinon.match({
2151
+ callStart: 'last active',
2152
+ correlationId: 'correlation id',
2153
+ feedbackId: 'correlation id',
2154
+ locusId: 'locus id',
2155
+ meetingId: 'meeting id',
2156
+ reason: 'fake error',
2157
+ }));
2158
+ });
2159
+ });
2095
2160
  });
2096
2161
  });
@@ -2,6 +2,8 @@ import {assert} from '@webex/test-helper-chai';
2
2
  import MockWebex from '@webex/test-helper-mock-webex';
3
3
  import sinon from 'sinon';
4
4
  import Reachability, {ICECandidateResult} from '@webex/plugin-meetings/src/reachability/';
5
+ import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
6
+
5
7
  import { IP_VERSION } from '@webex/plugin-meetings/src/constants';
6
8
 
7
9
  describe('isAnyClusterReachable', () => {
@@ -9,6 +11,12 @@ describe('isAnyClusterReachable', () => {
9
11
 
10
12
  beforeEach(() => {
11
13
  webex = new MockWebex();
14
+
15
+ sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
16
+ });
17
+
18
+ afterEach(() => {
19
+ sinon.restore();
12
20
  });
13
21
 
14
22
  const checkIsClusterReachable = async (mockStorage: any, expectedValue: boolean) => {
@@ -251,12 +259,4 @@ describe('gatherReachability', () => {
251
259
  });
252
260
  });
253
261
  });
254
-
255
- describe('getIpVersion', () => {
256
- it('returns unknown', () => {
257
- const reachability = new Reachability(webex);
258
-
259
- assert.equal(reachability.getIpVersion(), IP_VERSION.unknown);
260
- })
261
- })
262
262
  });
@@ -58,6 +58,9 @@ describe('plugin-meetings', () => {
58
58
  updateMediaConnection: sinon.stub(),
59
59
  },
60
60
  webex: {
61
+ credentials: {
62
+ isUnverifiedGuest: false,
63
+ },
61
64
  meetings: {
62
65
  getMeetingByType: sinon.stub().returns(true),
63
66
  syncMeetings: sinon.stub().resolves({}),
@@ -71,6 +74,24 @@ describe('plugin-meetings', () => {
71
74
  };
72
75
  });
73
76
 
77
+ it('syncs meetings if it is not an unverified guest', async () => {
78
+ const rm = new ReconnectionManager(fakeMeeting);
79
+
80
+ await rm.reconnect();
81
+
82
+ assert.calledOnce(rm.webex.meetings.syncMeetings);
83
+ });
84
+
85
+ it('does not sync meetings if it is an unverified guest', async () => {
86
+ const rm = new ReconnectionManager(fakeMeeting);
87
+
88
+ rm.webex.credentials.isUnverifiedGuest = true;
89
+
90
+ await rm.reconnect();
91
+
92
+ assert.notCalled(rm.webex.meetings.syncMeetings);
93
+ });
94
+
74
95
  it('uses correct TURN TLS information on the reconnection', async () => {
75
96
  const rm = new ReconnectionManager(fakeMeeting);
76
97
 
@@ -6,6 +6,8 @@ import MockWebex from '@webex/test-helper-mock-webex';
6
6
  import RoapRequest from '@webex/plugin-meetings/src/roap/request';
7
7
  import Roap from '@webex/plugin-meetings/src/roap/';
8
8
  import Meeting from '@webex/plugin-meetings/src/meeting';
9
+ import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
10
+
9
11
  import { IP_VERSION } from '../../../../src/constants';
10
12
 
11
13
  describe('Roap', () => {
@@ -62,9 +64,11 @@ describe('Roap', () => {
62
64
  setRoapSeq: sinon.stub(),
63
65
  config: {experimental: {enableTurnDiscovery: false}},
64
66
  locusMediaRequest: {fake: true},
65
- webex: { meetings: { reachability: { isAnyClusterReachable: () => true, getIpVersion: () => IP_VERSION.unknown}}},
67
+ webex: { meetings: { reachability: { isAnyClusterReachable: () => true}}},
66
68
  };
67
69
 
70
+ sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
71
+
68
72
  sendRoapStub = sinon.stub(RoapRequest.prototype, 'sendRoap').resolves({});
69
73
  meeting.setRoapSeq.resetHistory();
70
74
  });
@@ -5,6 +5,7 @@ import TurnDiscovery from '@webex/plugin-meetings/src/roap/turnDiscovery';
5
5
  import Metrics from '@webex/plugin-meetings/src/metrics';
6
6
  import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
7
7
  import RoapRequest from '@webex/plugin-meetings/src/roap/request';
8
+ import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
8
9
 
9
10
  import testUtils from '../../../utils/testUtils';
10
11
  import { IP_VERSION } from '../../../../src/constants';
@@ -24,6 +25,7 @@ describe('TurnDiscovery', () => {
24
25
  clock = sinon.useFakeTimers();
25
26
 
26
27
  sinon.stub(Metrics, 'sendBehavioralMetric');
28
+ sinon.stub(MeetingUtil, 'getIpVersion').returns(IP_VERSION.unknown);
27
29
 
28
30
  mockRoapRequest = {
29
31
  sendRoap: sinon.fake.resolves({mediaConnections: FAKE_MEDIA_CONNECTIONS_FROM_LOCUS}),
@@ -53,7 +55,6 @@ describe('TurnDiscovery', () => {
53
55
  updateMediaConnections: sinon.stub(),
54
56
  webex: {meetings: {reachability: {
55
57
  isAnyClusterReachable: () => Promise.resolve(false),
56
- getIpVersion: () => IP_VERSION.unknown,
57
58
  }}},
58
59
  isMultistream: false,
59
60
  locusMediaRequest: { fake: true },
@@ -73,7 +74,8 @@ describe('TurnDiscovery', () => {
73
74
  await testUtils.flushPromises();
74
75
 
75
76
  assert.calledOnce(mockRoapRequest.sendRoap);
76
- assert.calledWith(mockRoapRequest.sendRoap, {
77
+
78
+ const expectedSendRoapArgs: any = {
77
79
  roapMessage: {
78
80
  messageType,
79
81
  version: '2',
@@ -83,8 +85,13 @@ describe('TurnDiscovery', () => {
83
85
  mediaId: expectedMediaId,
84
86
  meetingId: testMeeting.id,
85
87
  locusMediaRequest: testMeeting.locusMediaRequest,
86
- ipVersion: 0,
87
- });
88
+ };
89
+
90
+ if (messageType === 'TURN_DISCOVERY_REQUEST') {
91
+ expectedSendRoapArgs.ipVersion = 0;
92
+ }
93
+
94
+ assert.calledWith(mockRoapRequest.sendRoap, expectedSendRoapArgs);
88
95
 
89
96
  if (messageType === 'TURN_DISCOVERY_REQUEST') {
90
97
  // check also that we've applied the media connections from the response