@webex/calling 3.12.0-webex-services-ready.4 → 3.13.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.
- package/dist/CallRecording/WxcCallRecordingConnector.js +345 -174
- package/dist/CallRecording/WxcCallRecordingConnector.js.map +1 -1
- package/dist/CallRecording/WxcCallRecordingConnector.test.js +354 -182
- package/dist/CallRecording/WxcCallRecordingConnector.test.js.map +1 -1
- package/dist/CallRecording/callRecordingFixtures.js +40 -9
- package/dist/CallRecording/callRecordingFixtures.js.map +1 -1
- package/dist/CallRecording/constants.js +12 -27
- package/dist/CallRecording/constants.js.map +1 -1
- package/dist/CallRecording/types.js +21 -16
- package/dist/CallRecording/types.js.map +1 -1
- package/dist/CallRecording/userhub.js +117 -0
- package/dist/CallRecording/userhub.js.map +1 -0
- package/dist/CallRecording/utils.js +3 -3
- package/dist/CallRecording/utils.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +19 -13
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +383 -185
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +3 -1
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +12 -2
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +15 -8
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +617 -527
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/constants.js +5 -2
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +23 -2
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +87 -17
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +559 -411
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +646 -83
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js +26 -0
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Errors/types.js +2 -0
- package/dist/Errors/types.js.map +1 -1
- package/dist/Events/types.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/common/Utils.js +124 -105
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +346 -243
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/callUtils.js +187 -0
- package/dist/common/callUtils.js.map +1 -0
- package/dist/common/callUtils.test.js +313 -0
- package/dist/common/callUtils.test.js.map +1 -0
- package/dist/common/constants.js +27 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/index.js +11 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/testUtil.js +2 -1
- package/dist/common/testUtil.js.map +1 -1
- package/dist/mobius-socket/mobius-socket-events.test.js +1 -0
- package/dist/mobius-socket/mobius-socket-events.test.js.map +1 -1
- package/dist/mobius-socket/mobius-socket.test.js +12 -12
- package/dist/mobius-socket/mobius-socket.test.js.map +1 -1
- package/dist/mobius-socket/socket/socket-base.js +10 -0
- package/dist/mobius-socket/socket/socket-base.js.map +1 -1
- package/dist/mobius-socket/socket.test.js +34 -14
- package/dist/mobius-socket/socket.test.js.map +1 -1
- package/dist/module/CallRecording/WxcCallRecordingConnector.js +155 -63
- package/dist/module/CallRecording/callRecordingFixtures.js +38 -8
- package/dist/module/CallRecording/constants.js +11 -12
- package/dist/module/CallRecording/userhub.js +100 -0
- package/dist/module/CallingClient/CallingClient.js +12 -11
- package/dist/module/CallingClient/calling/CallerId/index.js +2 -2
- package/dist/module/CallingClient/calling/call.js +10 -3
- package/dist/module/CallingClient/constants.js +3 -0
- package/dist/module/CallingClient/line/index.js +9 -1
- package/dist/module/CallingClient/registration/register.js +69 -16
- package/dist/module/CallingClient/registration/types.js +5 -1
- package/dist/module/Errors/types.js +2 -0
- package/dist/module/common/Utils.js +43 -43
- package/dist/module/common/callUtils.js +90 -0
- package/dist/module/common/constants.js +11 -0
- package/dist/module/common/index.js +1 -0
- package/dist/module/common/testUtil.js +1 -0
- package/dist/module/mobius-socket/socket/socket-base.js +8 -0
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts +6 -2
- package/dist/types/CallRecording/WxcCallRecordingConnector.d.ts.map +1 -1
- package/dist/types/CallRecording/callRecordingFixtures.d.ts +95 -4
- package/dist/types/CallRecording/callRecordingFixtures.d.ts.map +1 -1
- package/dist/types/CallRecording/constants.d.ts +11 -12
- package/dist/types/CallRecording/constants.d.ts.map +1 -1
- package/dist/types/CallRecording/types.d.ts +11 -3
- package/dist/types/CallRecording/types.d.ts.map +1 -1
- package/dist/types/CallRecording/userhub.d.ts +44 -0
- package/dist/types/CallRecording/userhub.d.ts.map +1 -0
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +3 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +2 -1
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +3 -1
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +22 -0
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +2 -0
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Errors/types.d.ts +2 -0
- package/dist/types/Errors/types.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +1 -1
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +1 -0
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +4 -6
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/callUtils.d.ts +6 -0
- package/dist/types/common/callUtils.d.ts.map +1 -0
- package/dist/types/common/constants.d.ts +6 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/index.d.ts +1 -0
- package/dist/types/common/index.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/dist/types/mobius-socket/socket/socket-base.d.ts.map +1 -1
- package/package.json +12 -11
|
@@ -32,10 +32,12 @@ var _types = require("../../Metrics/types");
|
|
|
32
32
|
var _Metrics = require("../../Metrics");
|
|
33
33
|
var _calling = require("../calling");
|
|
34
34
|
var _Logger = _interopRequireDefault(require("../../Logger"));
|
|
35
|
+
var _types2 = require("./types");
|
|
35
36
|
var _SDKConnector = _interopRequireDefault(require("../../SDKConnector"));
|
|
36
|
-
var
|
|
37
|
+
var _types3 = require("../../common/types");
|
|
37
38
|
var _constants2 = require("../constants");
|
|
38
|
-
var
|
|
39
|
+
var _types4 = require("../line/types");
|
|
40
|
+
var _types5 = require("../../Errors/types");
|
|
39
41
|
var _request = require("../utils/request");
|
|
40
42
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && r[_Symbol$iterator] || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
41
43
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -75,17 +77,24 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
75
77
|
(0, _defineProperty2.default)(this, "retryAfter", void 0);
|
|
76
78
|
(0, _defineProperty2.default)(this, "scheduled429Retry", false);
|
|
77
79
|
(0, _defineProperty2.default)(this, "webWorker", void 0);
|
|
80
|
+
/**
|
|
81
|
+
* Set once Mobius reports this session as superseded by another registration for the
|
|
82
|
+
* same user. It survives cleanup so that no automatic recovery path re-registers this
|
|
83
|
+
* device, which would restart the registration ping-pong between the two sessions.
|
|
84
|
+
* Only an explicit `triggerRegistration()` from the consumer clears it.
|
|
85
|
+
*/
|
|
86
|
+
(0, _defineProperty2.default)(this, "sessionSuperseded", false);
|
|
78
87
|
(0, _defineProperty2.default)(this, "apiRequest", void 0);
|
|
79
88
|
this.jwe = jwe;
|
|
80
89
|
this.sdkConnector = _SDKConnector.default;
|
|
81
90
|
this.serviceData = serviceData;
|
|
82
|
-
this.isCCFlow = serviceData.indicator ===
|
|
91
|
+
this.isCCFlow = serviceData.indicator === _types3.ServiceIndicator.CONTACT_CENTER;
|
|
83
92
|
if (!this.sdkConnector.getWebex()) {
|
|
84
93
|
_SDKConnector.default.setWebex(webex);
|
|
85
94
|
}
|
|
86
95
|
this.webex = this.sdkConnector.getWebex();
|
|
87
96
|
this.userId = this.webex.internal.device.userId;
|
|
88
|
-
this.registrationStatus =
|
|
97
|
+
this.registrationStatus = _types3.RegistrationStatus.IDLE;
|
|
89
98
|
this.failback429RetryAttempts = 0;
|
|
90
99
|
_Logger.default.setLogger(logLevel, _constants2.REGISTRATION_FILE);
|
|
91
100
|
this.rehomingIntervalMin = _constants2.DEFAULT_REHOMING_INTERVAL_MIN;
|
|
@@ -235,9 +244,9 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
235
244
|
case 0:
|
|
236
245
|
requestObj = {
|
|
237
246
|
uri: "".concat(url).concat(_constants2.DEVICES_ENDPOINT_RESOURCE, "/").concat(deviceId),
|
|
238
|
-
method:
|
|
247
|
+
method: _types3.HTTP_METHODS.DELETE,
|
|
239
248
|
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, deviceUrl), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
|
|
240
|
-
service:
|
|
249
|
+
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
241
250
|
};
|
|
242
251
|
if (this.apiRequest.isSocketEnabled()) {
|
|
243
252
|
// @ts-ignore - body is added for mobius wss support, it is not used for mobius http
|
|
@@ -262,8 +271,8 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
262
271
|
_context2.next = 4;
|
|
263
272
|
return (0, _common.uploadLogs)();
|
|
264
273
|
case 4:
|
|
265
|
-
this.setStatus(
|
|
266
|
-
this.lineEmitter(
|
|
274
|
+
this.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
275
|
+
this.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
267
276
|
return _context2.abrupt("return", response);
|
|
268
277
|
case 5:
|
|
269
278
|
case "end":
|
|
@@ -285,23 +294,25 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
285
294
|
key: "postRegistration",
|
|
286
295
|
value: (function () {
|
|
287
296
|
var _postRegistration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(url) {
|
|
288
|
-
var deviceInfo;
|
|
297
|
+
var hostIps, deviceInfo;
|
|
289
298
|
return _regenerator.default.wrap(function (_context3) {
|
|
290
299
|
while (1) switch (_context3.prev = _context3.next) {
|
|
291
300
|
case 0:
|
|
301
|
+
hostIps = (0, _common.getHostIps)();
|
|
292
302
|
deviceInfo = {
|
|
293
303
|
userId: this.userId,
|
|
294
304
|
clientDeviceUri: this.webex.internal.device.url,
|
|
295
305
|
serviceData: this.jwe ? _objectSpread(_objectSpread({}, this.serviceData), {}, {
|
|
296
306
|
jwe: this.jwe
|
|
297
|
-
}) : this.serviceData
|
|
307
|
+
}) : this.serviceData,
|
|
308
|
+
hostIps: hostIps
|
|
298
309
|
};
|
|
299
310
|
return _context3.abrupt("return", this.apiRequest.makeRequest({
|
|
300
311
|
uri: "".concat(url, "device"),
|
|
301
|
-
method:
|
|
312
|
+
method: _types3.HTTP_METHODS.POST,
|
|
302
313
|
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, deviceInfo.clientDeviceUri), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
|
|
303
314
|
body: deviceInfo,
|
|
304
|
-
service:
|
|
315
|
+
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
305
316
|
}));
|
|
306
317
|
case 1:
|
|
307
318
|
case "end":
|
|
@@ -459,6 +470,67 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
459
470
|
}
|
|
460
471
|
return handle404KeepaliveFailure;
|
|
461
472
|
}()
|
|
473
|
+
/**
|
|
474
|
+
* Hard stops a calling session that Mobius reported as superseded, in response to a
|
|
475
|
+
* `409 Conflict` on a keepalive (device_status) message.
|
|
476
|
+
*
|
|
477
|
+
* Mobius returns 409 when this deviceId is gone but the same user still has an active
|
|
478
|
+
* registration elsewhere (typically calling opened in another browser tab, which
|
|
479
|
+
* superseded this device). Re-registering here would unregister the other device and
|
|
480
|
+
* restart the registration ping-pong between the two, so no registration is attempted:
|
|
481
|
+
* the keepalive worker is terminated, the Mobius WebSocket is closed and the consumer
|
|
482
|
+
* receives `LINE_EVENTS.UNREGISTERED` carrying `lineError` as the reason.
|
|
483
|
+
*
|
|
484
|
+
* @param lineError - Superseded-session error built by `handleRegistrationErrors`.
|
|
485
|
+
* @param error - The keepalive failure payload forwarded by the keepalive worker.
|
|
486
|
+
* @param serverType - Mobius server type the keepalive was sent to, for metrics.
|
|
487
|
+
* @param keepaliveRetryCount - Consecutive keepalive failures reported by the worker.
|
|
488
|
+
*/
|
|
489
|
+
)
|
|
490
|
+
}, {
|
|
491
|
+
key: "handle409KeepaliveFailure",
|
|
492
|
+
value: (function () {
|
|
493
|
+
var _handle409KeepaliveFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7(lineError, error, serverType, keepaliveRetryCount) {
|
|
494
|
+
var _error$headers$tracki, _error$headers;
|
|
495
|
+
var loggerContext;
|
|
496
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
497
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
498
|
+
case 0:
|
|
499
|
+
loggerContext = {
|
|
500
|
+
file: _constants2.REGISTRATION_FILE,
|
|
501
|
+
method: _constants2.METHODS.HANDLE_409_KEEPALIVE_FAILURE
|
|
502
|
+
};
|
|
503
|
+
/*
|
|
504
|
+
* Latch the terminal state before anything that can yield. Cleanup runs under the
|
|
505
|
+
* shared mutex, so it can be queued behind a recovery that is already registering;
|
|
506
|
+
* latching here means every registration path that has not started yet sees the
|
|
507
|
+
* superseded state rather than racing this cleanup.
|
|
508
|
+
*/
|
|
509
|
+
this.sessionSuperseded = true;
|
|
510
|
+
_Logger.default.warn("Stopping keepalive without re-registration, session superseded by another device for this user - keepaliveRetryCount: ".concat(keepaliveRetryCount), loggerContext);
|
|
511
|
+
|
|
512
|
+
/* Stop the keepalive worker up front so no further keepalive is sent while cleanup waits on the mutex. */
|
|
513
|
+
this.clearKeepaliveTimer();
|
|
514
|
+
this.metricManager.submitRegistrationMetric(_types.METRIC_EVENT.KEEPALIVE_ERROR, _types.REG_ACTION.KEEPALIVE_FAILURE, _types.METRIC_TYPE.BEHAVIORAL, _constants2.METHODS.HANDLE_409_KEEPALIVE_FAILURE, serverType, (_error$headers$tracki = (_error$headers = error.headers) === null || _error$headers === void 0 ? void 0 : _error$headers.trackingid) !== null && _error$headers$tracki !== void 0 ? _error$headers$tracki : '', keepaliveRetryCount, lineError);
|
|
515
|
+
_context7.next = 1;
|
|
516
|
+
return this.registrationCleanup(_constants2.METHODS.HANDLE_409_KEEPALIVE_FAILURE, {
|
|
517
|
+
reason: _types2.HARD_STOP_REASON.SESSION_SUPERSEDED,
|
|
518
|
+
error: lineError
|
|
519
|
+
});
|
|
520
|
+
case 1:
|
|
521
|
+
_context7.next = 2;
|
|
522
|
+
return (0, _common.uploadLogs)();
|
|
523
|
+
case 2:
|
|
524
|
+
case "end":
|
|
525
|
+
return _context7.stop();
|
|
526
|
+
}
|
|
527
|
+
}, _callee7, this);
|
|
528
|
+
}));
|
|
529
|
+
function handle409KeepaliveFailure(_x7, _x8, _x9, _x0) {
|
|
530
|
+
return _handle409KeepaliveFailure.apply(this, arguments);
|
|
531
|
+
}
|
|
532
|
+
return handle409KeepaliveFailure;
|
|
533
|
+
}()
|
|
462
534
|
/**
|
|
463
535
|
* Callback for handling 429 retry response from the server
|
|
464
536
|
*/
|
|
@@ -466,21 +538,21 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
466
538
|
}, {
|
|
467
539
|
key: "handle429Retry",
|
|
468
540
|
value: (function () {
|
|
469
|
-
var _handle429Retry = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
541
|
+
var _handle429Retry = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9(retryAfter, caller) {
|
|
470
542
|
var _this2 = this;
|
|
471
543
|
var interval, abort;
|
|
472
|
-
return _regenerator.default.wrap(function (
|
|
473
|
-
while (1) switch (
|
|
544
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
545
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
474
546
|
case 0:
|
|
475
547
|
if (!(caller === _constants2.FAILBACK_UTIL)) {
|
|
476
|
-
|
|
548
|
+
_context9.next = 4;
|
|
477
549
|
break;
|
|
478
550
|
}
|
|
479
551
|
if (!(this.failback429RetryAttempts >= _constants2.REG_FAILBACK_429_MAX_RETRIES)) {
|
|
480
|
-
|
|
552
|
+
_context9.next = 1;
|
|
481
553
|
break;
|
|
482
554
|
}
|
|
483
|
-
return
|
|
555
|
+
return _context9.abrupt("return");
|
|
484
556
|
case 1:
|
|
485
557
|
this.clearFailbackTimer();
|
|
486
558
|
this.failback429RetryAttempts += 1;
|
|
@@ -491,26 +563,26 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
491
563
|
interval = this.getRegRetryInterval(this.failback429RetryAttempts);
|
|
492
564
|
this.startFailbackTimer(interval);
|
|
493
565
|
this.scheduled429Retry = true;
|
|
494
|
-
|
|
566
|
+
_context9.next = 2;
|
|
495
567
|
return this.restorePreviousRegistration(_constants2.REG_429_RETRY_UTIL);
|
|
496
568
|
case 2:
|
|
497
|
-
abort =
|
|
569
|
+
abort = _context9.sent;
|
|
498
570
|
if (!(!abort && !this.isDeviceRegistered())) {
|
|
499
|
-
|
|
571
|
+
_context9.next = 3;
|
|
500
572
|
break;
|
|
501
573
|
}
|
|
502
|
-
|
|
574
|
+
_context9.next = 3;
|
|
503
575
|
return this.restartRegistration(_constants2.REG_429_RETRY_UTIL);
|
|
504
576
|
case 3:
|
|
505
|
-
|
|
577
|
+
_context9.next = 5;
|
|
506
578
|
break;
|
|
507
579
|
case 4:
|
|
508
580
|
if (caller === _constants2.KEEPALIVE_UTIL) {
|
|
509
581
|
this.clearKeepaliveTimer();
|
|
510
|
-
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
582
|
+
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
511
583
|
var _this2$deviceInfo$dev;
|
|
512
|
-
return _regenerator.default.wrap(function (
|
|
513
|
-
while (1) switch (
|
|
584
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
585
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
514
586
|
case 0:
|
|
515
587
|
_Logger.default.log("Resuming keepalive after ".concat(retryAfter, " seconds"), {
|
|
516
588
|
file: _constants2.REGISTRATION_FILE,
|
|
@@ -518,24 +590,24 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
518
590
|
});
|
|
519
591
|
|
|
520
592
|
// Resume the keepalive after waiting for the retry after period
|
|
521
|
-
|
|
593
|
+
_context8.next = 1;
|
|
522
594
|
return _this2.startKeepaliveTimer((_this2$deviceInfo$dev = _this2.deviceInfo.device) === null || _this2$deviceInfo$dev === void 0 ? void 0 : _this2$deviceInfo$dev.uri, _this2.deviceInfo.keepaliveInterval, 'UNKNOWN');
|
|
523
595
|
case 1:
|
|
524
596
|
case "end":
|
|
525
|
-
return
|
|
597
|
+
return _context8.stop();
|
|
526
598
|
}
|
|
527
|
-
},
|
|
599
|
+
}, _callee8);
|
|
528
600
|
})), (retryAfter - Number(this.deviceInfo.keepaliveInterval || 0)) * 1000);
|
|
529
601
|
} else {
|
|
530
602
|
this.retryAfter = retryAfter;
|
|
531
603
|
}
|
|
532
604
|
case 5:
|
|
533
605
|
case "end":
|
|
534
|
-
return
|
|
606
|
+
return _context9.stop();
|
|
535
607
|
}
|
|
536
|
-
},
|
|
608
|
+
}, _callee9, this);
|
|
537
609
|
}));
|
|
538
|
-
function handle429Retry(
|
|
610
|
+
function handle429Retry(_x1, _x10) {
|
|
539
611
|
return _handle429Retry.apply(this, arguments);
|
|
540
612
|
}
|
|
541
613
|
return handle429Retry;
|
|
@@ -564,7 +636,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
564
636
|
}, {
|
|
565
637
|
key: "startFailoverTimer",
|
|
566
638
|
value: (function () {
|
|
567
|
-
var _startFailoverTimer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
639
|
+
var _startFailoverTimer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
568
640
|
var _this3 = this;
|
|
569
641
|
var attempt,
|
|
570
642
|
timeElapsed,
|
|
@@ -574,12 +646,12 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
574
646
|
excessVal,
|
|
575
647
|
abort,
|
|
576
648
|
scheduledTime,
|
|
577
|
-
|
|
578
|
-
return _regenerator.default.wrap(function (
|
|
579
|
-
while (1) switch (
|
|
649
|
+
_args12 = arguments;
|
|
650
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
651
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
580
652
|
case 0:
|
|
581
|
-
attempt =
|
|
582
|
-
timeElapsed =
|
|
653
|
+
attempt = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : 1;
|
|
654
|
+
timeElapsed = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : 0;
|
|
583
655
|
loggerContext = {
|
|
584
656
|
file: _constants2.REGISTRATION_FILE,
|
|
585
657
|
method: _constants2.FAILOVER_UTIL
|
|
@@ -594,7 +666,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
594
666
|
this.failoverImmediately = this.retryAfter + timeElapsed > TIMER_THRESHOLD;
|
|
595
667
|
}
|
|
596
668
|
if (!(interval > _constants2.BASE_REG_RETRY_TIMER_VAL_IN_SEC && !this.failoverImmediately)) {
|
|
597
|
-
|
|
669
|
+
_context12.next = 1;
|
|
598
670
|
break;
|
|
599
671
|
}
|
|
600
672
|
scheduledTime = Math.floor((0, _now.default)() / 1000);
|
|
@@ -607,53 +679,53 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
607
679
|
retryScheduledTime: scheduledTime,
|
|
608
680
|
serverType: 'primary'
|
|
609
681
|
});
|
|
610
|
-
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
611
|
-
return _regenerator.default.wrap(function (
|
|
612
|
-
while (1) switch (
|
|
682
|
+
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
683
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
684
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
613
685
|
case 0:
|
|
614
|
-
|
|
615
|
-
return _this3.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
686
|
+
_context1.next = 1;
|
|
687
|
+
return _this3.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
616
688
|
var currentTime;
|
|
617
|
-
return _regenerator.default.wrap(function (
|
|
618
|
-
while (1) switch (
|
|
689
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
690
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
619
691
|
case 0:
|
|
620
|
-
|
|
692
|
+
_context0.next = 1;
|
|
621
693
|
return _this3.attemptRegistrationWithServers(_constants2.FAILOVER_UTIL);
|
|
622
694
|
case 1:
|
|
623
|
-
abort =
|
|
695
|
+
abort = _context0.sent;
|
|
624
696
|
currentTime = Math.floor((0, _now.default)() / 1000);
|
|
625
697
|
if (!(!abort && !_this3.isDeviceRegistered())) {
|
|
626
|
-
|
|
698
|
+
_context0.next = 2;
|
|
627
699
|
break;
|
|
628
700
|
}
|
|
629
|
-
|
|
701
|
+
_context0.next = 2;
|
|
630
702
|
return _this3.startFailoverTimer(attempt + 1, timeElapsed + (currentTime - scheduledTime));
|
|
631
703
|
case 2:
|
|
632
704
|
case "end":
|
|
633
|
-
return
|
|
705
|
+
return _context0.stop();
|
|
634
706
|
}
|
|
635
|
-
},
|
|
707
|
+
}, _callee0);
|
|
636
708
|
})));
|
|
637
709
|
case 1:
|
|
638
710
|
case "end":
|
|
639
|
-
return
|
|
711
|
+
return _context1.stop();
|
|
640
712
|
}
|
|
641
|
-
},
|
|
713
|
+
}, _callee1);
|
|
642
714
|
})), interval * _constants2.SEC_TO_MSEC_MFACTOR);
|
|
643
715
|
_Logger.default.log("Scheduled retry with primary in ".concat(interval, " seconds, number of attempts : ").concat(attempt), loggerContext);
|
|
644
|
-
|
|
716
|
+
_context12.next = 7;
|
|
645
717
|
break;
|
|
646
718
|
case 1:
|
|
647
719
|
if (!this.backupMobiusUris.length) {
|
|
648
|
-
|
|
720
|
+
_context12.next = 5;
|
|
649
721
|
break;
|
|
650
722
|
}
|
|
651
723
|
if (!this.apiRequest.isSocketEnabled()) {
|
|
652
|
-
|
|
724
|
+
_context12.next = 3;
|
|
653
725
|
break;
|
|
654
726
|
}
|
|
655
727
|
_Logger.default.info('Disconnecting from primary Mobius socket for failover to backup servers', loggerContext);
|
|
656
|
-
|
|
728
|
+
_context12.next = 2;
|
|
657
729
|
return this.apiRequest.disconnectFromMobiusSocket({
|
|
658
730
|
code: 3050,
|
|
659
731
|
reason: 'done (permanent)'
|
|
@@ -669,66 +741,66 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
669
741
|
});
|
|
670
742
|
_Logger.default.info('Failing over to backup servers.', loggerContext);
|
|
671
743
|
this.failoverImmediately = false;
|
|
672
|
-
|
|
744
|
+
_context12.next = 4;
|
|
673
745
|
return this.attemptRegistrationWithServers(_constants2.FAILOVER_UTIL, this.backupMobiusUris);
|
|
674
746
|
case 4:
|
|
675
|
-
abort =
|
|
747
|
+
abort = _context12.sent;
|
|
676
748
|
if (!abort && !this.isDeviceRegistered()) {
|
|
677
749
|
interval = this.getRegRetryInterval();
|
|
678
750
|
if (this.retryAfter != null && this.retryAfter < _constants2.RETRY_TIMER_UPPER_LIMIT) {
|
|
679
751
|
interval = interval < this.retryAfter ? this.retryAfter : interval;
|
|
680
752
|
}
|
|
681
|
-
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
682
|
-
return _regenerator.default.wrap(function (
|
|
683
|
-
while (1) switch (
|
|
753
|
+
setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
754
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
755
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
684
756
|
case 0:
|
|
685
|
-
|
|
686
|
-
return _this3.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
687
|
-
return _regenerator.default.wrap(function (
|
|
688
|
-
while (1) switch (
|
|
757
|
+
_context11.next = 1;
|
|
758
|
+
return _this3.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
759
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
760
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
689
761
|
case 0:
|
|
690
|
-
|
|
762
|
+
_context10.next = 1;
|
|
691
763
|
return _this3.attemptRegistrationWithServers(_constants2.FAILOVER_UTIL, _this3.backupMobiusUris);
|
|
692
764
|
case 1:
|
|
693
|
-
abort =
|
|
765
|
+
abort = _context10.sent;
|
|
694
766
|
if (!(!abort && !_this3.isDeviceRegistered())) {
|
|
695
|
-
|
|
767
|
+
_context10.next = 3;
|
|
696
768
|
break;
|
|
697
769
|
}
|
|
698
|
-
|
|
770
|
+
_context10.next = 2;
|
|
699
771
|
return (0, _common.uploadLogs)();
|
|
700
772
|
case 2:
|
|
701
773
|
(0, _common.emitFinalFailure)(function (clientError) {
|
|
702
|
-
_this3.lineEmitter(
|
|
774
|
+
_this3.lineEmitter(_types4.LINE_EVENTS.ERROR, undefined, clientError);
|
|
703
775
|
}, loggerContext);
|
|
704
776
|
case 3:
|
|
705
777
|
case "end":
|
|
706
|
-
return
|
|
778
|
+
return _context10.stop();
|
|
707
779
|
}
|
|
708
|
-
},
|
|
780
|
+
}, _callee10);
|
|
709
781
|
})));
|
|
710
782
|
case 1:
|
|
711
783
|
case "end":
|
|
712
|
-
return
|
|
784
|
+
return _context11.stop();
|
|
713
785
|
}
|
|
714
|
-
},
|
|
786
|
+
}, _callee11);
|
|
715
787
|
})), interval * _constants2.SEC_TO_MSEC_MFACTOR);
|
|
716
788
|
_Logger.default.log("Scheduled retry with backup servers in ".concat(interval, " seconds."), loggerContext);
|
|
717
789
|
}
|
|
718
|
-
|
|
790
|
+
_context12.next = 7;
|
|
719
791
|
break;
|
|
720
792
|
case 5:
|
|
721
|
-
|
|
793
|
+
_context12.next = 6;
|
|
722
794
|
return (0, _common.uploadLogs)();
|
|
723
795
|
case 6:
|
|
724
796
|
(0, _common.emitFinalFailure)(function (clientError) {
|
|
725
|
-
_this3.lineEmitter(
|
|
797
|
+
_this3.lineEmitter(_types4.LINE_EVENTS.ERROR, undefined, clientError);
|
|
726
798
|
}, loggerContext, interval < 0 ? 'Timer threshold exceeded during failover' : undefined);
|
|
727
799
|
case 7:
|
|
728
800
|
case "end":
|
|
729
|
-
return
|
|
801
|
+
return _context12.stop();
|
|
730
802
|
}
|
|
731
|
-
},
|
|
803
|
+
}, _callee12, this);
|
|
732
804
|
}));
|
|
733
805
|
function startFailoverTimer() {
|
|
734
806
|
return _startFailoverTimer.apply(this, arguments);
|
|
@@ -750,27 +822,27 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
750
822
|
}, {
|
|
751
823
|
key: "postKeepAlive",
|
|
752
824
|
value: function () {
|
|
753
|
-
var _postKeepAlive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
825
|
+
var _postKeepAlive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(deviceUrl, url) {
|
|
754
826
|
var _this$deviceInfo$devi;
|
|
755
|
-
return _regenerator.default.wrap(function (
|
|
756
|
-
while (1) switch (
|
|
827
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
828
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
757
829
|
case 0:
|
|
758
|
-
return
|
|
830
|
+
return _context13.abrupt("return", this.apiRequest.makeRequest({
|
|
759
831
|
uri: "".concat(url, "/status"),
|
|
760
|
-
method:
|
|
832
|
+
method: _types3.HTTP_METHODS.POST,
|
|
761
833
|
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, deviceUrl), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
|
|
762
834
|
body: {
|
|
763
835
|
deviceId: (_this$deviceInfo$devi = this.deviceInfo.device) === null || _this$deviceInfo$devi === void 0 ? void 0 : _this$deviceInfo$devi.deviceId
|
|
764
836
|
},
|
|
765
|
-
service:
|
|
837
|
+
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
766
838
|
}));
|
|
767
839
|
case 1:
|
|
768
840
|
case "end":
|
|
769
|
-
return
|
|
841
|
+
return _context13.stop();
|
|
770
842
|
}
|
|
771
|
-
},
|
|
843
|
+
}, _callee13, this);
|
|
772
844
|
}));
|
|
773
|
-
function postKeepAlive(
|
|
845
|
+
function postKeepAlive(_x11, _x12) {
|
|
774
846
|
return _postKeepAlive.apply(this, arguments);
|
|
775
847
|
}
|
|
776
848
|
return postKeepAlive;
|
|
@@ -778,34 +850,34 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
778
850
|
}, {
|
|
779
851
|
key: "isPrimaryActive",
|
|
780
852
|
value: function () {
|
|
781
|
-
var _isPrimaryActive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
853
|
+
var _isPrimaryActive = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
782
854
|
var status, _iterator, _step, mobiusUrl, baseUri, response, _ref7, statusCode, _t3, _t4;
|
|
783
|
-
return _regenerator.default.wrap(function (
|
|
784
|
-
while (1) switch (
|
|
855
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
856
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
785
857
|
case 0:
|
|
786
858
|
_iterator = _createForOfIteratorHelper(this.primaryMobiusUris);
|
|
787
|
-
|
|
859
|
+
_context14.prev = 1;
|
|
788
860
|
_iterator.s();
|
|
789
861
|
case 2:
|
|
790
862
|
if ((_step = _iterator.n()).done) {
|
|
791
|
-
|
|
863
|
+
_context14.next = 8;
|
|
792
864
|
break;
|
|
793
865
|
}
|
|
794
866
|
mobiusUrl = _step.value;
|
|
795
|
-
|
|
867
|
+
_context14.prev = 3;
|
|
796
868
|
baseUri = mobiusUrl.replace(_constants2.URL_ENDPOINT, '/').replace('wss://', 'https://'); // eslint-disable-next-line no-await-in-loop
|
|
797
|
-
|
|
869
|
+
_context14.next = 4;
|
|
798
870
|
return this.webex.request({
|
|
799
871
|
uri: "".concat(baseUri, "ping"),
|
|
800
|
-
method:
|
|
872
|
+
method: _types3.HTTP_METHODS.GET,
|
|
801
873
|
headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants2.CISCO_DEVICE_URL, this.webex.internal.device.url), _constants2.SPARK_USER_AGENT, _constants2.CALLING_USER_AGENT),
|
|
802
|
-
service:
|
|
874
|
+
service: _types3.ALLOWED_SERVICES.MOBIUS
|
|
803
875
|
});
|
|
804
876
|
case 4:
|
|
805
|
-
response =
|
|
877
|
+
response = _context14.sent;
|
|
806
878
|
_ref7 = response, statusCode = _ref7.statusCode;
|
|
807
879
|
if (!(statusCode === 200)) {
|
|
808
|
-
|
|
880
|
+
_context14.next = 5;
|
|
809
881
|
break;
|
|
810
882
|
}
|
|
811
883
|
_Logger.default.info("Ping successful for primary Mobius: ".concat(mobiusUrl), {
|
|
@@ -813,39 +885,39 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
813
885
|
method: _constants2.FAILBACK_UTIL
|
|
814
886
|
});
|
|
815
887
|
status = 'up';
|
|
816
|
-
return
|
|
888
|
+
return _context14.abrupt("continue", 8);
|
|
817
889
|
case 5:
|
|
818
|
-
|
|
890
|
+
_context14.next = 7;
|
|
819
891
|
break;
|
|
820
892
|
case 6:
|
|
821
|
-
|
|
822
|
-
_t3 =
|
|
893
|
+
_context14.prev = 6;
|
|
894
|
+
_t3 = _context14["catch"](3);
|
|
823
895
|
_Logger.default.warn("Ping failed for primary Mobius: ".concat(mobiusUrl, " with error: ").concat((0, _stringify.default)(_t3)), {
|
|
824
896
|
file: _constants2.REGISTRATION_FILE,
|
|
825
897
|
method: _constants2.FAILBACK_UTIL
|
|
826
898
|
});
|
|
827
899
|
status = 'down';
|
|
828
900
|
case 7:
|
|
829
|
-
|
|
901
|
+
_context14.next = 2;
|
|
830
902
|
break;
|
|
831
903
|
case 8:
|
|
832
|
-
|
|
904
|
+
_context14.next = 10;
|
|
833
905
|
break;
|
|
834
906
|
case 9:
|
|
835
|
-
|
|
836
|
-
_t4 =
|
|
907
|
+
_context14.prev = 9;
|
|
908
|
+
_t4 = _context14["catch"](1);
|
|
837
909
|
_iterator.e(_t4);
|
|
838
910
|
case 10:
|
|
839
|
-
|
|
911
|
+
_context14.prev = 10;
|
|
840
912
|
_iterator.f();
|
|
841
|
-
return
|
|
913
|
+
return _context14.finish(10);
|
|
842
914
|
case 11:
|
|
843
|
-
return
|
|
915
|
+
return _context14.abrupt("return", status === 'up');
|
|
844
916
|
case 12:
|
|
845
917
|
case "end":
|
|
846
|
-
return
|
|
918
|
+
return _context14.stop();
|
|
847
919
|
}
|
|
848
|
-
},
|
|
920
|
+
}, _callee14, this, [[1, 9, 10, 11], [3, 6]]);
|
|
849
921
|
}));
|
|
850
922
|
function isPrimaryActive() {
|
|
851
923
|
return _isPrimaryActive.apply(this, arguments);
|
|
@@ -906,16 +978,16 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
906
978
|
key: "startFailbackTimer",
|
|
907
979
|
value: function startFailbackTimer(intervalInSeconds) {
|
|
908
980
|
var _this4 = this;
|
|
909
|
-
this.failbackTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
910
|
-
return _regenerator.default.wrap(function (
|
|
911
|
-
while (1) switch (
|
|
981
|
+
this.failbackTimer = setTimeout(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
982
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
983
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
912
984
|
case 0:
|
|
913
|
-
return
|
|
985
|
+
return _context15.abrupt("return", _this4.executeFailback());
|
|
914
986
|
case 1:
|
|
915
987
|
case "end":
|
|
916
|
-
return
|
|
988
|
+
return _context15.stop();
|
|
917
989
|
}
|
|
918
|
-
},
|
|
990
|
+
}, _callee15);
|
|
919
991
|
})), intervalInSeconds * _constants2.SEC_TO_MSEC_MFACTOR);
|
|
920
992
|
_Logger.default.log("Failback scheduled after ".concat(intervalInSeconds, " seconds."), {
|
|
921
993
|
file: _constants2.REGISTRATION_FILE,
|
|
@@ -930,45 +1002,45 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
930
1002
|
}, {
|
|
931
1003
|
key: "executeFailback",
|
|
932
1004
|
value: (function () {
|
|
933
|
-
var _executeFailback = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1005
|
+
var _executeFailback = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
934
1006
|
var _this5 = this;
|
|
935
1007
|
var loggerContext;
|
|
936
|
-
return _regenerator.default.wrap(function (
|
|
937
|
-
while (1) switch (
|
|
1008
|
+
return _regenerator.default.wrap(function (_context17) {
|
|
1009
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
938
1010
|
case 0:
|
|
939
1011
|
loggerContext = {
|
|
940
1012
|
file: _constants2.REGISTRATION_FILE,
|
|
941
1013
|
method: _constants2.METHODS.EXECUTE_FAILBACK
|
|
942
1014
|
};
|
|
943
1015
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, loggerContext);
|
|
944
|
-
|
|
945
|
-
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1016
|
+
_context17.next = 1;
|
|
1017
|
+
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
946
1018
|
var primaryServerStatus, abort, abortNew;
|
|
947
|
-
return _regenerator.default.wrap(function (
|
|
948
|
-
while (1) switch (
|
|
1019
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1020
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
949
1021
|
case 0:
|
|
950
1022
|
if (!_this5.isFailbackRequired()) {
|
|
951
|
-
|
|
1023
|
+
_context16.next = 13;
|
|
952
1024
|
break;
|
|
953
1025
|
}
|
|
954
|
-
|
|
1026
|
+
_context16.next = 1;
|
|
955
1027
|
return _this5.isPrimaryActive();
|
|
956
1028
|
case 1:
|
|
957
|
-
primaryServerStatus =
|
|
1029
|
+
primaryServerStatus = _context16.sent;
|
|
958
1030
|
if (!((0, _keys.default)(_this5.callManager.getActiveCalls()).length === 0 && primaryServerStatus)) {
|
|
959
|
-
|
|
1031
|
+
_context16.next = 12;
|
|
960
1032
|
break;
|
|
961
1033
|
}
|
|
962
1034
|
_Logger.default.info("Attempting failback to primary.", loggerContext);
|
|
963
|
-
|
|
1035
|
+
_context16.next = 2;
|
|
964
1036
|
return _this5.deregister();
|
|
965
1037
|
case 2:
|
|
966
1038
|
if (!_this5.apiRequest.isSocketEnabled()) {
|
|
967
|
-
|
|
1039
|
+
_context16.next = 4;
|
|
968
1040
|
break;
|
|
969
1041
|
}
|
|
970
1042
|
_Logger.default.info('Disconnecting from backup Mobius socket for failback to primary', loggerContext);
|
|
971
|
-
|
|
1043
|
+
_context16.next = 3;
|
|
972
1044
|
return _this5.apiRequest.disconnectFromMobiusSocket({
|
|
973
1045
|
code: 3050,
|
|
974
1046
|
reason: 'done (permanent)'
|
|
@@ -976,41 +1048,41 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
976
1048
|
case 3:
|
|
977
1049
|
_Logger.default.log('Mobius socket disconnect complete prior to primary failback', loggerContext);
|
|
978
1050
|
case 4:
|
|
979
|
-
|
|
1051
|
+
_context16.next = 5;
|
|
980
1052
|
return _this5.attemptRegistrationWithServers(_constants2.FAILBACK_UTIL);
|
|
981
1053
|
case 5:
|
|
982
|
-
abort =
|
|
1054
|
+
abort = _context16.sent;
|
|
983
1055
|
if (!(_this5.scheduled429Retry || abort || _this5.isDeviceRegistered())) {
|
|
984
|
-
|
|
1056
|
+
_context16.next = 6;
|
|
985
1057
|
break;
|
|
986
1058
|
}
|
|
987
|
-
return
|
|
1059
|
+
return _context16.abrupt("return");
|
|
988
1060
|
case 6:
|
|
989
|
-
|
|
1061
|
+
_context16.next = 7;
|
|
990
1062
|
return _this5.restorePreviousRegistration(_constants2.FAILBACK_UTIL);
|
|
991
1063
|
case 7:
|
|
992
|
-
abortNew =
|
|
1064
|
+
abortNew = _context16.sent;
|
|
993
1065
|
if (!abortNew) {
|
|
994
|
-
|
|
1066
|
+
_context16.next = 8;
|
|
995
1067
|
break;
|
|
996
1068
|
}
|
|
997
1069
|
_this5.clearFailbackTimer();
|
|
998
|
-
return
|
|
1070
|
+
return _context16.abrupt("return");
|
|
999
1071
|
case 8:
|
|
1000
1072
|
if (_this5.isDeviceRegistered()) {
|
|
1001
|
-
|
|
1073
|
+
_context16.next = 10;
|
|
1002
1074
|
break;
|
|
1003
1075
|
}
|
|
1004
|
-
|
|
1076
|
+
_context16.next = 9;
|
|
1005
1077
|
return _this5.restartRegistration(loggerContext.method);
|
|
1006
1078
|
case 9:
|
|
1007
|
-
|
|
1079
|
+
_context16.next = 11;
|
|
1008
1080
|
break;
|
|
1009
1081
|
case 10:
|
|
1010
1082
|
_this5.failbackTimer = undefined;
|
|
1011
1083
|
_this5.initiateFailback();
|
|
1012
1084
|
case 11:
|
|
1013
|
-
|
|
1085
|
+
_context16.next = 13;
|
|
1014
1086
|
break;
|
|
1015
1087
|
case 12:
|
|
1016
1088
|
_Logger.default.info('Active calls present or primary Mobius is down, deferring failback to next cycle.', loggerContext);
|
|
@@ -1018,15 +1090,15 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1018
1090
|
_this5.initiateFailback();
|
|
1019
1091
|
case 13:
|
|
1020
1092
|
case "end":
|
|
1021
|
-
return
|
|
1093
|
+
return _context16.stop();
|
|
1022
1094
|
}
|
|
1023
|
-
},
|
|
1095
|
+
}, _callee16);
|
|
1024
1096
|
})));
|
|
1025
1097
|
case 1:
|
|
1026
1098
|
case "end":
|
|
1027
|
-
return
|
|
1099
|
+
return _context17.stop();
|
|
1028
1100
|
}
|
|
1029
|
-
},
|
|
1101
|
+
}, _callee17, this);
|
|
1030
1102
|
}));
|
|
1031
1103
|
function executeFailback() {
|
|
1032
1104
|
return _executeFailback.apply(this, arguments);
|
|
@@ -1068,7 +1140,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1068
1140
|
}, {
|
|
1069
1141
|
key: "isDeviceRegistered",
|
|
1070
1142
|
value: function isDeviceRegistered() {
|
|
1071
|
-
return this.registrationStatus ===
|
|
1143
|
+
return this.registrationStatus === _types3.RegistrationStatus.ACTIVE;
|
|
1072
1144
|
}
|
|
1073
1145
|
}, {
|
|
1074
1146
|
key: "getStatus",
|
|
@@ -1089,10 +1161,10 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1089
1161
|
}, {
|
|
1090
1162
|
key: "restartRegistration",
|
|
1091
1163
|
value: (function () {
|
|
1092
|
-
var _restartRegistration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1164
|
+
var _restartRegistration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18(caller) {
|
|
1093
1165
|
var loggerContext, abort;
|
|
1094
|
-
return _regenerator.default.wrap(function (
|
|
1095
|
-
while (1) switch (
|
|
1166
|
+
return _regenerator.default.wrap(function (_context18) {
|
|
1167
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1096
1168
|
case 0:
|
|
1097
1169
|
loggerContext = {
|
|
1098
1170
|
file: _constants2.REGISTRATION_FILE,
|
|
@@ -1106,25 +1178,25 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1106
1178
|
*/
|
|
1107
1179
|
this.clearFailbackTimer();
|
|
1108
1180
|
this.failback429RetryAttempts = 0;
|
|
1109
|
-
|
|
1181
|
+
_context18.next = 1;
|
|
1110
1182
|
return this.attemptRegistrationWithServers(caller, this.primaryMobiusUris);
|
|
1111
1183
|
case 1:
|
|
1112
|
-
abort =
|
|
1184
|
+
abort = _context18.sent;
|
|
1113
1185
|
if (!(!abort && !this.isDeviceRegistered())) {
|
|
1114
|
-
|
|
1186
|
+
_context18.next = 2;
|
|
1115
1187
|
break;
|
|
1116
1188
|
}
|
|
1117
|
-
|
|
1189
|
+
_context18.next = 2;
|
|
1118
1190
|
return this.startFailoverTimer();
|
|
1119
1191
|
case 2:
|
|
1120
1192
|
_Logger.default.log("restartRegistration completed - caller: ".concat(caller, ", deviceRegistered: ").concat(this.isDeviceRegistered(), ", abort: ").concat(abort), loggerContext);
|
|
1121
1193
|
case 3:
|
|
1122
1194
|
case "end":
|
|
1123
|
-
return
|
|
1195
|
+
return _context18.stop();
|
|
1124
1196
|
}
|
|
1125
|
-
},
|
|
1197
|
+
}, _callee18, this);
|
|
1126
1198
|
}));
|
|
1127
|
-
function restartRegistration(
|
|
1199
|
+
function restartRegistration(_x13) {
|
|
1128
1200
|
return _restartRegistration.apply(this, arguments);
|
|
1129
1201
|
}
|
|
1130
1202
|
return restartRegistration;
|
|
@@ -1138,23 +1210,23 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1138
1210
|
}, {
|
|
1139
1211
|
key: "handleConnectionRestoration",
|
|
1140
1212
|
value: (function () {
|
|
1141
|
-
var _handleConnectionRestoration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1213
|
+
var _handleConnectionRestoration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20(retry) {
|
|
1142
1214
|
var _this6 = this;
|
|
1143
|
-
return _regenerator.default.wrap(function (
|
|
1144
|
-
while (1) switch (
|
|
1215
|
+
return _regenerator.default.wrap(function (_context20) {
|
|
1216
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1145
1217
|
case 0:
|
|
1146
1218
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
1147
1219
|
method: _constants2.METHODS.HANDLE_CONNECTION_RESTORATION,
|
|
1148
1220
|
file: _constants2.REGISTRATION_FILE
|
|
1149
1221
|
});
|
|
1150
|
-
|
|
1151
|
-
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1222
|
+
_context20.next = 1;
|
|
1223
|
+
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
|
|
1152
1224
|
var abort;
|
|
1153
|
-
return _regenerator.default.wrap(function (
|
|
1154
|
-
while (1) switch (
|
|
1225
|
+
return _regenerator.default.wrap(function (_context19) {
|
|
1226
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1155
1227
|
case 0:
|
|
1156
1228
|
if (!retry) {
|
|
1157
|
-
|
|
1229
|
+
_context19.next = 4;
|
|
1158
1230
|
break;
|
|
1159
1231
|
}
|
|
1160
1232
|
_Logger.default.log('Network is up again, re-registering with Webex Calling if needed', {
|
|
@@ -1163,43 +1235,43 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1163
1235
|
});
|
|
1164
1236
|
_this6.clearKeepaliveTimer();
|
|
1165
1237
|
if (!_this6.isDeviceRegistered()) {
|
|
1166
|
-
|
|
1238
|
+
_context19.next = 1;
|
|
1167
1239
|
break;
|
|
1168
1240
|
}
|
|
1169
|
-
|
|
1241
|
+
_context19.next = 1;
|
|
1170
1242
|
return _this6.deregister();
|
|
1171
1243
|
case 1:
|
|
1172
1244
|
if (!_this6.activeMobiusUrl) {
|
|
1173
|
-
|
|
1245
|
+
_context19.next = 3;
|
|
1174
1246
|
break;
|
|
1175
1247
|
}
|
|
1176
|
-
|
|
1248
|
+
_context19.next = 2;
|
|
1177
1249
|
return _this6.restorePreviousRegistration(_constants2.METHODS.HANDLE_CONNECTION_RESTORATION);
|
|
1178
1250
|
case 2:
|
|
1179
|
-
abort =
|
|
1251
|
+
abort = _context19.sent;
|
|
1180
1252
|
if (!(!abort && !_this6.isDeviceRegistered())) {
|
|
1181
|
-
|
|
1253
|
+
_context19.next = 3;
|
|
1182
1254
|
break;
|
|
1183
1255
|
}
|
|
1184
|
-
|
|
1256
|
+
_context19.next = 3;
|
|
1185
1257
|
return _this6.restartRegistration(_constants2.METHODS.HANDLE_CONNECTION_RESTORATION);
|
|
1186
1258
|
case 3:
|
|
1187
1259
|
retry = false;
|
|
1188
1260
|
case 4:
|
|
1189
1261
|
case "end":
|
|
1190
|
-
return
|
|
1262
|
+
return _context19.stop();
|
|
1191
1263
|
}
|
|
1192
|
-
},
|
|
1264
|
+
}, _callee19);
|
|
1193
1265
|
})));
|
|
1194
1266
|
case 1:
|
|
1195
|
-
return
|
|
1267
|
+
return _context20.abrupt("return", retry);
|
|
1196
1268
|
case 2:
|
|
1197
1269
|
case "end":
|
|
1198
|
-
return
|
|
1270
|
+
return _context20.stop();
|
|
1199
1271
|
}
|
|
1200
|
-
},
|
|
1272
|
+
}, _callee20, this);
|
|
1201
1273
|
}));
|
|
1202
|
-
function handleConnectionRestoration(
|
|
1274
|
+
function handleConnectionRestoration(_x14) {
|
|
1203
1275
|
return _handleConnectionRestoration.apply(this, arguments);
|
|
1204
1276
|
}
|
|
1205
1277
|
return handleConnectionRestoration;
|
|
@@ -1215,53 +1287,53 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1215
1287
|
value: function restoreRegistrationCallBack() {
|
|
1216
1288
|
var _this7 = this;
|
|
1217
1289
|
return /*#__PURE__*/function () {
|
|
1218
|
-
var _ref1 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1290
|
+
var _ref1 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21(restoreData, caller) {
|
|
1219
1291
|
var logContext, restore, finalError;
|
|
1220
|
-
return _regenerator.default.wrap(function (
|
|
1221
|
-
while (1) switch (
|
|
1292
|
+
return _regenerator.default.wrap(function (_context21) {
|
|
1293
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1222
1294
|
case 0:
|
|
1223
1295
|
logContext = {
|
|
1224
1296
|
file: _constants2.REGISTRATION_FILE,
|
|
1225
1297
|
method: caller
|
|
1226
1298
|
};
|
|
1227
1299
|
if (_this7.isRegRetry()) {
|
|
1228
|
-
|
|
1300
|
+
_context21.next = 4;
|
|
1229
1301
|
break;
|
|
1230
1302
|
}
|
|
1231
1303
|
_Logger.default.info('Registration restoration in progress.', logContext);
|
|
1232
1304
|
restore = _this7.getExistingDevice(restoreData);
|
|
1233
1305
|
if (!restore) {
|
|
1234
|
-
|
|
1306
|
+
_context21.next = 3;
|
|
1235
1307
|
break;
|
|
1236
1308
|
}
|
|
1237
1309
|
_this7.setRegRetry(true);
|
|
1238
|
-
|
|
1310
|
+
_context21.next = 1;
|
|
1239
1311
|
return _this7.deregister();
|
|
1240
1312
|
case 1:
|
|
1241
|
-
|
|
1313
|
+
_context21.next = 2;
|
|
1242
1314
|
return _this7.restorePreviousRegistration(caller);
|
|
1243
1315
|
case 2:
|
|
1244
|
-
finalError =
|
|
1316
|
+
finalError = _context21.sent;
|
|
1245
1317
|
_this7.setRegRetry(false);
|
|
1246
1318
|
if (_this7.isDeviceRegistered()) {
|
|
1247
1319
|
_Logger.default.info('Registration restored successfully.', logContext);
|
|
1248
1320
|
}
|
|
1249
|
-
return
|
|
1321
|
+
return _context21.abrupt("return", finalError);
|
|
1250
1322
|
case 3:
|
|
1251
|
-
_this7.lineEmitter(
|
|
1252
|
-
|
|
1323
|
+
_this7.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1324
|
+
_context21.next = 5;
|
|
1253
1325
|
break;
|
|
1254
1326
|
case 4:
|
|
1255
|
-
_this7.lineEmitter(
|
|
1327
|
+
_this7.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1256
1328
|
case 5:
|
|
1257
|
-
return
|
|
1329
|
+
return _context21.abrupt("return", false);
|
|
1258
1330
|
case 6:
|
|
1259
1331
|
case "end":
|
|
1260
|
-
return
|
|
1332
|
+
return _context21.stop();
|
|
1261
1333
|
}
|
|
1262
|
-
},
|
|
1334
|
+
}, _callee21);
|
|
1263
1335
|
}));
|
|
1264
|
-
return function (
|
|
1336
|
+
return function (_x15, _x16) {
|
|
1265
1337
|
return _ref1.apply(this, arguments);
|
|
1266
1338
|
};
|
|
1267
1339
|
}();
|
|
@@ -1274,51 +1346,55 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1274
1346
|
}, {
|
|
1275
1347
|
key: "triggerRegistration",
|
|
1276
1348
|
value: (function () {
|
|
1277
|
-
var _triggerRegistration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1349
|
+
var _triggerRegistration = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
|
|
1278
1350
|
var loggerContext, abort;
|
|
1279
|
-
return _regenerator.default.wrap(function (
|
|
1280
|
-
while (1) switch (
|
|
1351
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
1352
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1281
1353
|
case 0:
|
|
1282
1354
|
loggerContext = {
|
|
1283
1355
|
file: _constants2.REGISTRATION_FILE,
|
|
1284
1356
|
method: _constants2.METHODS.TRIGGER_REGISTRATION
|
|
1285
1357
|
};
|
|
1286
1358
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, loggerContext);
|
|
1287
|
-
|
|
1359
|
+
|
|
1360
|
+
/* An explicit registration from the consumer is the only way out of a superseded
|
|
1361
|
+
* session, so the terminal state is lifted here. */
|
|
1362
|
+
this.sessionSuperseded = false;
|
|
1363
|
+
_context22.next = 1;
|
|
1288
1364
|
return this.resumeFailover();
|
|
1289
1365
|
case 1:
|
|
1290
|
-
if (!
|
|
1291
|
-
|
|
1366
|
+
if (!_context22.sent) {
|
|
1367
|
+
_context22.next = 2;
|
|
1292
1368
|
break;
|
|
1293
1369
|
}
|
|
1294
1370
|
_Logger.default.info('Registration trigger handled by resumeFailover path', loggerContext);
|
|
1295
|
-
return
|
|
1371
|
+
return _context22.abrupt("return");
|
|
1296
1372
|
case 2:
|
|
1297
1373
|
if (!(this.primaryMobiusUris.length > 0)) {
|
|
1298
|
-
|
|
1374
|
+
_context22.next = 5;
|
|
1299
1375
|
break;
|
|
1300
1376
|
}
|
|
1301
|
-
|
|
1377
|
+
_context22.next = 3;
|
|
1302
1378
|
return this.attemptRegistrationWithServers(_constants2.REGISTRATION_UTIL, this.primaryMobiusUris);
|
|
1303
1379
|
case 3:
|
|
1304
|
-
abort =
|
|
1380
|
+
abort = _context22.sent;
|
|
1305
1381
|
if (!(!this.isDeviceRegistered() && !abort)) {
|
|
1306
|
-
|
|
1382
|
+
_context22.next = 4;
|
|
1307
1383
|
break;
|
|
1308
1384
|
}
|
|
1309
|
-
|
|
1385
|
+
_context22.next = 4;
|
|
1310
1386
|
return this.startFailoverTimer();
|
|
1311
1387
|
case 4:
|
|
1312
1388
|
_Logger.default.log("triggerRegistration completed - deviceRegistered: ".concat(this.isDeviceRegistered(), ", abort: ").concat(abort), loggerContext);
|
|
1313
|
-
|
|
1389
|
+
_context22.next = 6;
|
|
1314
1390
|
break;
|
|
1315
1391
|
case 5:
|
|
1316
1392
|
_Logger.default.warn('triggerRegistration skipped: no primary Mobius URIs available', loggerContext);
|
|
1317
1393
|
case 6:
|
|
1318
1394
|
case "end":
|
|
1319
|
-
return
|
|
1395
|
+
return _context22.stop();
|
|
1320
1396
|
}
|
|
1321
|
-
},
|
|
1397
|
+
}, _callee22, this);
|
|
1322
1398
|
}));
|
|
1323
1399
|
function triggerRegistration() {
|
|
1324
1400
|
return _triggerRegistration.apply(this, arguments);
|
|
@@ -1337,7 +1413,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1337
1413
|
}, {
|
|
1338
1414
|
key: "attemptRegistrationWithServers",
|
|
1339
1415
|
value: (function () {
|
|
1340
|
-
var _attemptRegistrationWithServers = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1416
|
+
var _attemptRegistrationWithServers = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23(caller) {
|
|
1341
1417
|
var _this8 = this;
|
|
1342
1418
|
var servers,
|
|
1343
1419
|
loggerContext,
|
|
@@ -1347,31 +1423,50 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1347
1423
|
_step2,
|
|
1348
1424
|
_loop,
|
|
1349
1425
|
_ret,
|
|
1350
|
-
|
|
1426
|
+
_args24 = arguments,
|
|
1351
1427
|
_t6;
|
|
1352
|
-
return _regenerator.default.wrap(function (
|
|
1353
|
-
while (1) switch (
|
|
1428
|
+
return _regenerator.default.wrap(function (_context24) {
|
|
1429
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1354
1430
|
case 0:
|
|
1355
|
-
servers =
|
|
1431
|
+
servers = _args24.length > 1 && _args24[1] !== undefined ? _args24[1] : this.primaryMobiusUris;
|
|
1356
1432
|
loggerContext = {
|
|
1357
1433
|
file: _constants2.REGISTRATION_FILE,
|
|
1358
1434
|
method: _constants2.REGISTER_UTIL
|
|
1359
1435
|
};
|
|
1436
|
+
/*
|
|
1437
|
+
* Single choke point for every registration attempt - initial registration, restore,
|
|
1438
|
+
* restart, the scheduled failover retries and failback all reach Mobius through here.
|
|
1439
|
+
* Guarding it once means a superseded session cannot be re-registered by any
|
|
1440
|
+
* automatic path, including one whose timer was already scheduled when the 409
|
|
1441
|
+
* arrived. `true` is returned so callers treat it as a final error and schedule no
|
|
1442
|
+
* further retries. `triggerRegistration()` clears the latch before calling in, so an
|
|
1443
|
+
* explicit registration by the consumer is unaffected.
|
|
1444
|
+
*/
|
|
1445
|
+
if (!this.sessionSuperseded) {
|
|
1446
|
+
_context24.next = 1;
|
|
1447
|
+
break;
|
|
1448
|
+
}
|
|
1449
|
+
_Logger.default.warn("Session superseded, skipping registration attempt - caller: ".concat(caller), {
|
|
1450
|
+
file: _constants2.REGISTRATION_FILE,
|
|
1451
|
+
method: caller
|
|
1452
|
+
});
|
|
1453
|
+
return _context24.abrupt("return", true);
|
|
1454
|
+
case 1:
|
|
1360
1455
|
abort = false;
|
|
1361
1456
|
this.retryAfter = undefined;
|
|
1362
1457
|
if (!this.failoverImmediately) {
|
|
1363
|
-
|
|
1458
|
+
_context24.next = 2;
|
|
1364
1459
|
break;
|
|
1365
1460
|
}
|
|
1366
|
-
return
|
|
1367
|
-
case
|
|
1461
|
+
return _context24.abrupt("return", abort);
|
|
1462
|
+
case 2:
|
|
1368
1463
|
if (!this.isDeviceRegistered()) {
|
|
1369
|
-
|
|
1464
|
+
_context24.next = 3;
|
|
1370
1465
|
break;
|
|
1371
1466
|
}
|
|
1372
1467
|
_Logger.default.info("[".concat(caller, "] : Device already registered with : ").concat(this.activeMobiusUrl), loggerContext);
|
|
1373
|
-
return
|
|
1374
|
-
case
|
|
1468
|
+
return _context24.abrupt("return", abort);
|
|
1469
|
+
case 3:
|
|
1375
1470
|
/*
|
|
1376
1471
|
* Align the active transport with this server group. When the Mobius socket is enabled
|
|
1377
1472
|
* but a group has no WSS URL, CallingClient hands us its HTTP URIs instead; routing those
|
|
@@ -1383,90 +1478,93 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1383
1478
|
this.apiRequest.setSocketEnabled(servers[0].startsWith('wss://'));
|
|
1384
1479
|
}
|
|
1385
1480
|
_iterator2 = _createForOfIteratorHelper(servers);
|
|
1386
|
-
|
|
1481
|
+
_context24.prev = 4;
|
|
1387
1482
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
1388
1483
|
var url, serverType, _this8$deviceInfo$dev, _resp$headers, _resp$headers$trackin, _resp$headers2, _this8$deviceInfo$dev2, wssNormalizedUrl, resp, body, _yield$handleRegistra, finalError, shouldDisconnect, _t5;
|
|
1389
|
-
return _regenerator.default.wrap(function (
|
|
1390
|
-
while (1) switch (
|
|
1484
|
+
return _regenerator.default.wrap(function (_context23) {
|
|
1485
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1391
1486
|
case 0:
|
|
1392
1487
|
url = _step2.value;
|
|
1393
1488
|
serverType = _this8.getServerType(url);
|
|
1394
|
-
|
|
1489
|
+
_context23.prev = 1;
|
|
1395
1490
|
abort = false;
|
|
1396
|
-
_this8.registrationStatus =
|
|
1397
|
-
_this8.lineEmitter(
|
|
1491
|
+
_this8.registrationStatus = _types3.RegistrationStatus.INACTIVE;
|
|
1492
|
+
_this8.lineEmitter(_types4.LINE_EVENTS.CONNECTING);
|
|
1398
1493
|
_Logger.default.info("[".concat(caller, "] : Mobius url to contact: ").concat(url), loggerContext);
|
|
1399
1494
|
if (!_this8.apiRequest.isSocketEnabled()) {
|
|
1400
|
-
|
|
1495
|
+
_context23.next = 3;
|
|
1401
1496
|
break;
|
|
1402
1497
|
}
|
|
1403
1498
|
wssNormalizedUrl = url.endsWith('/') ? url.slice(0, -1) : url;
|
|
1404
1499
|
_Logger.default.info("[".concat(caller, "] : Connecting to Mobius WebSocket - serverType: ").concat(serverType, ", wssUrl: ").concat(wssNormalizedUrl), loggerContext);
|
|
1405
1500
|
|
|
1406
1501
|
// eslint-disable-next-line no-await-in-loop
|
|
1407
|
-
|
|
1502
|
+
_context23.next = 2;
|
|
1408
1503
|
return _this8.apiRequest.connectToMobiusSocket(wssNormalizedUrl);
|
|
1409
1504
|
case 2:
|
|
1410
|
-
connectedWebSocketUrl =
|
|
1505
|
+
connectedWebSocketUrl = _context23.sent;
|
|
1411
1506
|
connectedWebSocketUrl = connectedWebSocketUrl ? "".concat(connectedWebSocketUrl, "/") : undefined;
|
|
1412
1507
|
_Logger.default.log("[".concat(caller, "] : Mobius WebSocket connected - serverType: ").concat(serverType, ", connectedWebSocketUrl: ").concat(connectedWebSocketUrl), loggerContext);
|
|
1413
1508
|
case 3:
|
|
1414
|
-
|
|
1509
|
+
_context23.next = 4;
|
|
1415
1510
|
return _this8.postRegistration(url);
|
|
1416
1511
|
case 4:
|
|
1417
|
-
resp =
|
|
1512
|
+
resp = _context23.sent;
|
|
1418
1513
|
_this8.clearFailoverState();
|
|
1419
1514
|
_this8.deviceInfo = resp.body;
|
|
1420
|
-
_this8.registrationStatus =
|
|
1515
|
+
_this8.registrationStatus = _types3.RegistrationStatus.ACTIVE;
|
|
1421
1516
|
_this8.setActiveMobiusUrl(connectedWebSocketUrl || url);
|
|
1422
|
-
_this8.lineEmitter(
|
|
1517
|
+
_this8.lineEmitter(_types4.LINE_EVENTS.REGISTERED, resp.body);
|
|
1423
1518
|
_Logger.default.log("Registration successful for deviceId: ".concat((_this8$deviceInfo$dev = _this8.deviceInfo.device) === null || _this8$deviceInfo$dev === void 0 ? void 0 : _this8$deviceInfo$dev.deviceId, " userId: ").concat(_this8.userId, " responseTrackingId: ").concat((_resp$headers = resp.headers) === null || _resp$headers === void 0 ? void 0 : _resp$headers.trackingid), loggerContext);
|
|
1424
1519
|
_this8.setIntervalValues(_this8.deviceInfo);
|
|
1425
1520
|
_this8.metricManager.setDeviceInfo(_this8.deviceInfo);
|
|
1426
1521
|
_this8.metricManager.submitRegistrationMetric(_types.METRIC_EVENT.REGISTRATION, _types.REG_ACTION.REGISTER, _types.METRIC_TYPE.BEHAVIORAL, caller, serverType, (_resp$headers$trackin = (_resp$headers2 = resp.headers) === null || _resp$headers2 === void 0 ? void 0 : _resp$headers2.trackingid) !== null && _resp$headers$trackin !== void 0 ? _resp$headers$trackin : '', undefined, undefined);
|
|
1427
1522
|
_this8.startKeepaliveTimer((_this8$deviceInfo$dev2 = _this8.deviceInfo.device) === null || _this8$deviceInfo$dev2 === void 0 ? void 0 : _this8$deviceInfo$dev2.uri, _this8.deviceInfo.keepaliveInterval, serverType);
|
|
1428
1523
|
_this8.initiateFailback();
|
|
1429
|
-
return
|
|
1524
|
+
return _context23.abrupt("return", 0);
|
|
1430
1525
|
case 5:
|
|
1431
|
-
|
|
1432
|
-
_t5 =
|
|
1526
|
+
_context23.prev = 5;
|
|
1527
|
+
_t5 = _context23["catch"](1);
|
|
1433
1528
|
body = _t5; // eslint-disable-next-line no-await-in-loop, @typescript-eslint/no-unused-vars
|
|
1434
|
-
|
|
1529
|
+
_context23.next = 6;
|
|
1435
1530
|
return (0, _common.handleRegistrationErrors)(body, function (clientError, isFinalError) {
|
|
1436
1531
|
var _body$headers$trackin, _body$headers;
|
|
1437
1532
|
if (isFinalError) {
|
|
1438
|
-
_this8.lineEmitter(
|
|
1533
|
+
_this8.lineEmitter(_types4.LINE_EVENTS.ERROR, undefined, clientError);
|
|
1439
1534
|
} else {
|
|
1440
|
-
_this8.lineEmitter(
|
|
1535
|
+
_this8.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1441
1536
|
}
|
|
1442
1537
|
_this8.metricManager.submitRegistrationMetric(_types.METRIC_EVENT.REGISTRATION_ERROR, _types.REG_ACTION.REGISTER, _types.METRIC_TYPE.BEHAVIORAL, caller, serverType, (_body$headers$trackin = (_body$headers = body.headers) === null || _body$headers === void 0 ? void 0 : _body$headers.trackingid) !== null && _body$headers$trackin !== void 0 ? _body$headers$trackin : '', undefined, clientError);
|
|
1443
1538
|
}, {
|
|
1444
1539
|
method: caller,
|
|
1445
1540
|
file: _constants2.REGISTRATION_FILE
|
|
1446
|
-
},
|
|
1447
|
-
|
|
1448
|
-
|
|
1541
|
+
}, {
|
|
1542
|
+
retry429Cb: function retry429Cb(retryAfter, retryCaller) {
|
|
1543
|
+
return _this8.handle429Retry(retryAfter, retryCaller);
|
|
1544
|
+
},
|
|
1545
|
+
restoreRegCb: _this8.restoreRegistrationCallBack()
|
|
1546
|
+
}, servers.length);
|
|
1449
1547
|
case 6:
|
|
1450
|
-
_yield$handleRegistra =
|
|
1548
|
+
_yield$handleRegistra = _context23.sent;
|
|
1451
1549
|
finalError = _yield$handleRegistra.finalError;
|
|
1452
1550
|
shouldDisconnect = _yield$handleRegistra.shouldDisconnect;
|
|
1453
1551
|
abort = finalError;
|
|
1454
|
-
if (!(_this8.registrationStatus ===
|
|
1455
|
-
|
|
1552
|
+
if (!(_this8.registrationStatus === _types3.RegistrationStatus.ACTIVE)) {
|
|
1553
|
+
_context23.next = 7;
|
|
1456
1554
|
break;
|
|
1457
1555
|
}
|
|
1458
1556
|
_Logger.default.info("[".concat(caller, "] : Device is already restored, active mobius url: ").concat(_this8.activeMobiusUrl), loggerContext);
|
|
1459
|
-
return
|
|
1557
|
+
return _context23.abrupt("return", 0);
|
|
1460
1558
|
case 7:
|
|
1461
1559
|
if (!(shouldDisconnect && _this8.apiRequest.isSocketEnabled())) {
|
|
1462
|
-
|
|
1560
|
+
_context23.next = 9;
|
|
1463
1561
|
break;
|
|
1464
1562
|
}
|
|
1465
1563
|
connectedWebSocketUrl = undefined;
|
|
1466
1564
|
_Logger.default.info("[".concat(caller, "] : Tearing down Mobius WebSocket after registration error - serverType: ").concat(serverType), loggerContext);
|
|
1467
1565
|
|
|
1468
1566
|
// eslint-disable-next-line no-await-in-loop
|
|
1469
|
-
|
|
1567
|
+
_context23.next = 8;
|
|
1470
1568
|
return _this8.apiRequest.disconnectFromMobiusSocket({
|
|
1471
1569
|
code: 3050,
|
|
1472
1570
|
reason: 'done (permanent)'
|
|
@@ -1475,58 +1573,58 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1475
1573
|
_Logger.default.log("[".concat(caller, "] : Mobius WebSocket disconnect complete after registration error - serverType: ").concat(serverType), loggerContext);
|
|
1476
1574
|
case 9:
|
|
1477
1575
|
if (!abort) {
|
|
1478
|
-
|
|
1576
|
+
_context23.next = 11;
|
|
1479
1577
|
break;
|
|
1480
1578
|
}
|
|
1481
|
-
_this8.setStatus(
|
|
1579
|
+
_this8.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1482
1580
|
// eslint-disable-next-line no-await-in-loop
|
|
1483
|
-
|
|
1581
|
+
_context23.next = 10;
|
|
1484
1582
|
return (0, _common.uploadLogs)();
|
|
1485
1583
|
case 10:
|
|
1486
|
-
return
|
|
1584
|
+
return _context23.abrupt("return", 0);
|
|
1487
1585
|
case 11:
|
|
1488
1586
|
case "end":
|
|
1489
|
-
return
|
|
1587
|
+
return _context23.stop();
|
|
1490
1588
|
}
|
|
1491
1589
|
}, _loop, null, [[1, 5]]);
|
|
1492
1590
|
});
|
|
1493
1591
|
_iterator2.s();
|
|
1494
|
-
case
|
|
1592
|
+
case 5:
|
|
1495
1593
|
if ((_step2 = _iterator2.n()).done) {
|
|
1496
|
-
|
|
1594
|
+
_context24.next = 8;
|
|
1497
1595
|
break;
|
|
1498
1596
|
}
|
|
1499
|
-
return
|
|
1500
|
-
case
|
|
1501
|
-
_ret =
|
|
1597
|
+
return _context24.delegateYield(_loop(), "t0", 6);
|
|
1598
|
+
case 6:
|
|
1599
|
+
_ret = _context24.t0;
|
|
1502
1600
|
if (!(_ret === 0)) {
|
|
1503
|
-
|
|
1601
|
+
_context24.next = 7;
|
|
1504
1602
|
break;
|
|
1505
1603
|
}
|
|
1506
|
-
return
|
|
1507
|
-
case 6:
|
|
1508
|
-
_context23.next = 4;
|
|
1509
|
-
break;
|
|
1604
|
+
return _context24.abrupt("continue", 8);
|
|
1510
1605
|
case 7:
|
|
1511
|
-
|
|
1606
|
+
_context24.next = 5;
|
|
1512
1607
|
break;
|
|
1513
1608
|
case 8:
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
_iterator2.e(_t6);
|
|
1609
|
+
_context24.next = 10;
|
|
1610
|
+
break;
|
|
1517
1611
|
case 9:
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1612
|
+
_context24.prev = 9;
|
|
1613
|
+
_t6 = _context24["catch"](4);
|
|
1614
|
+
_iterator2.e(_t6);
|
|
1521
1615
|
case 10:
|
|
1522
|
-
|
|
1616
|
+
_context24.prev = 10;
|
|
1617
|
+
_iterator2.f();
|
|
1618
|
+
return _context24.finish(10);
|
|
1523
1619
|
case 11:
|
|
1620
|
+
return _context24.abrupt("return", abort);
|
|
1621
|
+
case 12:
|
|
1524
1622
|
case "end":
|
|
1525
|
-
return
|
|
1623
|
+
return _context24.stop();
|
|
1526
1624
|
}
|
|
1527
|
-
},
|
|
1625
|
+
}, _callee23, this, [[4, 9, 10, 11]]);
|
|
1528
1626
|
}));
|
|
1529
|
-
function attemptRegistrationWithServers(
|
|
1627
|
+
function attemptRegistrationWithServers(_x17) {
|
|
1530
1628
|
return _attemptRegistrationWithServers.apply(this, arguments);
|
|
1531
1629
|
}
|
|
1532
1630
|
return attemptRegistrationWithServers;
|
|
@@ -1539,19 +1637,19 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1539
1637
|
}, {
|
|
1540
1638
|
key: "startKeepaliveTimer",
|
|
1541
1639
|
value: (function () {
|
|
1542
|
-
var _startKeepaliveTimer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1640
|
+
var _startKeepaliveTimer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26(url, interval, serverType) {
|
|
1543
1641
|
var _this9 = this;
|
|
1544
1642
|
var RETRY_COUNT_THRESHOLD;
|
|
1545
|
-
return _regenerator.default.wrap(function (
|
|
1546
|
-
while (1) switch (
|
|
1643
|
+
return _regenerator.default.wrap(function (_context27) {
|
|
1644
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
1547
1645
|
case 0:
|
|
1548
1646
|
this.clearKeepaliveTimer();
|
|
1549
1647
|
RETRY_COUNT_THRESHOLD = this.isCCFlow ? 4 : 5;
|
|
1550
|
-
|
|
1551
|
-
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1552
|
-
var blob, blobUrl;
|
|
1553
|
-
return _regenerator.default.wrap(function (
|
|
1554
|
-
while (1) switch (
|
|
1648
|
+
_context27.next = 1;
|
|
1649
|
+
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
|
|
1650
|
+
var blob, blobUrl, worker, isCurrentWorker;
|
|
1651
|
+
return _regenerator.default.wrap(function (_context26) {
|
|
1652
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1555
1653
|
case 0:
|
|
1556
1654
|
if (_this9.isDeviceRegistered()) {
|
|
1557
1655
|
if (!_this9.webWorker) {
|
|
@@ -1559,41 +1657,67 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1559
1657
|
type: 'application/javascript'
|
|
1560
1658
|
});
|
|
1561
1659
|
blobUrl = URL.createObjectURL(blob);
|
|
1562
|
-
|
|
1660
|
+
worker = new Worker(blobUrl);
|
|
1661
|
+
_this9.webWorker = worker;
|
|
1563
1662
|
URL.revokeObjectURL(blobUrl);
|
|
1564
|
-
|
|
1565
|
-
type:
|
|
1663
|
+
worker.postMessage({
|
|
1664
|
+
type: _types3.WorkerMessageType.START_KEEPALIVE,
|
|
1566
1665
|
interval: interval,
|
|
1567
1666
|
retryCountThreshold: RETRY_COUNT_THRESHOLD
|
|
1568
1667
|
});
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1668
|
+
|
|
1669
|
+
/*
|
|
1670
|
+
* A keepalive is in flight across an `await`, so this worker can be replaced
|
|
1671
|
+
* meanwhile - on failback, connection restoration or any re-registration. Its
|
|
1672
|
+
* result then belongs to a device that is no longer the registered one and must
|
|
1673
|
+
* not reach the current worker, whose retry count and failure handling (including
|
|
1674
|
+
* the 409 hard stop) would otherwise act on a stale registration.
|
|
1675
|
+
*/
|
|
1676
|
+
isCurrentWorker = function isCurrentWorker() {
|
|
1677
|
+
return _this9.webWorker === worker;
|
|
1678
|
+
};
|
|
1679
|
+
worker.onmessage = /*#__PURE__*/function () {
|
|
1680
|
+
var _ref11 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24(event) {
|
|
1681
|
+
var logContext, res, _err$headers, error, _error, _yield$handleRegistra2, abort, _t7;
|
|
1682
|
+
return _regenerator.default.wrap(function (_context25) {
|
|
1683
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1574
1684
|
case 0:
|
|
1575
1685
|
logContext = {
|
|
1576
1686
|
file: _constants2.REGISTRATION_FILE,
|
|
1577
1687
|
method: _constants2.KEEPALIVE_UTIL
|
|
1578
1688
|
};
|
|
1579
|
-
if (
|
|
1580
|
-
|
|
1689
|
+
if (isCurrentWorker()) {
|
|
1690
|
+
_context25.next = 1;
|
|
1691
|
+
break;
|
|
1692
|
+
}
|
|
1693
|
+
_Logger.default.info('Ignoring message from a replaced keepalive worker', logContext);
|
|
1694
|
+
return _context25.abrupt("return");
|
|
1695
|
+
case 1:
|
|
1696
|
+
if (!(event.data.type === _types3.WorkerMessageType.SEND_KEEPALIVE)) {
|
|
1697
|
+
_context25.next = 7;
|
|
1581
1698
|
break;
|
|
1582
1699
|
}
|
|
1583
|
-
|
|
1584
|
-
|
|
1700
|
+
_context25.prev = 2;
|
|
1701
|
+
_context25.next = 3;
|
|
1585
1702
|
return _this9.postKeepAlive(String(_this9.webex.internal.device.url), url);
|
|
1586
|
-
case
|
|
1587
|
-
res =
|
|
1588
|
-
(
|
|
1589
|
-
|
|
1703
|
+
case 3:
|
|
1704
|
+
res = _context25.sent;
|
|
1705
|
+
if (isCurrentWorker()) {
|
|
1706
|
+
_context25.next = 4;
|
|
1707
|
+
break;
|
|
1708
|
+
}
|
|
1709
|
+
_Logger.default.info('Discarding keepalive result of a replaced worker', logContext);
|
|
1710
|
+
return _context25.abrupt("return");
|
|
1711
|
+
case 4:
|
|
1712
|
+
worker.postMessage({
|
|
1713
|
+
type: _types3.WorkerMessageType.KEEPALIVE_RESULT,
|
|
1590
1714
|
statusCode: res.statusCode
|
|
1591
1715
|
});
|
|
1592
|
-
|
|
1716
|
+
_context25.next = 7;
|
|
1593
1717
|
break;
|
|
1594
|
-
case
|
|
1595
|
-
|
|
1596
|
-
_t7 =
|
|
1718
|
+
case 5:
|
|
1719
|
+
_context25.prev = 5;
|
|
1720
|
+
_t7 = _context25["catch"](2);
|
|
1597
1721
|
error = {
|
|
1598
1722
|
headers: {
|
|
1599
1723
|
trackingid: (_err$headers = _t7.headers) === null || _err$headers === void 0 ? void 0 : _err$headers.trackingid,
|
|
@@ -1603,74 +1727,92 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1603
1727
|
statusText: _t7.statusText,
|
|
1604
1728
|
type: _t7.type
|
|
1605
1729
|
};
|
|
1606
|
-
(
|
|
1607
|
-
|
|
1730
|
+
if (isCurrentWorker()) {
|
|
1731
|
+
_context25.next = 6;
|
|
1732
|
+
break;
|
|
1733
|
+
}
|
|
1734
|
+
_Logger.default.info("Discarding keepalive failure of a replaced worker, status -> ".concat(error.statusCode), logContext);
|
|
1735
|
+
return _context25.abrupt("return");
|
|
1736
|
+
case 6:
|
|
1737
|
+
worker.postMessage({
|
|
1738
|
+
type: _types3.WorkerMessageType.KEEPALIVE_RESULT,
|
|
1608
1739
|
err: error
|
|
1609
1740
|
});
|
|
1610
|
-
case
|
|
1611
|
-
if (event.data.type ===
|
|
1741
|
+
case 7:
|
|
1742
|
+
if (event.data.type === _types3.WorkerMessageType.KEEPALIVE_SUCCESS) {
|
|
1612
1743
|
_Logger.default.info("Sent Keepalive, status: ".concat(event.data.statusCode), logContext);
|
|
1613
|
-
_this9.lineEmitter(
|
|
1744
|
+
_this9.lineEmitter(_types4.LINE_EVENTS.RECONNECTED);
|
|
1614
1745
|
}
|
|
1615
|
-
if (!(event.data.type ===
|
|
1616
|
-
|
|
1746
|
+
if (!(event.data.type === _types3.WorkerMessageType.KEEPALIVE_FAILURE)) {
|
|
1747
|
+
_context25.next = 15;
|
|
1617
1748
|
break;
|
|
1618
1749
|
}
|
|
1619
1750
|
_error = event.data.err;
|
|
1620
1751
|
_Logger.default.warn("Keep-alive missed ".concat(event.data.keepAliveRetryCount, " times. Status -> ").concat(_error.statusCode, " "), logContext);
|
|
1621
|
-
|
|
1752
|
+
_context25.next = 8;
|
|
1622
1753
|
return (0, _common.handleRegistrationErrors)(_error, function (clientError, finalError) {
|
|
1623
|
-
var _error$headers$
|
|
1754
|
+
var _error$headers$tracki2, _error$headers2;
|
|
1624
1755
|
if (finalError) {
|
|
1625
|
-
_this9.lineEmitter(
|
|
1756
|
+
_this9.lineEmitter(_types4.LINE_EVENTS.ERROR, undefined, clientError);
|
|
1626
1757
|
}
|
|
1627
|
-
_this9.metricManager.submitRegistrationMetric(_types.METRIC_EVENT.KEEPALIVE_ERROR, _types.REG_ACTION.KEEPALIVE_FAILURE, _types.METRIC_TYPE.BEHAVIORAL, _constants2.KEEPALIVE_UTIL, serverType, (_error$headers$
|
|
1758
|
+
_this9.metricManager.submitRegistrationMetric(_types.METRIC_EVENT.KEEPALIVE_ERROR, _types.REG_ACTION.KEEPALIVE_FAILURE, _types.METRIC_TYPE.BEHAVIORAL, _constants2.KEEPALIVE_UTIL, serverType, (_error$headers$tracki2 = (_error$headers2 = _error.headers) === null || _error$headers2 === void 0 ? void 0 : _error$headers2.trackingid) !== null && _error$headers$tracki2 !== void 0 ? _error$headers$tracki2 : '', event.data.keepAliveRetryCount, clientError);
|
|
1628
1759
|
}, {
|
|
1629
1760
|
method: _constants2.KEEPALIVE_UTIL,
|
|
1630
1761
|
file: _constants2.REGISTRATION_FILE
|
|
1631
|
-
},
|
|
1632
|
-
|
|
1762
|
+
}, {
|
|
1763
|
+
retry429Cb: function retry429Cb(retryAfter, retryCaller) {
|
|
1764
|
+
return _this9.handle429Retry(retryAfter, retryCaller);
|
|
1765
|
+
},
|
|
1766
|
+
sessionSupersededCb: function sessionSupersededCb(clientError) {
|
|
1767
|
+
return _this9.handle409KeepaliveFailure(clientError, _error, serverType, event.data.keepAliveRetryCount);
|
|
1768
|
+
}
|
|
1633
1769
|
});
|
|
1634
|
-
case
|
|
1635
|
-
_yield$handleRegistra2 =
|
|
1770
|
+
case 8:
|
|
1771
|
+
_yield$handleRegistra2 = _context25.sent;
|
|
1636
1772
|
abort = _yield$handleRegistra2.finalError;
|
|
1773
|
+
if (!(abort && Number(_error.statusCode) === _types5.ERROR_CODE.CONFLICT)) {
|
|
1774
|
+
_context25.next = 9;
|
|
1775
|
+
break;
|
|
1776
|
+
}
|
|
1777
|
+
return _context25.abrupt("return");
|
|
1778
|
+
case 9:
|
|
1637
1779
|
if (!(abort || event.data.keepAliveRetryCount >= RETRY_COUNT_THRESHOLD)) {
|
|
1638
|
-
|
|
1780
|
+
_context25.next = 14;
|
|
1639
1781
|
break;
|
|
1640
1782
|
}
|
|
1641
1783
|
_this9.failoverImmediately = _this9.isCCFlow;
|
|
1642
|
-
_this9.setStatus(
|
|
1784
|
+
_this9.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1643
1785
|
_this9.clearKeepaliveTimer();
|
|
1644
1786
|
_this9.clearFailbackTimer();
|
|
1645
|
-
_this9.lineEmitter(
|
|
1646
|
-
|
|
1787
|
+
_this9.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1788
|
+
_context25.next = 10;
|
|
1647
1789
|
return (0, _common.uploadLogs)();
|
|
1648
|
-
case
|
|
1790
|
+
case 10:
|
|
1649
1791
|
if (abort) {
|
|
1650
|
-
|
|
1792
|
+
_context25.next = 12;
|
|
1651
1793
|
break;
|
|
1652
1794
|
}
|
|
1653
|
-
|
|
1795
|
+
_context25.next = 11;
|
|
1654
1796
|
return _this9.reconnectOnFailure(_constants2.RECONNECT_ON_FAILURE_UTIL);
|
|
1655
|
-
case
|
|
1656
|
-
|
|
1797
|
+
case 11:
|
|
1798
|
+
_context25.next = 13;
|
|
1657
1799
|
break;
|
|
1658
|
-
case
|
|
1800
|
+
case 12:
|
|
1659
1801
|
if (_error.statusCode === 404) {
|
|
1660
1802
|
_this9.handle404KeepaliveFailure(_constants2.KEEPALIVE_UTIL);
|
|
1661
1803
|
}
|
|
1662
|
-
case
|
|
1663
|
-
|
|
1804
|
+
case 13:
|
|
1805
|
+
_context25.next = 15;
|
|
1664
1806
|
break;
|
|
1665
|
-
case
|
|
1666
|
-
_this9.lineEmitter(
|
|
1667
|
-
case
|
|
1807
|
+
case 14:
|
|
1808
|
+
_this9.lineEmitter(_types4.LINE_EVENTS.RECONNECTING);
|
|
1809
|
+
case 15:
|
|
1668
1810
|
case "end":
|
|
1669
|
-
return
|
|
1811
|
+
return _context25.stop();
|
|
1670
1812
|
}
|
|
1671
|
-
},
|
|
1813
|
+
}, _callee24, null, [[2, 5]]);
|
|
1672
1814
|
}));
|
|
1673
|
-
return function (
|
|
1815
|
+
return function (_x21) {
|
|
1674
1816
|
return _ref11.apply(this, arguments);
|
|
1675
1817
|
};
|
|
1676
1818
|
}();
|
|
@@ -1678,17 +1820,17 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1678
1820
|
}
|
|
1679
1821
|
case 1:
|
|
1680
1822
|
case "end":
|
|
1681
|
-
return
|
|
1823
|
+
return _context26.stop();
|
|
1682
1824
|
}
|
|
1683
|
-
},
|
|
1825
|
+
}, _callee25);
|
|
1684
1826
|
})));
|
|
1685
1827
|
case 1:
|
|
1686
1828
|
case "end":
|
|
1687
|
-
return
|
|
1829
|
+
return _context27.stop();
|
|
1688
1830
|
}
|
|
1689
|
-
},
|
|
1831
|
+
}, _callee26, this);
|
|
1690
1832
|
}));
|
|
1691
|
-
function startKeepaliveTimer(
|
|
1833
|
+
function startKeepaliveTimer(_x18, _x19, _x20) {
|
|
1692
1834
|
return _startKeepaliveTimer.apply(this, arguments);
|
|
1693
1835
|
}
|
|
1694
1836
|
return startKeepaliveTimer;
|
|
@@ -1702,7 +1844,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1702
1844
|
value: function clearKeepaliveTimer() {
|
|
1703
1845
|
if (this.webWorker) {
|
|
1704
1846
|
this.webWorker.postMessage({
|
|
1705
|
-
type:
|
|
1847
|
+
type: _types3.WorkerMessageType.CLEAR_KEEPALIVE
|
|
1706
1848
|
});
|
|
1707
1849
|
this.webWorker.terminate();
|
|
1708
1850
|
this.webWorker = undefined;
|
|
@@ -1716,39 +1858,39 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1716
1858
|
}, {
|
|
1717
1859
|
key: "deregister",
|
|
1718
1860
|
value: function () {
|
|
1719
|
-
var _deregister = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1861
|
+
var _deregister = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
1720
1862
|
var closeMobiusWss,
|
|
1721
1863
|
loggerContext,
|
|
1722
1864
|
_this$deviceInfo$devi2,
|
|
1723
1865
|
_this$deviceInfo$devi3,
|
|
1724
|
-
|
|
1866
|
+
_args28 = arguments,
|
|
1725
1867
|
_t8;
|
|
1726
|
-
return _regenerator.default.wrap(function (
|
|
1727
|
-
while (1) switch (
|
|
1868
|
+
return _regenerator.default.wrap(function (_context28) {
|
|
1869
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
1728
1870
|
case 0:
|
|
1729
|
-
closeMobiusWss =
|
|
1871
|
+
closeMobiusWss = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : false;
|
|
1730
1872
|
loggerContext = {
|
|
1731
1873
|
file: _constants2.REGISTRATION_FILE,
|
|
1732
1874
|
method: _constants2.METHODS.DEREGISTER
|
|
1733
1875
|
};
|
|
1734
1876
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, loggerContext);
|
|
1735
|
-
|
|
1736
|
-
|
|
1877
|
+
_context28.prev = 1;
|
|
1878
|
+
_context28.next = 2;
|
|
1737
1879
|
return this.deleteRegistration(this.activeMobiusUrl, (_this$deviceInfo$devi2 = this.deviceInfo.device) === null || _this$deviceInfo$devi2 === void 0 ? void 0 : _this$deviceInfo$devi2.deviceId, (_this$deviceInfo$devi3 = this.deviceInfo.device) === null || _this$deviceInfo$devi3 === void 0 ? void 0 : _this$deviceInfo$devi3.clientDeviceUri);
|
|
1738
1880
|
case 2:
|
|
1739
1881
|
_Logger.default.log('Registration successfully deregistered', loggerContext);
|
|
1740
|
-
|
|
1882
|
+
_context28.next = 4;
|
|
1741
1883
|
break;
|
|
1742
1884
|
case 3:
|
|
1743
|
-
|
|
1744
|
-
_t8 =
|
|
1885
|
+
_context28.prev = 3;
|
|
1886
|
+
_t8 = _context28["catch"](1);
|
|
1745
1887
|
_Logger.default.warn("Delete failed with Mobius: ".concat((0, _stringify.default)(_t8)), loggerContext);
|
|
1746
1888
|
case 4:
|
|
1747
1889
|
if (!closeMobiusWss) {
|
|
1748
|
-
|
|
1890
|
+
_context28.next = 6;
|
|
1749
1891
|
break;
|
|
1750
1892
|
}
|
|
1751
|
-
|
|
1893
|
+
_context28.next = 5;
|
|
1752
1894
|
return this.apiRequest.disconnectFromMobiusSocket({
|
|
1753
1895
|
code: 3050,
|
|
1754
1896
|
reason: 'done (permanent)'
|
|
@@ -1757,13 +1899,13 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1757
1899
|
_Logger.default.log('Mobius socket disconnect complete after deregistration', loggerContext);
|
|
1758
1900
|
case 6:
|
|
1759
1901
|
this.clearKeepaliveTimer();
|
|
1760
|
-
this.setStatus(
|
|
1902
|
+
this.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1761
1903
|
this.clearFailoverState();
|
|
1762
1904
|
case 7:
|
|
1763
1905
|
case "end":
|
|
1764
|
-
return
|
|
1906
|
+
return _context28.stop();
|
|
1765
1907
|
}
|
|
1766
|
-
},
|
|
1908
|
+
}, _callee27, this, [[1, 3]]);
|
|
1767
1909
|
}));
|
|
1768
1910
|
function deregister() {
|
|
1769
1911
|
return _deregister.apply(this, arguments);
|
|
@@ -1813,7 +1955,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1813
1955
|
uri = !uri.endsWith('/') ? "".concat(uri, "/") : uri;
|
|
1814
1956
|
}
|
|
1815
1957
|
this.setActiveMobiusUrl(uri);
|
|
1816
|
-
this.registrationStatus =
|
|
1958
|
+
this.registrationStatus = _types3.RegistrationStatus.ACTIVE;
|
|
1817
1959
|
return true;
|
|
1818
1960
|
}
|
|
1819
1961
|
return false;
|
|
@@ -1831,10 +1973,10 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1831
1973
|
}, {
|
|
1832
1974
|
key: "reconnectOnFailure",
|
|
1833
1975
|
value: (function () {
|
|
1834
|
-
var _reconnectOnFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1976
|
+
var _reconnectOnFailure = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28(caller) {
|
|
1835
1977
|
var abort;
|
|
1836
|
-
return _regenerator.default.wrap(function (
|
|
1837
|
-
while (1) switch (
|
|
1978
|
+
return _regenerator.default.wrap(function (_context29) {
|
|
1979
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
1838
1980
|
case 0:
|
|
1839
1981
|
_Logger.default.info(_constants.METHOD_START_MESSAGE, {
|
|
1840
1982
|
method: _constants2.METHODS.RECONNECT_ON_FAILURE,
|
|
@@ -1842,25 +1984,25 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1842
1984
|
});
|
|
1843
1985
|
this.reconnectPending = false;
|
|
1844
1986
|
if (this.isDeviceRegistered()) {
|
|
1845
|
-
|
|
1987
|
+
_context29.next = 4;
|
|
1846
1988
|
break;
|
|
1847
1989
|
}
|
|
1848
1990
|
if (!((0, _keys.default)(this.callManager.getActiveCalls()).length === 0)) {
|
|
1849
|
-
|
|
1991
|
+
_context29.next = 3;
|
|
1850
1992
|
break;
|
|
1851
1993
|
}
|
|
1852
|
-
|
|
1994
|
+
_context29.next = 1;
|
|
1853
1995
|
return this.restorePreviousRegistration(caller);
|
|
1854
1996
|
case 1:
|
|
1855
|
-
abort =
|
|
1997
|
+
abort = _context29.sent;
|
|
1856
1998
|
if (!(!abort && !this.isDeviceRegistered())) {
|
|
1857
|
-
|
|
1999
|
+
_context29.next = 2;
|
|
1858
2000
|
break;
|
|
1859
2001
|
}
|
|
1860
|
-
|
|
2002
|
+
_context29.next = 2;
|
|
1861
2003
|
return this.restartRegistration(caller);
|
|
1862
2004
|
case 2:
|
|
1863
|
-
|
|
2005
|
+
_context29.next = 4;
|
|
1864
2006
|
break;
|
|
1865
2007
|
case 3:
|
|
1866
2008
|
this.reconnectPending = true;
|
|
@@ -1870,11 +2012,11 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1870
2012
|
});
|
|
1871
2013
|
case 4:
|
|
1872
2014
|
case "end":
|
|
1873
|
-
return
|
|
2015
|
+
return _context29.stop();
|
|
1874
2016
|
}
|
|
1875
|
-
},
|
|
2017
|
+
}, _callee28, this);
|
|
1876
2018
|
}));
|
|
1877
|
-
function reconnectOnFailure(
|
|
2019
|
+
function reconnectOnFailure(_x22) {
|
|
1878
2020
|
return _reconnectOnFailure.apply(this, arguments);
|
|
1879
2021
|
}
|
|
1880
2022
|
return reconnectOnFailure;
|
|
@@ -1889,11 +2031,11 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1889
2031
|
}, {
|
|
1890
2032
|
key: "handleRegistrationDownEvent",
|
|
1891
2033
|
value: (function () {
|
|
1892
|
-
var _handleRegistrationDownEvent = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2034
|
+
var _handleRegistrationDownEvent = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29(event) {
|
|
1893
2035
|
var _event$trackingId, _event$eventId;
|
|
1894
2036
|
var loggerContext, _Object$values, _Object$values2, activeCall;
|
|
1895
|
-
return _regenerator.default.wrap(function (
|
|
1896
|
-
while (1) switch (
|
|
2037
|
+
return _regenerator.default.wrap(function (_context30) {
|
|
2038
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
1897
2039
|
case 0:
|
|
1898
2040
|
loggerContext = {
|
|
1899
2041
|
file: _constants2.REGISTRATION_FILE,
|
|
@@ -1902,50 +2044,56 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1902
2044
|
_Logger.default.info("Registration down received - trackingId: ".concat((_event$trackingId = event === null || event === void 0 ? void 0 : event.trackingId) !== null && _event$trackingId !== void 0 ? _event$trackingId : 'unknown', ", eventId: ").concat((_event$eventId = event === null || event === void 0 ? void 0 : event.eventId) !== null && _event$eventId !== void 0 ? _event$eventId : 'unknown'), loggerContext);
|
|
1903
2045
|
_Object$values = (0, _values.default)(this.callManager.getActiveCalls()), _Object$values2 = (0, _slicedToArray2.default)(_Object$values, 1), activeCall = _Object$values2[0];
|
|
1904
2046
|
activeCall === null || activeCall === void 0 ? void 0 : activeCall.end();
|
|
1905
|
-
|
|
1906
|
-
return this.
|
|
2047
|
+
_context30.next = 1;
|
|
2048
|
+
return this.registrationCleanup(_constants2.METHODS.HANDLE_REGISTRATION_DOWN_EVENT, {
|
|
2049
|
+
reason: _types2.HARD_STOP_REASON.REGISTRATION_DOWN
|
|
2050
|
+
});
|
|
1907
2051
|
case 1:
|
|
1908
2052
|
case "end":
|
|
1909
|
-
return
|
|
2053
|
+
return _context30.stop();
|
|
1910
2054
|
}
|
|
1911
|
-
},
|
|
2055
|
+
}, _callee29, this);
|
|
1912
2056
|
}));
|
|
1913
|
-
function handleRegistrationDownEvent(
|
|
2057
|
+
function handleRegistrationDownEvent(_x23) {
|
|
1914
2058
|
return _handleRegistrationDownEvent.apply(this, arguments);
|
|
1915
2059
|
}
|
|
1916
2060
|
return handleRegistrationDownEvent;
|
|
1917
2061
|
}()
|
|
1918
2062
|
/**
|
|
1919
|
-
* Cleans up registration-side state
|
|
2063
|
+
* Cleans up registration-side state for a hard stop, i.e. a registration that is gone
|
|
2064
|
+
* and must not be re-established by the SDK (Mobius registration-down event, or a
|
|
2065
|
+
* session superseded by another registration for the same user).
|
|
1920
2066
|
*
|
|
1921
2067
|
* Stops timers, resets transient flags, clears failover cache, sets status to
|
|
1922
2068
|
* INACTIVE, tears down the Mobius WebSocket (when enabled), and finally emits
|
|
1923
|
-
* `LINE_EVENTS.UNREGISTERED` so the SDK consumer is notified.
|
|
2069
|
+
* `LINE_EVENTS.UNREGISTERED` so the SDK consumer is notified. A superseded session
|
|
2070
|
+
* carries its `LineError` on that event as the reason the line will stay unregistered.
|
|
1924
2071
|
*
|
|
1925
2072
|
* Runs under the shared mutex to avoid racing with other registration flows.
|
|
1926
2073
|
*
|
|
1927
2074
|
* @param caller - Identifier of the caller, used for logs.
|
|
2075
|
+
* @param hardStop - Why the registration is being torn down as {@link HardStop}.
|
|
1928
2076
|
*/
|
|
1929
2077
|
)
|
|
1930
2078
|
}, {
|
|
1931
|
-
key: "
|
|
2079
|
+
key: "registrationCleanup",
|
|
1932
2080
|
value: (function () {
|
|
1933
|
-
var
|
|
2081
|
+
var _registrationCleanup = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31(caller, hardStop) {
|
|
1934
2082
|
var _this0 = this;
|
|
1935
2083
|
var loggerContext;
|
|
1936
|
-
return _regenerator.default.wrap(function (
|
|
1937
|
-
while (1) switch (
|
|
2084
|
+
return _regenerator.default.wrap(function (_context32) {
|
|
2085
|
+
while (1) switch (_context32.prev = _context32.next) {
|
|
1938
2086
|
case 0:
|
|
1939
2087
|
loggerContext = {
|
|
1940
2088
|
file: _constants2.REGISTRATION_FILE,
|
|
1941
|
-
method:
|
|
2089
|
+
method: caller
|
|
1942
2090
|
};
|
|
1943
|
-
_Logger.default.info("[".concat(caller, "] : Running
|
|
1944
|
-
|
|
1945
|
-
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
2091
|
+
_Logger.default.info("[".concat(caller, "] : Running ").concat(hardStop.reason, " cleanup"), loggerContext);
|
|
2092
|
+
_context32.next = 1;
|
|
2093
|
+
return this.mutex.runExclusive(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
|
|
1946
2094
|
var _t9;
|
|
1947
|
-
return _regenerator.default.wrap(function (
|
|
1948
|
-
while (1) switch (
|
|
2095
|
+
return _regenerator.default.wrap(function (_context31) {
|
|
2096
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
1949
2097
|
case 0:
|
|
1950
2098
|
_this0.clearFailbackTimer();
|
|
1951
2099
|
_this0.clearKeepaliveTimer();
|
|
@@ -1955,43 +2103,43 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1955
2103
|
_this0.retryAfter = undefined;
|
|
1956
2104
|
_this0.registerRetry = false;
|
|
1957
2105
|
_this0.clearFailoverState();
|
|
1958
|
-
_this0.setStatus(
|
|
2106
|
+
_this0.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1959
2107
|
if (!_this0.apiRequest.isSocketEnabled()) {
|
|
1960
|
-
|
|
2108
|
+
_context31.next = 4;
|
|
1961
2109
|
break;
|
|
1962
2110
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
2111
|
+
_context31.prev = 1;
|
|
2112
|
+
_context31.next = 2;
|
|
1965
2113
|
return _this0.apiRequest.disconnectFromMobiusSocket({
|
|
1966
2114
|
code: 3050,
|
|
1967
2115
|
reason: 'done (permanent)'
|
|
1968
2116
|
});
|
|
1969
2117
|
case 2:
|
|
1970
|
-
_Logger.default.log(
|
|
1971
|
-
|
|
2118
|
+
_Logger.default.log("Mobius socket disconnect complete after ".concat(hardStop.reason), loggerContext);
|
|
2119
|
+
_context31.next = 4;
|
|
1972
2120
|
break;
|
|
1973
2121
|
case 3:
|
|
1974
|
-
|
|
1975
|
-
_t9 =
|
|
1976
|
-
_Logger.default.warn("Mobius socket disconnect failed after
|
|
2122
|
+
_context31.prev = 3;
|
|
2123
|
+
_t9 = _context31["catch"](1);
|
|
2124
|
+
_Logger.default.warn("Mobius socket disconnect failed after ".concat(hardStop.reason, ": ").concat(String(_t9)), loggerContext);
|
|
1977
2125
|
case 4:
|
|
1978
|
-
_this0.lineEmitter(
|
|
2126
|
+
_this0.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED, undefined, hardStop.error);
|
|
1979
2127
|
case 5:
|
|
1980
2128
|
case "end":
|
|
1981
|
-
return
|
|
2129
|
+
return _context31.stop();
|
|
1982
2130
|
}
|
|
1983
|
-
},
|
|
2131
|
+
}, _callee30, null, [[1, 3]]);
|
|
1984
2132
|
})));
|
|
1985
2133
|
case 1:
|
|
1986
2134
|
case "end":
|
|
1987
|
-
return
|
|
2135
|
+
return _context32.stop();
|
|
1988
2136
|
}
|
|
1989
|
-
},
|
|
2137
|
+
}, _callee31, this);
|
|
1990
2138
|
}));
|
|
1991
|
-
function
|
|
1992
|
-
return
|
|
2139
|
+
function registrationCleanup(_x24, _x25) {
|
|
2140
|
+
return _registrationCleanup.apply(this, arguments);
|
|
1993
2141
|
}
|
|
1994
|
-
return
|
|
2142
|
+
return registrationCleanup;
|
|
1995
2143
|
}())
|
|
1996
2144
|
}]);
|
|
1997
2145
|
}();
|