@webex/plugin-meetings 3.12.0-next.22 → 3.12.0-next.24

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.
@@ -31,14 +31,12 @@ var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Inte
31
31
  (0, _inherits2.default)(LocusRetryStatusInterceptor, _Interceptor);
32
32
  return (0, _createClass2.default)(LocusRetryStatusInterceptor, [{
33
33
  key: "onResponseError",
34
- value:
35
- /**
36
- * Handle response errors
37
- * @param {Object} options
38
- * @param {WebexHttpError} reason
39
- * @returns {Promise<WebexHttpError>}
40
- */
41
- function onResponseError(options, reason) {
34
+ value: function onResponseError(options, reason) {
35
+ // Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries
36
+ // make things worse. The normal sync timers will handle recovery for these endpoints.
37
+ if ((reason.statusCode === 429 || reason.statusCode >= 500) && LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)) {
38
+ return _promise.default.reject(reason);
39
+ }
42
40
  if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {
43
41
  var hasRetriedLocusRequest = rateLimitExpiryTime.get(this);
44
42
  var retryAfterTime = options.headers['retry-after'] || 2000;
@@ -87,6 +85,23 @@ var LocusRetryStatusInterceptor = exports.default = /*#__PURE__*/function (_Inte
87
85
  webex: this
88
86
  });
89
87
  }
88
+
89
+ /**
90
+ * Check whether a URI is a Locus /hashtree or /sync endpoint.
91
+ * @param {string} uri
92
+ * @returns {boolean}
93
+ */
94
+ }, {
95
+ key: "isLocusHashtreeOrSync",
96
+ value: function isLocusHashtreeOrSync(uri) {
97
+ try {
98
+ var _URL = new URL(uri),
99
+ pathname = _URL.pathname;
100
+ return pathname.includes('/locus/') && (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'));
101
+ } catch (_unused) {
102
+ return false;
103
+ }
104
+ }
90
105
  }]);
91
106
  }(_httpCore.Interceptor);
92
107
  //# sourceMappingURL=locusRetry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","uri","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","_promise","reject","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Handle response errors\n * @param {Object} options\n * @param {WebexHttpError} reason\n * @returns {Promise<WebexHttpError>}\n */\n onResponseError(options, reason) {\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(options);\n }\n rateLimitExpiryTime.set(this, true);\n\n return this.handleRetryRequestLocusServiceError(options, retryAfterTime);\n }\n\n return Promise.reject(reason);\n }\n\n /**\n * Handle retries for locus service unavailable errors\n * @param {Object} options associated with the request\n * @param {number} retryAfterTime retry after time in milliseconds\n * @returns {Promise}\n */\n handleRetryRequestLocusServiceError(options, retryAfterTime) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n clearTimeout(timeout);\n\n // @ts-ignore\n this.webex\n .request({\n method: options.method,\n uri: options.uri,\n body: options.body,\n })\n .then(resolve)\n .catch(reject);\n }, retryAfterTime);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAA6C,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UAJ7C;AACA;AACA;AAIA,IAAMc,mBAAmB,GAAG,IAAAC,QAAA,CAAAX,OAAA,CAAY,CAAC;AACzC;AACA;AACA;AAFA,IAGqBY,2BAA2B,GAAAC,OAAA,CAAAb,OAAA,0BAAAc,YAAA;EAAA,SAAAF,4BAAA;IAAA,IAAAG,gBAAA,CAAAf,OAAA,QAAAY,2BAAA;IAAA,OAAAjB,UAAA,OAAAiB,2BAAA,EAAAI,SAAA;EAAA;EAAA,IAAAC,UAAA,CAAAjB,OAAA,EAAAY,2BAAA,EAAAE,YAAA;EAAA,WAAAI,aAAA,CAAAlB,OAAA,EAAAY,2BAAA;IAAAO,GAAA;IAAAC,KAAA;IAS9C;AACF;AACA;AACA;AACA;AACA;IACE,SAAAC,eAAeA,CAACC,OAAO,EAAEC,MAAM,EAAE;MAC/B,IAAI,CAACA,MAAM,CAACC,UAAU,KAAK,GAAG,IAAID,MAAM,CAACC,UAAU,KAAK,GAAG,KA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B,MAAMA,CAAA,EAAG;MACd;MACA,OAAO,IAAIlC,2BAA2B,CAAC;QAAC4B,KAAK,EAAE;MAAI,CAAC,CAAC;IACvD;EAAC;AAAA,EAPsDO,qBAAW","ignoreList":[]}
