comprodls-sdk 2.76.0 → 2.76.1
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.
|
@@ -55,8 +55,7 @@ module.exports = function () {
|
|
|
55
55
|
if(!_globalSubscription.includes(pubNubChannel)) {
|
|
56
56
|
_globalSubscription.push(pubNubChannel);
|
|
57
57
|
_globalSubscriptionStatus[pubNubChannel] = {
|
|
58
|
-
status: 'pending'
|
|
59
|
-
pushedEventIdentifier: pubNubChannel.split('.*')[0]
|
|
58
|
+
status: 'pending'
|
|
60
59
|
};
|
|
61
60
|
_eventEmitter.on(pubNubChannel, handler);
|
|
62
61
|
_subscribeToPubNubChannels(pubNubChannel);
|
|
@@ -79,6 +78,10 @@ module.exports = function () {
|
|
|
79
78
|
|
|
80
79
|
var _translatePubnubStatus = function(status, options) {
|
|
81
80
|
var channels = [], error, successObj;
|
|
81
|
+
|
|
82
|
+
// If polling has been initiated, ignore all punnub status
|
|
83
|
+
if (bPollingInitiated) return;
|
|
84
|
+
|
|
82
85
|
switch (status.category) {
|
|
83
86
|
case "PNConnectedCategory":
|
|
84
87
|
if(status.operation === "PNSubscribeOperation") {
|
|
@@ -105,7 +108,6 @@ module.exports = function () {
|
|
|
105
108
|
}
|
|
106
109
|
break;
|
|
107
110
|
case "PNAccessDeniedCategory":
|
|
108
|
-
if(bPollingInitiated) break;
|
|
109
111
|
if(status.operation === "PNSubscribeOperation") {
|
|
110
112
|
var errorData = {
|
|
111
113
|
payload: JSON.parse(status.errorData.response.text).payload,
|
|
@@ -130,7 +132,6 @@ module.exports = function () {
|
|
|
130
132
|
case "PNBadRequestCategory":
|
|
131
133
|
case "PNNetworkDownCategory":
|
|
132
134
|
case "PNNetworkUpCategory":
|
|
133
|
-
if(bPollingInitiated) break;
|
|
134
135
|
error = {
|
|
135
136
|
message: "PushX Error", status: status.statusCode,
|
|
136
137
|
pushXError: status
|
|
@@ -169,7 +170,6 @@ module.exports = function () {
|
|
|
169
170
|
// Handle reconnected category status.
|
|
170
171
|
break;
|
|
171
172
|
default:
|
|
172
|
-
if(bPollingInitiated) break;
|
|
173
173
|
// Emit error for other status-category received from pubnub
|
|
174
174
|
error = {
|
|
175
175
|
message: "PushX Error",
|
|
@@ -247,6 +247,7 @@ module.exports = function () {
|
|
|
247
247
|
_globalSubscription = [];
|
|
248
248
|
bStatusSubscribed = false;
|
|
249
249
|
_globalSubscriptionStatus = {};
|
|
250
|
+
bPollingInitiated = false;
|
|
250
251
|
}
|
|
251
252
|
_pubnubClient = undefined;
|
|
252
253
|
};
|