@webex/plugin-meetings 3.12.0-next.173 → 3.12.0-next.175

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.
@@ -94,6 +94,7 @@ declare class AddMediaFailed extends WebexMeetingsError {
94
94
  selectedCandidatePairChanges?: number;
95
95
  numTransports?: number;
96
96
  iceConnected?: boolean;
97
+ iceConnectedAtLeastOnce?: boolean;
97
98
  /**
98
99
  * Creates a new AddMediaFailed error
99
100
  * @param {Object} options
@@ -101,7 +102,8 @@ declare class AddMediaFailed extends WebexMeetingsError {
101
102
  * @param {string} [options.connectionType] - The ICE connection type at the time of failure (e.g. 'UDP', 'TURN-TLS')
102
103
  * @param {number} [options.selectedCandidatePairChanges] - Number of times the selected candidate pair changed
103
104
  * @param {number} [options.numTransports] - Number of ICE transports
104
- * @param {boolean} [options.iceConnected] - Whether ICE connection was established before the failure
105
+ * @param {boolean} [options.iceConnected] - Whether ICE is connected at the time of failure
106
+ * @param {boolean} [options.iceConnectedAtLeastOnce] - Whether ICE connected at least once before failure
105
107
  */
106
108
  constructor(options?: {
107
109
  cause?: Error;
@@ -109,10 +111,11 @@ declare class AddMediaFailed extends WebexMeetingsError {
109
111
  selectedCandidatePairChanges?: number;
110
112
  numTransports?: number;
111
113
  iceConnected?: boolean;
114
+ iceConnectedAtLeastOnce?: boolean;
112
115
  });
113
116
  /**
114
117
  * Returns true if the failure was due to a DTLS handshake failure
115
- * (ICE connected successfully but the overall media connection failed).
118
+ * (ICE is still connected but the overall media connection failed).
116
119
  */
117
120
  get isDtlsHandshakeFailure(): boolean;
118
121
  }
@@ -123,6 +126,7 @@ export { AddMediaFailed };
123
126
  */
124
127
  declare class MediaConnectionTimedOutError extends Error {
125
128
  iceConnected: boolean;
129
+ iceConnectedAtLeastOnce?: boolean;
126
130
  cause?: any;
127
131
  constructor(message: string, iceConnected: boolean, cause?: any);
128
132
  }
@@ -137,7 +137,8 @@ export declare const INTENT_TO_JOIN: number[];
137
137
  export declare const ICE_TIMEOUT = 2000;
138
138
  export declare const ICE_FAIL_TIMEOUT = 3000;
139
139
  export declare const RETRY_TIMEOUT = 3000;
140
- export declare const ICE_AND_DTLS_CONNECTION_TIMEOUT = 20000;
140
+ export declare const ICE_CONNECTION_TIMEOUT = 20000;
141
+ export declare const DTLS_CONNECTION_TIMEOUT = 7000;
141
142
  export declare const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
142
143
  export declare const WEBINAR_ERROR_WEBCAST: number[];
143
144
  export declare const WEBINAR_ERROR_REGISTRATION_ID: number[];
@@ -4,96 +4,104 @@ export interface MediaConnectionAwaiterProps {
4
4
  }
5
5
  export interface FailureResult {
6
6
  iceConnected: boolean;
7
+ iceConnectedAtLeastOnce: boolean;
7
8
  }
8
9
  /**
9
- * @class MediaConnectionAwaiter
10
+ * Waits for ICE and DTLS connectivity using explicit lifecycle states.
10
11
  */
11
12
  export default class MediaConnectionAwaiter {
12
- private webrtcMediaConnection;
13
- private timer;
13
+ private props;
14
+ private state;
15
+ private timer?;
16
+ private iceConnectedAtLeastOnce;
14
17
  private defer;
15
- private retried;
16
- private iceConnected;
17
- private correlationId;
18
- private onTimeoutCallback;
19
- private peerConnectionStateCallback;
20
- private iceConnectionStateCallback;
21
- private iceGatheringStateCallback;
22
18
  /**
23
- * @param {MediaConnectionAwaiterProps} mediaConnectionAwaiterProps
19
+ * @param {MediaConnectionAwaiterProps} props
24
20
  */
25
- constructor({ webrtcMediaConnection, correlationId }: MediaConnectionAwaiterProps);
21
+ constructor(props: MediaConnectionAwaiterProps);
26
22
  /**
27
- * Returns true if the connection is connected, false otherwise.
28
- *
29
- * @returns {boolean}
23
+ * Registers listeners and starts the wait once, settling terminal connections immediately.
24
+ * @returns {Promise<void>} Rejects with FailureResult on failure
30
25
  */
31
- private isConnected;
26
+ waitForMediaConnectionConnected(): Promise<void>;
32
27
  /**
33
- * Returns true if the connection is in an unrecoverable "failed" state
34
- *
35
- * @returns {boolean}
28
+ * Applies a transition to a new state and owns its deadline or terminal settlement.
29
+ * @param {EnteredState} next - State to enter; an active wait cannot return to idle
30
+ * @param {string} reason - Trigger or reason for the transition
31
+ * @returns {void}
36
32
  */
37
- private isFailed;
33
+ private enter;
38
34
  /**
39
- * Returns true if ICE connection state indicates connectivity.
40
- *
35
+ * Returns whether the promise has settled.
41
36
  * @returns {boolean}
42
37
  */
43
- private isIceConnected;
38
+ private isTerminal;
44
39
  /**
45
- * Returns true if the ICE Gathering is completed, false otherwise.
46
- *
47
- * @returns {boolean}
40
+ * Returns the current state only if it owns a connection deadline.
41
+ * @returns {ActiveState | undefined}
48
42
  */
49
- private isIceGatheringCompleted;
43
+ private getActiveState;
44
+ /**
45
+ * Logs current browser state and transitions when connectivity or phase changes.
46
+ * @param {string} trigger - Callback or operation that triggered evaluation
47
+ * @returns {boolean} Whether a state transition occurred
48
+ */
49
+ private evaluate;
50
+ /**
51
+ * Listener for peer connection state changes.
52
+ * @returns {void}
53
+ */
54
+ peerConnectionStateHandler: () => void;
50
55
  /**
51
- * Clears the callbacks.
52
- *
56
+ * Listener for ICE connection state changes.
53
57
  * @returns {void}
54
58
  */
55
- private clearCallbacks;
59
+ iceConnectionStateHandler: () => void;
56
60
  /**
57
- * On connection state change.
58
- *
61
+ * Restarts only an unchanged ICE phase when gathering completes.
59
62
  * @returns {void}
60
63
  */
61
- connectionStateChange(): void;
64
+ iceGatheringStateHandler: () => void;
62
65
  /**
63
- * Listener for peer connection state change.
64
- *
66
+ * Rechecks connectivity before applying the deadline or the ICE gathering retry.
65
67
  * @returns {void}
66
68
  */
67
- peerConnectionStateHandler(): void;
69
+ onTimeout: () => void;
68
70
  /**
69
- * Listener for ICE connection state change.
70
- *
71
+ * Arms an active phase's deadline and logs every start or restart.
72
+ * @param {ActiveState} state - Active state whose deadline is being started
73
+ * @param {string} reason - Why the deadline is being started or restarted
71
74
  * @returns {void}
72
75
  */
73
- iceConnectionStateHandler(): void;
76
+ private armTimer;
74
77
  /**
75
- * Listener for ICE gathering state change.
76
- *
78
+ * Releases the deadline and registered listeners on either terminal transition.
77
79
  * @returns {void}
78
80
  */
79
- iceGatheringStateHandler(): void;
81
+ private teardown;
80
82
  /**
81
- * sends a metric with some additional info that might help debugging
82
- * issues where browser doesn't update the RTCPeerConnection's iceConnectionState or connectionState
83
- *
83
+ * Registers each callback once with a stable function reference.
84
84
  * @returns {void}
85
85
  */
86
- sendMetric(): Promise<void>;
86
+ private registerCallbacks;
87
87
  /**
88
- * Function called when the timeout is reached.
89
- *
88
+ * Removes callbacks when the wait reaches a terminal state.
90
89
  * @returns {void}
91
90
  */
92
- onTimeout(): void;
91
+ private unregisterCallbacks;
93
92
  /**
94
- * Waits for the webrtc media connection to be connected.
95
- *
96
- * @returns {Promise<void>} In case of failure, the promise is rejected with FailureResult
93
+ * Returns whether ICE gathering has completed.
94
+ * @returns {boolean}
97
95
  */
98
- waitForMediaConnectionConnected(): Promise<void>;
96
+ private isIceGatheringCompleted;
97
+ /**
98
+ * Captures current and historical ICE connectivity for failures and metrics.
99
+ * @returns {FailureResult}
100
+ */
101
+ private getConnectivity;
102
+ /**
103
+ * Sends connectivity diagnostics when a deadline expires.
104
+ * @returns {Promise<void>}
105
+ */
106
+ private sendMetric;
99
107
  }
@@ -912,7 +912,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
912
912
  }, _callee10);