1
+ {"version":3,"names":["_httpCore","require","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","rateLimitExpiryTime","_weakMap","LocusRetryStatusInterceptor","exports","_Interceptor","_classCallCheck2","arguments","_inherits2","_createClass2","key","value","onResponseError","options","reason","statusCode","isLocusHashtreeOrSync","uri","_promise","reject","includes","hasRetriedLocusRequest","get","retryAfterTime","headers","set","handleRetryRequestLocusServiceError","_this","resolve","timeout","setTimeout","clearTimeout","webex","request","method","body","then","catch","create","_URL","URL","pathname","endsWith","_unused","Interceptor"],"sources":["locusRetry.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Interceptor} from '@webex/http-core';\n\nconst rateLimitExpiryTime = new WeakMap();\n/**\n * @class\n */\nexport default class LocusRetryStatusInterceptor extends Interceptor {\n /**\n * @returns {LocusRetryStatusInterceptor}\n */\n static create() {\n // @ts-ignore\n return new LocusRetryStatusInterceptor({webex: this});\n }\n\n /**\n * Check whether a URI is a Locus /hashtree or /sync endpoint.\n * @param {string} uri\n * @returns {boolean}\n */\n private static isLocusHashtreeOrSync(uri: string): boolean {\n try {\n const {pathname} = new URL(uri);\n\n return (\n pathname.includes('/locus/') &&\n (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'))\n );\n } catch {\n return false;\n }\n }\n\n onResponseError(options, reason) {\n // Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries\n // make things worse. The normal sync timers will handle recovery for these endpoints.\n if (\n (reason.statusCode === 429 || reason.statusCode >= 500) &&\n LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)\n ) {\n return Promise.reject(reason);\n }\n\n if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {\n const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);\n const retryAfterTime = options.headers['retry-after'] || 2000;\n\n if (hasRetriedLocusRequest) {\n rateLimitExpiryTime.set(this, false);\n\n return Promise.reject(options);\n }\n rateLimitExpiryTime.set(this, true);\n\n return this.handleRetryRequestLocusServiceError(options, retryAfterTime);\n }\n\n return Promise.reject(reason);\n }\n\n /**\n * Handle retries for locus service unavailable errors\n * @param {Object} options associated with the request\n * @param {number} retryAfterTime retry after time in milliseconds\n * @returns {Promise}\n */\n handleRetryRequestLocusServiceError(options, retryAfterTime) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n clearTimeout(timeout);\n\n // @ts-ignore\n this.webex\n .request({\n method: options.method,\n uri: options.uri,\n body: options.body,\n })\n .then(resolve)\n .catch(reject);\n }, retryAfterTime);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,SAAA,GAAAC,OAAA;AAA6C,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,CAAAC,OAAA,EAAAJ,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAI,0BAAA,cAAAN,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAN,kBAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAM,yBAAA,YAAAA,0BAAA,aAAAN,CAAA,UAJ7C;AACA;AACA;AAIA,IAAMc,mBAAmB,GAAG,IAAAC,QAAA,CAAAX,OAAA,CAAY,CAAC;AACzC;AACA;AACA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EAAC;AAAA,EAzBsDC,qBAAW","ignoreList":[]}
@@ -372,7 +372,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
372
372
  throw error;
373
373
  });
374
374
  },
375
- version: "3.12.0-next.22"
375
+ version: "3.12.0-next.24"
376
376
  });
377
377
  var _default = exports.default = SimultaneousInterpretation;
378
378
  //# sourceMappingURL=index.js.map
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.12.0-next.22"
21
+ version: "3.12.0-next.24"
22
22
  });
23
23
  var _default = exports.default = SILanguage;
24
24
  //# sourceMappingURL=siLanguage.js.map
@@ -1498,8 +1498,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1498
1498
  }, {
1499
1499
  key: "updateLocusInfo",
1500
1500
  value: function updateLocusInfo(locus) {
1501
- var _locus$self2, _locus$self3;
1502
- if (((_locus$self2 = locus.self) === null || _locus$self2 === void 0 ? void 0 : _locus$self2.reason) === 'MOVED' && ((_locus$self3 = locus.self) === null || _locus$self3 === void 0 ? void 0 : _locus$self3.state) === 'LEFT') {
1501
+ if (_util.default.isSelfMovedOrBreakoutEnded(locus)) {
1503
1502
  // When moved to a breakout session locus sends a message for the previous locus
1504
1503
  // indicating that we have been moved. It isn't helpful to continue parsing this
1505
1504
  // as it gets interpreted as if we have left the call