twilio-sync
Advanced tools
Comparing version 0.4.0-dev-build.127 to 0.4.0-dev-build.134
@@ -271,3 +271,5 @@ 'use strict'; | ||
_this3._beginReplayTimeout(response.body.estimated_delivery_in_ms, subscribed, action); | ||
if (subscribed.correlationId === correlationId) { | ||
_this3._beginReplayTimeout(response.body.estimated_delivery_in_ms, subscribed, action, correlationId); | ||
} | ||
} | ||
@@ -291,3 +293,3 @@ } catch (err) { | ||
}).catch(function (e) { | ||
_logger2.default.info('failed an attempt to ' + action + ' subscriptions; retrying', e); | ||
_logger2.default.info('Failed an attempt to ' + action + ' subscriptions (c:' + correlationId + '); retrying', e); | ||
var _iteratorNormalCompletion4 = true; | ||
@@ -361,3 +363,3 @@ var _didIteratorError4 = false; | ||
value: function _request(action, correlationId, requests) { | ||
_logger2.default.debug('Modifying server subscriptions: ', action, requests); | ||
_logger2.default.debug('Modifying server subscriptions:', action, correlationId, requests); | ||
/* eslint-disable camelcase */ | ||
@@ -376,3 +378,3 @@ var requestBody = { | ||
key: '_beginReplayTimeout', | ||
value: function _beginReplayTimeout(timeout, subscription, action) { | ||
value: function _beginReplayTimeout(timeout, subscription, action, failingCorrelationId) { | ||
var _this4 = this; | ||
@@ -384,6 +386,8 @@ | ||
subscription.pendingPokeTimer = setTimeout(function () { | ||
_logger2.default.debug('Attempt to ' + action + ' ' + subscription.sid + ' timed out without confirmation; trying again.'); | ||
subscription.correlationId = null; | ||
_this4._persisted.delete(subscription.sid); | ||
_this4._persist(); | ||
if (subscription.correlationId === failingCorrelationId) { | ||
_logger2.default.debug('Attempt to ' + action + ' ' + subscription.sid + ' (c:' + failingCorrelationId + ') timed out without confirmation; trying again.'); | ||
subscription.correlationId = null; | ||
_this4._persisted.delete(subscription.sid); | ||
_this4._persist(); | ||
} | ||
}, timeout); | ||
@@ -489,3 +493,3 @@ } | ||
if (message.replay_status === 'interrupted') { | ||
_logger2.default.debug('Event Replay for subscription to ' + sid + ' interrupted; continuing eagerly.'); | ||
_logger2.default.debug('Event Replay for subscription to ' + sid + ' (c:' + correlationId + ') interrupted; continuing eagerly.'); | ||
clearTimeout(subscriptionIntent.pendingPokeTimer); | ||
@@ -497,3 +501,3 @@ subscriptionIntent.pendingPokeTimer = null; | ||
} else if (message.replay_status === 'completed') { | ||
_logger2.default.debug('Event Replay for subscription to ' + sid + ' completed. Subscription is ready.'); | ||
_logger2.default.debug('Event Replay for subscription to ' + sid + ' (c:' + correlationId + ') completed. Subscription is ready.'); | ||
@@ -508,3 +512,3 @@ clearTimeout(subscriptionIntent.pendingPokeTimer); | ||
} else { | ||
_logger2.default.debug('Late message (correlation_id: ' + message.correlation_id + ') dropped.'); | ||
_logger2.default.debug('Late message for ' + message.object_sid + ' (c:' + correlationId + ') dropped.'); | ||
} | ||
@@ -524,3 +528,3 @@ this._persist(); | ||
} else { | ||
_logger2.default.debug('Late message (correlation_id: ' + message.correlation_id + ') dropped.'); | ||
_logger2.default.debug('Late message for ' + message.object_sid + ' (c:' + correlationId + ') dropped.'); | ||
} | ||
@@ -527,0 +531,0 @@ this._persist(); |
{ | ||
"name": "twilio-sync", | ||
"version": "0.4.0-dev-build.127", | ||
"version": "0.4.0-dev-build.134", | ||
"description": "Twilio Sync client library", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1577593
21624