913
913
  }))();
914
914
  },
915
- version: "3.12.0-next.173"
915
+ version: "3.12.0-next.175"
916
916
  });
917
917
  var _default = exports.default = Webinar;
918
918
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "@webex/eslint-config-legacy": "0.0.0",
44
44
  "@webex/jest-config-legacy": "0.0.0",
45
45
  "@webex/legacy-tools": "0.0.0",
46
- "@webex/plugin-rooms": "3.12.0-next.76",
46
+ "@webex/plugin-rooms": "3.12.0-next.77",
47
47
  "@webex/test-helper-chai": "3.12.0-next.9",
48
48
  "@webex/test-helper-mocha": "3.12.0-next.9",
49
49
  "@webex/test-helper-mock-webex": "3.12.0-next.9",
@@ -63,20 +63,20 @@
63
63
  "@webex/common": "3.12.0-next.9",
64
64
  "@webex/event-dictionary-ts": "^1.0.2215",
65
65
  "@webex/internal-media-core": "2.31.0",
66
- "@webex/internal-plugin-conversation": "3.12.0-next.76",
67
- "@webex/internal-plugin-device": "3.12.0-next.57",
68
- "@webex/internal-plugin-llm": "3.12.0-next.69",
69
- "@webex/internal-plugin-mercury": "3.12.0-next.65",
70
- "@webex/internal-plugin-metrics": "3.12.0-next.58",
71
- "@webex/internal-plugin-support": "3.12.0-next.76",
72
- "@webex/internal-plugin-user": "3.12.0-next.63",
73
- "@webex/internal-plugin-voicea": "3.12.0-next.75",
66
+ "@webex/internal-plugin-conversation": "3.12.0-next.77",
67
+ "@webex/internal-plugin-device": "3.12.0-next.58",
68
+ "@webex/internal-plugin-llm": "3.12.0-next.70",
69
+ "@webex/internal-plugin-mercury": "3.12.0-next.66",
70
+ "@webex/internal-plugin-metrics": "3.12.0-next.59",
71
+ "@webex/internal-plugin-support": "3.12.0-next.77",
72
+ "@webex/internal-plugin-user": "3.12.0-next.64",
73
+ "@webex/internal-plugin-voicea": "3.12.0-next.76",
74
74
  "@webex/media-helpers": "3.12.0-next.18",
