@webex/plugin-meetings 3.5.0-wxcc.1 → 3.6.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 (201) 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/config.js +3 -1
  44. package/dist/config.js.map +1 -1
  45. package/dist/constants.d.ts +1088 -0
  46. package/dist/constants.js +1 -0
  47. package/dist/constants.js.map +1 -1
  48. package/dist/controls-options-manager/constants.d.ts +4 -0
  49. package/dist/controls-options-manager/enums.d.ts +15 -0
  50. package/dist/controls-options-manager/index.d.ts +136 -0
  51. package/dist/controls-options-manager/types.d.ts +43 -0
  52. package/dist/controls-options-manager/util.d.ts +1 -0
  53. package/dist/index.d.ts +7 -0
  54. package/dist/interceptors/index.d.ts +2 -0
  55. package/dist/interceptors/locusRetry.d.ts +27 -0
  56. package/dist/interpretation/collection.d.ts +5 -0
  57. package/dist/interpretation/index.d.ts +5 -0
  58. package/dist/interpretation/index.js +1 -1
  59. package/dist/interpretation/siLanguage.d.ts +5 -0
  60. package/dist/interpretation/siLanguage.js +1 -1
  61. package/dist/locus-info/controlsUtils.d.ts +2 -0
  62. package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
  63. package/dist/locus-info/fullState.d.ts +2 -0
  64. package/dist/locus-info/hostUtils.d.ts +2 -0
  65. package/dist/locus-info/index.d.ts +322 -0
  66. package/dist/locus-info/infoUtils.d.ts +2 -0
  67. package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
  68. package/dist/locus-info/parser.d.ts +272 -0
  69. package/dist/locus-info/selfUtils.d.ts +2 -0
  70. package/dist/media/index.d.ts +34 -0
  71. package/dist/media/index.js +3 -1
  72. package/dist/media/index.js.map +1 -1
  73. package/dist/media/properties.d.ts +93 -0
  74. package/dist/media/util.d.ts +2 -0
  75. package/dist/mediaQualityMetrics/config.d.ts +241 -0
  76. package/dist/mediaQualityMetrics/config.js +502 -0
  77. package/dist/mediaQualityMetrics/config.js.map +1 -0
  78. package/dist/meeting/effectsState.js +260 -0
  79. package/dist/meeting/effectsState.js.map +1 -0
  80. package/dist/meeting/in-meeting-actions.d.ts +167 -0
  81. package/dist/meeting/in-meeting-actions.js +3 -1
  82. package/dist/meeting/in-meeting-actions.js.map +1 -1
  83. package/dist/meeting/index.d.ts +1825 -0
  84. package/dist/meeting/index.js +39 -4
  85. package/dist/meeting/index.js.map +1 -1
  86. package/dist/meeting/locusMediaRequest.d.ts +74 -0
  87. package/dist/meeting/muteState.d.ts +178 -0
  88. package/dist/meeting/request.d.ts +295 -0
  89. package/dist/meeting/request.type.d.ts +11 -0
  90. package/dist/meeting/state.d.ts +9 -0
  91. package/dist/meeting/util.d.ts +119 -0
  92. package/dist/meeting/util.js +5 -8
  93. package/dist/meeting/util.js.map +1 -1
  94. package/dist/meeting/voicea-meeting.d.ts +16 -0
  95. package/dist/meeting-info/collection.d.ts +20 -0
  96. package/dist/meeting-info/index.d.ts +69 -0
  97. package/dist/meeting-info/meeting-info-v2.d.ts +123 -0
  98. package/dist/meeting-info/request.d.ts +22 -0
  99. package/dist/meeting-info/util.d.ts +2 -0
  100. package/dist/meeting-info/utilv2.d.ts +2 -0
  101. package/dist/meetings/collection.d.ts +40 -0
  102. package/dist/meetings/index.d.ts +390 -0
  103. package/dist/meetings/index.js +79 -26
  104. package/dist/meetings/index.js.map +1 -1
  105. package/dist/meetings/meetings.types.d.ts +4 -0
  106. package/dist/meetings/request.d.ts +27 -0
  107. package/dist/meetings/util.d.ts +18 -0
  108. package/dist/member/index.d.ts +160 -0
  109. package/dist/member/member.types.js +17 -0
  110. package/dist/member/member.types.js.map +1 -0
  111. package/dist/member/types.d.ts +32 -0
  112. package/dist/member/util.d.ts +2 -0
  113. package/dist/members/collection.d.ts +29 -0
  114. package/dist/members/index.d.ts +353 -0
  115. package/dist/members/request.d.ts +114 -0
  116. package/dist/members/types.d.ts +25 -0
  117. package/dist/members/util.d.ts +215 -0
  118. package/dist/metrics/config.js +276 -0
  119. package/dist/metrics/config.js.map +1 -0
  120. package/dist/metrics/constants.d.ts +70 -0
  121. package/dist/metrics/index.d.ts +45 -0
  122. package/dist/multistream/mediaRequestManager.d.ts +119 -0
  123. package/dist/multistream/receiveSlot.d.ts +68 -0
  124. package/dist/multistream/receiveSlotManager.d.ts +56 -0
  125. package/dist/multistream/remoteMedia.d.ts +72 -0
  126. package/dist/multistream/remoteMediaGroup.d.ts +49 -0
  127. package/dist/multistream/remoteMediaManager.d.ts +300 -0
  128. package/dist/multistream/sendSlotManager.d.ts +69 -0
  129. package/dist/networkQualityMonitor/index.d.ts +70 -0
  130. package/dist/networkQualityMonitor/index.js +13 -19
  131. package/dist/networkQualityMonitor/index.js.map +1 -1
  132. package/dist/peer-connection-manager/index.js +671 -0
  133. package/dist/peer-connection-manager/index.js.map +1 -0
  134. package/dist/peer-connection-manager/util.js +109 -0
  135. package/dist/peer-connection-manager/util.js.map +1 -0
  136. package/dist/personal-meeting-room/index.d.ts +47 -0
  137. package/dist/personal-meeting-room/request.d.ts +14 -0
  138. package/dist/personal-meeting-room/util.d.ts +2 -0
  139. package/dist/reachability/clusterReachability.d.ts +109 -0
  140. package/dist/reachability/index.d.ts +105 -0
  141. package/dist/reachability/request.d.ts +39 -0
  142. package/dist/reachability/util.d.ts +8 -0
  143. package/dist/reactions/constants.d.ts +3 -0
  144. package/dist/reactions/reactions.d.ts +4 -0
  145. package/dist/reactions/reactions.type.d.ts +52 -0
  146. package/dist/reconnection-manager/index.d.ts +136 -0
  147. package/dist/recording-controller/enums.d.ts +7 -0
  148. package/dist/recording-controller/index.d.ts +207 -0
  149. package/dist/recording-controller/util.d.ts +14 -0
  150. package/dist/roap/collection.js +62 -0
  151. package/dist/roap/collection.js.map +1 -0
  152. package/dist/roap/handler.js +275 -0
  153. package/dist/roap/handler.js.map +1 -0
  154. package/dist/roap/index.d.ts +86 -0
  155. package/dist/roap/request.d.ts +39 -0
  156. package/dist/roap/state.js +126 -0
  157. package/dist/roap/state.js.map +1 -0
  158. package/dist/roap/turnDiscovery.d.ts +155 -0
  159. package/dist/roap/util.js +75 -0
  160. package/dist/roap/util.js.map +1 -0
  161. package/dist/rtcMetrics/constants.d.ts +4 -0
  162. package/dist/rtcMetrics/index.d.ts +61 -0
  163. package/dist/statsAnalyzer/global.d.ts +36 -0
  164. package/dist/statsAnalyzer/global.js +126 -0
  165. package/dist/statsAnalyzer/global.js.map +1 -0
  166. package/dist/statsAnalyzer/index.d.ts +217 -0
  167. package/dist/statsAnalyzer/index.js +1013 -0
  168. package/dist/statsAnalyzer/index.js.map +1 -0
  169. package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
  170. package/dist/statsAnalyzer/mqaUtil.js +179 -0
  171. package/dist/statsAnalyzer/mqaUtil.js.map +1 -0
  172. package/dist/transcription/index.d.ts +64 -0
  173. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  174. package/dist/types/config.d.ts +1 -0
  175. package/dist/types/constants.d.ts +2 -1
  176. package/dist/types/mediaQualityMetrics/config.d.ts +241 -0
  177. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  178. package/dist/types/meeting/index.d.ts +11 -0
  179. package/dist/types/meetings/index.d.ts +34 -2
  180. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  181. package/dist/types/statsAnalyzer/index.d.ts +217 -0
  182. package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
  183. package/dist/webinar/collection.d.ts +16 -0
  184. package/dist/webinar/index.d.ts +5 -0
  185. package/dist/webinar/index.js +1 -1
  186. package/package.json +22 -22
  187. package/src/config.ts +2 -0
  188. package/src/constants.ts +1 -0
  189. package/src/media/index.ts +4 -1
  190. package/src/meeting/in-meeting-actions.ts +3 -0
  191. package/src/meeting/index.ts +42 -2
  192. package/src/meeting/util.ts +21 -29
  193. package/src/meetings/index.ts +107 -37
  194. package/test/unit/spec/media/index.ts +4 -0
  195. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  196. package/test/unit/spec/meeting/index.js +58 -17
  197. package/test/unit/spec/meeting/utils.js +34 -84
  198. package/test/unit/spec/meetings/index.js +112 -13
  199. package/src/rtcMetrics/constants.ts +0 -3
  200. package/src/rtcMetrics/index.ts +0 -186
  201. package/test/unit/spec/rtcMetrics/index.ts +0 -154
