Skip to content

Commit 35fb350

Browse files
author
Max Presman
committed
Merge branch 'master' into develop
2 parents 2b5fd08 + 814df85 commit 35fb350

File tree

19 files changed

+1104
-870
lines changed

19 files changed

+1104
-870
lines changed

.pubnub.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: javascript
2-
version: 4.13.0
2+
version: 4.15.0
33
schema: 1
44
scm: github.com/pubnub/javascript
55
files:
@@ -13,6 +13,16 @@ changelog:
1313
text: fix issue with where now and invalid server response
1414
- type: improvement
1515
text: fix issue with here now and invalid server response
16+
- version: v4.14.0
17+
date:
18+
changes:
19+
- type: improvement
20+
text: Allow disable of heartbeats by passing interval = 0
21+
- version: v4.13.0
22+
date:
23+
changes:
24+
- type: improvement
25+
text: patch up 503 reporting
1626
- version: v4.12.0
1727
date:
1828
changes:

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11

2+
## [v4.14.0](https://github.com/pubnub/javascript/tree/v4.14.0)
3+
4+
5+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.13.0...v4.14.0)
6+
7+
8+
- ⭐Allow disable of heartbeats by passing interval = 0
9+
10+
11+
12+
## [v4.13.0](https://github.com/pubnub/javascript/tree/v4.13.0)
13+
14+
15+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.12.0...v4.13.0)
16+
17+
18+
- ⭐patch up 503 reporting
19+
20+
21+
222
## [v4.12.0](https://github.com/pubnub/javascript/tree/v4.12.0)
323

424

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ please use the [master_3x](https://github.com/pubnub/javascript/tree/master_3x)
1919
- If you **need help** or have a **general question**, contact <[email protected]>
2020

2121
## CDN Links
22-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.13.0.min.js
23-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.13.0.js
22+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.15.0.min.js
23+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.15.0.js

dist/titanium/pubnub.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.13.0 / Consumer */
1+
/*! 4.15.0 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -786,7 +786,7 @@ return /******/ (function(modules) { // webpackBootstrap
786786
}, {
787787
key: 'getVersion',
788788
value: function getVersion() {
789-
return '4.13.0';
789+
return '4.15.0';
790790
}
791791
}, {
792792
key: '_decideUUID',
@@ -1677,6 +1677,11 @@ return /******/ (function(modules) { // webpackBootstrap
16771677
key: '_registerHeartbeatTimer',
16781678
value: function _registerHeartbeatTimer() {
16791679
this._stopHeartbeatTimer();
1680+
1681+
if (this._config.getHeartbeatInterval() === 0) {
1682+
return;
1683+
}
1684+
16801685
this._performHeartbeatLoop();
16811686
this._heartbeatTimer = setInterval(this._performHeartbeatLoop.bind(this), this._config.getHeartbeatInterval() * 1000);
16821687
}

dist/titanium/pubnub.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/web/pubnub.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.13.0 / Consumer */
1+
/*! 4.15.0 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -808,7 +808,7 @@ return /******/ (function(modules) { // webpackBootstrap
808808
}, {
809809
key: 'getVersion',
810810
value: function getVersion() {
811-
return '4.13.0';
811+
return '4.15.0';
812812
}
813813
}, {
814814
key: '_decideUUID',
@@ -1699,6 +1699,11 @@ return /******/ (function(modules) { // webpackBootstrap
16991699
key: '_registerHeartbeatTimer',
17001700
value: function _registerHeartbeatTimer() {
17011701
this._stopHeartbeatTimer();
1702+
1703+
if (this._config.getHeartbeatInterval() === 0) {
1704+
return;
1705+
}
1706+
17021707
this._performHeartbeatLoop();
17031708
this._heartbeatTimer = setInterval(this._performHeartbeatLoop.bind(this), this._config.getHeartbeatInterval() * 1000);
17041709
}
@@ -4560,6 +4565,15 @@ return /******/ (function(modules) { // webpackBootstrap
45604565
}
45614566

45624567
var parsedResponse = JSON.parse(resp.text);
4568+
4569+
if (parsedResponse.error && parsedResponse.error === 1 && parsedResponse.status && parsedResponse.message && parsedResponse.service) {
4570+
status.errorData = parsedResponse;
4571+
status.statusCode = parsedResponse.status;
4572+
status.error = true;
4573+
status.category = _this._detectErrorCategory(status);
4574+
return callback(status, null);
4575+
}
4576+
45634577
return callback(status, parsedResponse);
45644578
});
45654579
}

dist/web/pubnub.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/config.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/subscription_manager.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/components/subscription_manager.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/networking/modules/web-node.js

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/networking/modules/web-node.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pubnub",
3-
"version": "4.13.0",
3+
"version": "4.15.0",
44
"author": "PubNub <[email protected]>",
55
"description": "Publish & Subscribe Real-time Messaging with PubNub",
66
"bin": {},
@@ -45,7 +45,6 @@
4545
"eslint-plugin-flowtype": "^2.30.0",
4646
"eslint-plugin-import": "^2.2.0",
4747
"eslint-plugin-mocha": "^4.8.0",
48-
"eslint-plugin-react": "^6.9.0",
4948
"flow-bin": "^0.46.0",
5049
"gulp": "^3.9.1",
5150
"gulp-babel": "^6.1.2",
@@ -84,7 +83,6 @@
8483
"uglify-js": "^2.8.26",
8584
"underscore": "^1.8.3",
8685
"webpack": "^2.4.1",
87-
"webpack-dev-server": "^2.4.5",
8886
"webpack-stream": "^3.2.0"
8987
},
9088
"bundleDependencies": [],

src/core/components/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export default class {
209209
setSendBeaconConfig(val: boolean): this { this._useSendBeacon = val; return this; }
210210

211211
getVersion(): string {
212-
return '4.13.0';
212+
return '4.15.0';
213213
}
214214

215215
_decideUUID(providedUUID: string): string {

src/core/components/subscription_manager.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ export default class {
218218

219219
_registerHeartbeatTimer() {
220220
this._stopHeartbeatTimer();
221+
222+
// if the interval is 0, do not queue up heartbeating
223+
if (this._config.getHeartbeatInterval() === 0) {
224+
return;
225+
}
226+
221227
this._performHeartbeatLoop();
222228
this._heartbeatTimer = setInterval(this._performHeartbeatLoop.bind(this), this._config.getHeartbeatInterval() * 1000);
223229
}

src/networking/modules/web-node.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ function xdr(superagentConstruct: superagent, endpoint: EndpointDefinition, call
6060
}
6161

6262
let parsedResponse = JSON.parse(resp.text);
63+
64+
if (parsedResponse.error && parsedResponse.error === 1 && parsedResponse.status && parsedResponse.message && parsedResponse.service) {
65+
status.errorData = parsedResponse;
66+
status.statusCode = parsedResponse.status;
67+
status.error = true;
68+
status.category = this._detectErrorCategory(status);
69+
return callback(status, null);
70+
}
71+
6372
return callback(status, parsedResponse);
6473
});
6574
}

0 commit comments

Comments
 (0)