75
- "@webex/plugin-people": "3.12.0-next.68",
76
- "@webex/plugin-rooms": "3.12.0-next.76",
75
+ "@webex/plugin-people": "3.12.0-next.69",
76
+ "@webex/plugin-rooms": "3.12.0-next.77",
77
77
  "@webex/ts-sdp": "^1.8.1",
78
78
  "@webex/web-capabilities": "^1.13.1",
79
- "@webex/webex-core": "3.12.0-next.62",
79
+ "@webex/webex-core": "3.12.0-next.63",
80
80
  "ampersand-collection": "^2.0.2",
81
81
  "bowser": "^2.11.0",
82
82
  "btoa": "^1.2.1",
@@ -94,5 +94,5 @@
94
94
  "//": [
95
95
  "TODO: upgrade jwt-decode when moving to node 18"
96
96
  ],
97
- "version": "3.12.0-next.173"
97
+ "version": "3.12.0-next.175"
98
98
  }
@@ -161,6 +161,7 @@ class AddMediaFailed extends WebexMeetingsError {
161
161
  selectedCandidatePairChanges?: number;
162
162
  numTransports?: number;
163
163
  iceConnected?: boolean;
164
+ iceConnectedAtLeastOnce?: boolean;
164
165
 
165
166
  /**
166
167
  * Creates a new AddMediaFailed error
@@ -169,7 +170,8 @@ class AddMediaFailed extends WebexMeetingsError {
169
170
  * @param {string} [options.connectionType] - The ICE connection type at the time of failure (e.g. 'UDP', 'TURN-TLS')
170
171
  * @param {number} [options.selectedCandidatePairChanges] - Number of times the selected candidate pair changed
171
172
  * @param {number} [options.numTransports] - Number of ICE transports
172
- * @param {boolean} [options.iceConnected] - Whether ICE connection was established before the failure
173
+ * @param {boolean} [options.iceConnected] - Whether ICE is connected at the time of failure
174
+ * @param {boolean} [options.iceConnectedAtLeastOnce] - Whether ICE connected at least once before failure
173
175
  */
174
176
  constructor(
175
177
  options: {
@@ -178,6 +180,7 @@ class AddMediaFailed extends WebexMeetingsError {
178
180
  selectedCandidatePairChanges?: number;
179
181
  numTransports?: number;
180
182
  iceConnected?: boolean;
183
+ iceConnectedAtLeastOnce?: boolean;
181
184
  } = {}
182
185
  ) {
183
186
  super(AddMediaFailed.CODE, 'Failed to add media');
@@ -186,11 +189,12 @@ class AddMediaFailed extends WebexMeetingsError {
186
189
  this.selectedCandidatePairChanges = options.selectedCandidatePairChanges;
187
190
  this.numTransports = options.numTransports;
188
191
  this.iceConnected = options.iceConnected;
192
+ this.iceConnectedAtLeastOnce = options.iceConnectedAtLeastOnce;
189
193
  }
190
194
 
191
195
  /**
192
196
  * Returns true if the failure was due to a DTLS handshake failure
193
- * (ICE connected successfully but the overall media connection failed).
197
+ * (ICE is still connected but the overall media connection failed).
194
198
  */
195
199
  get isDtlsHandshakeFailure(): boolean {
196
200
  return this.iceConnected === true;
@@ -205,6 +209,7 @@ WebExMeetingsErrors[AddMediaFailed.CODE] = AddMediaFailed;
205
209
  */
206
210
  class MediaConnectionTimedOutError extends Error {
207
211
  iceConnected: boolean;
212
+ iceConnectedAtLeastOnce?: boolean;
208
213
 
209
214
  cause?: any;
210
215
 
@@ -212,6 +217,7 @@ class MediaConnectionTimedOutError extends Error {
212
217
  super(message);
213
218
  this.name = 'MediaConnectionTimedOutError';
214
219
  this.iceConnected = iceConnected;
220
+ this.iceConnectedAtLeastOnce = cause?.iceConnectedAtLeastOnce;
215
221
  this.cause = cause;
216
222
  }
217
223
  }
package/src/constants.ts CHANGED
@@ -201,7 +201,8 @@ export const ICE_FAIL_TIMEOUT = 3000;
201
201
 
202
202
  export const RETRY_TIMEOUT = 3000;
203
203
 
204
- export const ICE_AND_DTLS_CONNECTION_TIMEOUT = 20000;
204
+ export const ICE_CONNECTION_TIMEOUT = 20000;
205
+ export const DTLS_CONNECTION_TIMEOUT = 7000;
205
206
  export const ROAP_OFFER_ANSWER_EXCHANGE_TIMEOUT = 35000;
206
207
  export const WEBINAR_ERROR_WEBCAST = [403026];
207
208
  export const WEBINAR_ERROR_REGISTRATION_ID = [403037, 403137];