@webex/plugin-meetings 3.12.0-next.94 → 3.12.0-next.95

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.
@@ -123,7 +123,8 @@ export { AddMediaFailed };
123
123
  */
124
124
  declare class MediaConnectionTimedOutError extends Error {
125
125
  iceConnected: boolean;
126
- constructor(message: string, iceConnected: boolean);
126
+ cause?: any;
127
+ constructor(message: string, iceConnected: boolean, cause?: any);
127
128
  }
128
129
  export { MediaConnectionTimedOutError };
129
130
  /**
@@ -869,7 +869,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
869
869
  }, _callee1);
870
870
  }))();
871
871
  },
872
- version: "3.12.0-next.94"
872
+ version: "3.12.0-next.95"
873
873
  });
874
874
  var _default = exports.default = Webinar;
875
875
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -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.94"
97
+ "version": "3.12.0-next.95"
98
98
  }
@@ -206,10 +206,13 @@ WebExMeetingsErrors[AddMediaFailed.CODE] = AddMediaFailed;
206
206
  class MediaConnectionTimedOutError extends Error {
207
207
  iceConnected: boolean;
208
208
 
209
- constructor(message: string, iceConnected: boolean) {
209
+ cause?: any;
210
+
211
+ constructor(message: string, iceConnected: boolean, cause?: any) {
210
212
  super(message);
211
213
  this.name = 'MediaConnectionTimedOutError';
212
214
  this.iceConnected = iceConnected;
215
+ this.cause = cause;
213
216
  }
214
217
  }
215
218
  export {MediaConnectionTimedOutError};
@@ -8153,7 +8153,9 @@ export default class Meeting extends StatelessWebexPlugin {
8153
8153
 
8154
8154
  throw new MediaConnectionTimedOutError(
8155
8155
  `Timed out waiting for media connection to be connected, correlationId=${this.correlationId}`,
8156
- iceConnected
8156
+ iceConnected,
8157
+ // keep reference to the original rejected result (which is the object the SDK reports to CA as rawError above)
8158
+ error
8157
8159
  );
8158
8160
  }
8159
8161
  }
@@ -1,5 +1,8 @@
1
1
  import {assert} from '@webex/test-helper-chai';
2
- import {AddMediaFailed, MediaConnectionTimedOutError} from '@webex/plugin-meetings/src/common/errors/webex-errors';
2
+ import {
3
+ AddMediaFailed,
4
+ MediaConnectionTimedOutError,
5
+ } from '@webex/plugin-meetings/src/common/errors/webex-errors';
3
6
 
4
7
  describe('MediaConnectionTimedOutError', () => {
5
8
  [
@@ -15,6 +18,19 @@ describe('MediaConnectionTimedOutError', () => {
15
18
  assert.instanceOf(error, Error);
16
19
  });
17
20
  });
21
+
22
+ it('stores the cause when provided', () => {
23
+ const cause = {iceConnected: true};
24
+ const error = new MediaConnectionTimedOutError('timeout', true, cause);
25
+
26
+ assert.equal(error.cause, cause);
27
+ });
28
+
29
+ it('leaves cause undefined when not provided', () => {
30
+ const error = new MediaConnectionTimedOutError('timeout', true);
31
+
32
+ assert.isUndefined(error.cause);
33
+ });
18
34
  });
19
35
 
20
36
  describe('AddMediaFailed', () => {
@@ -4319,7 +4319,10 @@ describe('plugin-meetings', () => {
4319
4319
  sinon.stub(CallDiagnosticUtils, 'generateClientErrorCodeForIceFailure').returns(2004);
4320
4320
 
4321
4321
  meeting.meetingState = 'ACTIVE';
4322
- meeting.mediaProperties.waitForMediaConnectionConnected = sinon.stub().rejects({iceConnected});
4322
+ const rejectedResult = {iceConnected};
4323
+ meeting.mediaProperties.waitForMediaConnectionConnected = sinon
4324
+ .stub()
4325
+ .rejects(rejectedResult);
4323
4326
 
4324
4327
  meeting.roap.doTurnDiscovery = sinon.stub().returns({
4325
4328
  turnServerInfo: {urls: ['turns:fake:443'], username: 'u', password: 'p'},
@@ -4342,6 +4345,11 @@ describe('plugin-meetings', () => {
4342
4345
 
4343
4346
  assert.instanceOf(thrownError, AddMediaFailed);
4344
4347
  assert.equal(thrownError.iceConnected, iceConnected);
4348
+ // the AddMediaFailed cause should be the MediaConnectionTimedOutError, which in turn should
4349
+ // preserve the original rejected result as its cause, so that the web client
4350
+ // can find the CA-reported error in the eventErrorCache via the cause chain
4351
+ assert.instanceOf(thrownError.cause, MediaConnectionTimedOutError);
4352
+ assert.equal(thrownError.cause.cause, rejectedResult);
4345
4353
  });
4346
4354
  });
4347
4355