@@ -1,186 +0,0 @@
1
- /* eslint-disable class-methods-use-this */
2
- import {CallDiagnosticUtils} from '@webex/internal-plugin-metrics';
3
- import uuid from 'uuid';
4
- import RTC_METRICS from './constants';
5
-
6
- const parseJsonPayload = (payload: any[]): any | null => {
7
- try {
8
- if (payload && payload[0]) {
9
- return JSON.parse(payload[0]);
10
- }
11
-
12
- return null;
13
- } catch (_) {
14
- return null;
15
- }
16
- };
17
-
18
- /**
19
- * Rtc Metrics
20
- */
21
- export default class RtcMetrics {
22
- /**
23
- * Array of MetricData items to be sent to the metrics service.
24
- */
25
- metricsQueue = [];
26
-
27
- intervalId: number;
28
-
29
- webex: any;
30
-
31
- meetingId: string;
32
-
33
- correlationId: string;
34
-
35
- connectionId: string;
36
-
37
- shouldSendMetricsOnNextStatsReport: boolean;
38
-
39
- /**
40
- * Initialize the interval.
41
- *
42
- * @param {object} webex - The main `webex` object.
43
- * @param {string} meetingId - The meeting id.
44
- * @param {string} correlationId - The correlation id.
45
- */
46
- constructor(webex, meetingId, correlationId) {
47
- // `window` is used to prevent typescript from returning a NodeJS.Timer.
48
- this.intervalId = window.setInterval(this.sendMetricsInQueue.bind(this), 30 * 1000);
49
- this.meetingId = meetingId;
50
- this.webex = webex;
51
- this.correlationId = correlationId;
52
- this.resetConnection();
53
- }
54
-
55
- /**
56
- * Check to see if the metrics queue has any items.
57
- *
58
- * @returns {void}
59
- */
60
- public sendMetricsInQueue() {
61
- if (this.metricsQueue.length) {
62
- this.sendMetrics();
63
- this.metricsQueue = [];
64
- }
65
- }
66
-
67
- /**
68
- * Forces sending metrics when we get the next stats-report
69
- *
70
- * This is useful for cases when something important happens that affects the media connection,
71
- * for example when we move from lobby into the meeting.
72
- *
73
- * @returns {void}
74
- */
75
- public sendNextMetrics() {
76
- this.shouldSendMetricsOnNextStatsReport = true;
77
- }
78
-
79
- /**
80
- * Add metrics items to the metrics queue.
81
- *
82
- * @param {object} data - An object with a payload array of metrics items.
83
- *
84
- * @returns {void}
85
- */
86
- addMetrics(data) {
87
- if (data.payload.length) {
88
- if (data.name === 'stats-report') {
89
- data.payload = data.payload.map(this.anonymizeIp);
90
- }
91
-
92
- this.metricsQueue.push(data);
93
-
94
- if (this.shouldSendMetricsOnNextStatsReport && data.name === 'stats-report') {
95
- // this is the first useful set of data (WCME gives it to us after 5s), send it out immediately
96
- // in case the user is unhappy and closes the browser early
97
- this.sendMetricsInQueue();
98
- this.shouldSendMetricsOnNextStatsReport = false;
99
- }
100
-
101
- try {
102
- // If a connection fails, send the rest of the metrics in queue and get a new connection id.
103
- const parsedPayload = parseJsonPayload(data.payload);
104
- if (
105
- data.name === 'onconnectionstatechange' &&
106
- parsedPayload &&
107
- parsedPayload.value === 'failed'
108
- ) {
109
- this.sendMetricsInQueue();
110
- this.resetConnection();
111
- }
112
- } catch (e) {
113
- console.error(e);
114
- }
115
- }
116
- }
117
-
118
- /**
119
- * Clear the metrics interval.
120
- *
121
- * @returns {void}
122
- */
123
- closeMetrics() {
124
- this.sendMetricsInQueue();
125
- clearInterval(this.intervalId);
126
- }
127
-
128
- /**
129
- * Anonymize IP addresses.
130
- *
131
- * @param {array} stats - An RTCStatsReport organized into an array of strings.
132
- * @returns {string}
133
- */
134
- anonymizeIp(stats: string): string {
135
- const data = JSON.parse(stats);
136
- // on local and remote candidates, anonymize the last 4 bits.
137
- if (data.type === 'local-candidate' || data.type === 'remote-candidate') {
138
- data.ip = CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;
139
- data.address = CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;
140
- data.relatedAddress =
141
- CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;
142
- }
143
-
144
- return JSON.stringify(data);
145
- }
146
-
147
- /**
148
- * Set a new connection id.
149
- *
150
- * @returns {void}
151
- */
152
- private resetConnection() {
153
- this.connectionId = uuid.v4();
154
- this.shouldSendMetricsOnNextStatsReport = true;
155
- }
156
-
157
- /**
158
- * Send metrics to the metrics service.
159
- *
160
- * @returns {void}
161
- */
162
- private sendMetrics() {
163
- this.webex.request({
164
- method: 'POST',
165
- service: 'unifiedTelemetry',
166
- resource: 'metric/v2',
167
- headers: {
168
- type: 'webrtcMedia',
169
- appId: RTC_METRICS.APP_ID,
170
- },
171
- body: {
172
- metrics: [
173
- {
174
- type: 'webrtc',
175
- version: '1.1.0',
176
- userId: this.webex.internal.device.userId,
177
- meetingId: this.meetingId,
178
- correlationId: this.correlationId,
179
- connectionId: this.connectionId,
180
- data: this.metricsQueue,
181
- },
182
- ],
183
- },
184
- });
185
- }
186
- }
@@ -1,154 +0,0 @@
1
- import 'jsdom-global/register';
2
- import RtcMetrics from '@webex/plugin-meetings/src/rtcMetrics';
3
- import MockWebex from '@webex/test-helper-mock-webex';
4
- import {assert} from '@webex/test-helper-chai';
5
- import sinon from 'sinon';
6
- import RTC_METRICS from '../../../../src/rtcMetrics/constants';
7
-
8
- const FAKE_METRICS_ITEM = {payload: ['{"type":"string","value":"fake-metrics","id":""}']};
9
- const FAILURE_METRICS_ITEM = {
10
- name: "onconnectionstatechange",
11
- payload: ['{"type":"string","value":"failed","id":""}'],
12
- timestamp: 1707929986667
13
- };
14
-
15
- const STATS_WITH_IP = '{"id":"RTCIceCandidate_/kQs0ZNU","type":"remote-candidate","transportId":"RTCTransport_0_1","isRemote":true,"ip":"11.22.111.255","address":"11.22.111.255","port":5004,"protocol":"udp","candidateType":"host","priority":2130706431}';
16
- const STATS_WITH_IP_RESULT = '{"id":"RTCIceCandidate_/kQs0ZNU","type":"remote-candidate","transportId":"RTCTransport_0_1","isRemote":true,"ip":"11.22.111.240","address":"11.22.111.240","port":5004,"protocol":"udp","candidateType":"host","priority":2130706431}';
17
-
18
- describe('RtcMetrics', () => {
19
- let metrics: RtcMetrics;
20
- let webex: MockWebex;
21
- let clock;
22
- let anonymizeIpSpy;
23
-
24
- const sandbox = sinon.createSandbox();
25
-
26
- beforeEach(() => {
27
- clock = sinon.useFakeTimers();
28
- webex = new MockWebex();
29
- metrics = new RtcMetrics(webex, 'mock-meeting-id', 'mock-correlation-id');
30
- anonymizeIpSpy = sandbox.spy(metrics, 'anonymizeIp');
31
- });
32
-
33
- afterEach(() => {
34
- sandbox.restore();
35
- });
36
-
37
- it('sendMetrics should send a webex request', () => {
38
- assert.notCalled(webex.request);
39
-
40
- metrics.addMetrics(FAKE_METRICS_ITEM);
41
- (metrics as any).sendMetrics();
42
-
43
- assert.callCount(webex.request, 1);
44
- assert.calledWithMatch(webex.request, sinon.match.has('headers', {
45
- type: 'webrtcMedia',
46
- appId: RTC_METRICS.APP_ID,
47
- }));
48
- assert.calledWithMatch(webex.request, sinon.match.hasNested('body.metrics[0].data[0].payload', FAKE_METRICS_ITEM.payload));
49
- assert.calledWithMatch(webex.request, sinon.match.hasNested('body.metrics[0].meetingId', 'mock-meeting-id'));
50
- assert.calledWithMatch(webex.request, sinon.match.hasNested('body.metrics[0].correlationId', 'mock-correlation-id'));
51
- });
52
-
53
- it('should have a defined sendMetricsInQueue function which is public', () => {
54
- assert.isDefined(metrics.sendMetricsInQueue);
55
- assert.isFunction(metrics.sendMetricsInQueue);
56
- });
57
-
58
- it('should send metrics requests over time', () => {
59
- assert.notCalled(webex.request);
60
-
61
- metrics.addMetrics(FAKE_METRICS_ITEM);
62
- assert.deepEqual(metrics.metricsQueue, [FAKE_METRICS_ITEM]);
63
- clock.tick(60 * 1000);
64
-
65
- assert.callCount(webex.request, 1);
66
- });
67
-
68
- it('should not send requests with no items in the queue', () => {
69
- clock.tick(60 * 1000);
70
- assert.notCalled(webex.request);
71
- });
72
-
73
- it('sendMetricsInQueue should send metrics if any exist in the queue', () => {
74
- assert.notCalled(webex.request);
75
-
76
- metrics.addMetrics(FAKE_METRICS_ITEM);
77
- (metrics as any).sendMetricsInQueue();
78
-
79
- assert.callCount(webex.request, 1);
80
- });
81
-
82
- it('should clear out metrics on close', () => {
83
- assert.notCalled(webex.request);
84
-
85
- metrics.addMetrics(FAKE_METRICS_ITEM);
86
- metrics.closeMetrics();
87
-
88
- assert.callCount(webex.request, 1);
89
- });
90
-
91
- it('should clear out metrics on failure', () => {
92
- assert.notCalled(webex.request);
93
-
94
- metrics.addMetrics(FAILURE_METRICS_ITEM);
95
-
96
- assert.callCount(webex.request, 1);
97
- });
98
-
99
- it('should have the same connectionId on success', () => {
100
- const originalId = metrics.connectionId;
101
-
102
- metrics.addMetrics(FAKE_METRICS_ITEM);
103
-
104
- assert.strictEqual(originalId, metrics.connectionId);
105
- });
106
-
107
- it('should have a new connectionId on failure', () => {
108
- const originalId = metrics.connectionId;
109
-
110
- metrics.addMetrics(FAILURE_METRICS_ITEM);
111
-
112
- assert.notEqual(originalId, metrics.connectionId);
113
- });
114
-
115
- it('should anonymize IP addresses', () => {
116
- assert.strictEqual(metrics.anonymizeIp(STATS_WITH_IP), STATS_WITH_IP_RESULT);
117
- });
118
-
119
- it('should call anonymizeIp', () => {
120
- metrics.addMetrics({ name: 'stats-report', payload: [STATS_WITH_IP] });
121
- assert.calledOnce(anonymizeIpSpy);
122
- })
123
-
124
- it('should send metrics on first stats-report', () => {
125
- assert.callCount(webex.request, 0);
126
-
127
- metrics.addMetrics(FAKE_METRICS_ITEM);
128
- assert.callCount(webex.request, 0);
129
-
130
- // first stats-report should trigger a call to webex.request
131
- metrics.addMetrics({ name: 'stats-report', payload: [STATS_WITH_IP] });
132
- assert.callCount(webex.request, 1);
133
- });
134
-
135
- it('should send metrics on first stats-report after a new connection', () => {
136
- assert.callCount(webex.request, 0);
137
-
138
- // first stats-report should trigger a call to webex.request
139
- metrics.addMetrics({ name: 'stats-report', payload: [STATS_WITH_IP] });
140
- assert.callCount(webex.request, 1);
141
-
142
- // subsequent stats-report doesn't trigger it
143
- metrics.addMetrics({ name: 'stats-report', payload: [STATS_WITH_IP] });
144
- assert.callCount(webex.request, 1);
145
-
146
- // now, simulate a failure - that triggers a new connection and upload of the metrics
147
- metrics.addMetrics(FAILURE_METRICS_ITEM);
148
- assert.callCount(webex.request, 2);
149
-
150
- // and another stats-report should trigger another upload of the metrics
151
- metrics.addMetrics({ name: 'stats-report', payload: [STATS_WITH_IP] });
152
- assert.callCount(webex.request, 3);
153
- });
154
- });