Skip to content

Commit c004052

Browse files
committed
Release v4.27.3
1 parent 43a7fd5 commit c004052

File tree

18 files changed

+215
-21
lines changed

18 files changed

+215
-21
lines changed

.pubnub.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ changelog:
33
-
44
changes:
55
-
6-
text: "disable presence heartbeats by default"
6+
text: "Support for APNS2 Push API"
7+
type: improvement
8+
-
9+
text: "Restore functionality to set heartbeat interval when presence timeout is set below the default"
710
type: bug
11+
date: 2020-01-06
12+
version: v4.27.3
13+
-
14+
changes:
815
-
16+
text: "disable presence heartbeats by default"
17+
type: bug
918
date: 2019-12-05
1019
version: v4.27.2
1120
-
@@ -792,4 +801,4 @@ supported-platforms:
792801
- "Ubuntu 14.04 and up"
793802
- "Windows 7 and up"
794803
version: "Pubnub Javascript for Node"
795-
version: "4.27.2"
804+
version: "4.27.3"

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
## [v4.27.2](https://github.com/pubnub/javascript/tree/v4.27.2)
1+
## [v4.27.3](https://github.com/pubnub/javascript/tree/v4.27.3)
2+
January-06-2020
3+
4+
5+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.27.2...v4.27.3)
6+
7+
8+
9+
- ⭐ Support for APNS2 Push API
10+
- ⭐ Restore functionality to set heartbeat interval when presence timeout is set below the default
11+
12+
13+
## [v4.27.2](https://github.com/pubnub/javascript/tree/v4.27.2)
214
December-05-2019
315

416

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ please use the [master_3x](https://github.com/pubnub/javascript/tree/master_3x)
2222

2323

2424

25-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.27.2.min.js
26-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.27.2.js
25+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.27.3.min.js
26+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.27.3.js

dist/titanium/pubnub.js

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.27.2 / Consumer */
1+
/*! 4.27.3 / Consumer */
22
exports["PubNub"] =
33
/******/ (function(modules) { // webpackBootstrap
44
/******/ // The module cache
@@ -303,6 +303,8 @@ var _default = function () {
303303

304304
_defineProperty(this, "_useSendBeacon", void 0);
305305

306+
_defineProperty(this, "_PNSDKSuffix", void 0);
307+
306308
_defineProperty(this, "requestMessageCountThreshold", void 0);
307309

308310
_defineProperty(this, "restore", void 0);
@@ -315,6 +317,7 @@ var _default = function () {
315317

316318
_defineProperty(this, "customDecrypt", void 0);
317319

320+
this._PNSDKSuffix = {};
318321
this._db = db;
319322
this.instanceId = "pn-".concat(_uuid["default"].createUUID());
320323
this.secretKey = setup.secretKey || setup.secret_key;
@@ -352,7 +355,12 @@ var _default = function () {
352355
this.setTransactionTimeout(setup.transactionalRequestTimeout || 15 * 1000);
353356
this.setSubscribeTimeout(setup.subscribeRequestTimeout || 310 * 1000);
354357
this.setSendBeaconConfig(setup.useSendBeacon || true);
355-
this.setPresenceTimeout(setup.presenceTimeout || PRESENCE_TIMEOUT_DEFAULT);
358+
359+
if (setup.presenceTimeout) {
360+
this.setPresenceTimeout(setup.presenceTimeout);
361+
} else {
362+
this._presenceTimeout = PRESENCE_TIMEOUT_DEFAULT;
363+
}
356364

357365
if (setup.heartbeatInterval != null) {
358366
this.setHeartbeatInterval(setup.heartbeatInterval);
@@ -416,6 +424,7 @@ var _default = function () {
416424
console.log('WARNING: Presence timeout is less than the minimum. Using minimum value: ', this._presenceTimeout);
417425
}
418426

427+
this.setHeartbeatInterval(this._presenceTimeout / 2 - 1);
419428
return this;
420429
}
421430
}, {
@@ -470,7 +479,21 @@ var _default = function () {
470479
}, {
471480
key: "getVersion",
472481
value: function getVersion() {
473-
return '4.27.2';
482+
return '4.27.3';
483+
}
484+
}, {
485+
key: "_addPnsdkSuffix",
486+
value: function _addPnsdkSuffix(name, suffix) {
487+
this._PNSDKSuffix[name] = suffix;
488+
}
489+
}, {
490+
key: "_getPnsdkSuffix",
491+
value: function _getPnsdkSuffix(separator) {
492+
var _this = this;
493+
494+
return Object.keys(this._PNSDKSuffix).reduce(function (result, key) {
495+
return result + separator + _this._PNSDKSuffix[key];
496+
}, '');
474497
}
475498
}, {
476499
key: "_decideUUID",
@@ -1430,6 +1453,11 @@ var _default = function () {
14301453
value: function getVersion() {
14311454
return this._config.getVersion();
14321455
}
1456+
}, {
1457+
key: "_addPnsdkSuffix",
1458+
value: function _addPnsdkSuffix(name, suffix) {
1459+
this._config._addPnsdkSuffix(name, suffix);
1460+
}
14331461
}, {
14341462
key: "networkDownDetected",
14351463
value: function networkDownDetected() {
@@ -3719,6 +3747,13 @@ function generatePNSDK(config) {
37193747
}
37203748

37213749
base += "/".concat(config.getVersion());
3750+
3751+
var pnsdkSuffix = config._getPnsdkSuffix(' ');
3752+
3753+
if (pnsdkSuffix.length > 0) {
3754+
base += pnsdkSuffix;
3755+
}
3756+
37223757
return base;
37233758
}
37243759

dist/titanium/pubnub.min.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.

dist/web/pubnub.js

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.27.2 / Consumer */
1+
/*! 4.27.3 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -312,6 +312,8 @@ var _default = function () {
312312

313313
_defineProperty(this, "_useSendBeacon", void 0);
314314

315+
_defineProperty(this, "_PNSDKSuffix", void 0);
316+
315317
_defineProperty(this, "requestMessageCountThreshold", void 0);
316318

317319
_defineProperty(this, "restore", void 0);
@@ -324,6 +326,7 @@ var _default = function () {
324326

325327
_defineProperty(this, "customDecrypt", void 0);
326328

329+
this._PNSDKSuffix = {};
327330
this._db = db;
328331
this.instanceId = "pn-".concat(_uuid["default"].createUUID());
329332
this.secretKey = setup.secretKey || setup.secret_key;
@@ -361,7 +364,12 @@ var _default = function () {
361364
this.setTransactionTimeout(setup.transactionalRequestTimeout || 15 * 1000);
362365
this.setSubscribeTimeout(setup.subscribeRequestTimeout || 310 * 1000);
363366
this.setSendBeaconConfig(setup.useSendBeacon || true);
364-
this.setPresenceTimeout(setup.presenceTimeout || PRESENCE_TIMEOUT_DEFAULT);
367+
368+
if (setup.presenceTimeout) {
369+
this.setPresenceTimeout(setup.presenceTimeout);
370+
} else {
371+
this._presenceTimeout = PRESENCE_TIMEOUT_DEFAULT;
372+
}
365373

366374
if (setup.heartbeatInterval != null) {
367375
this.setHeartbeatInterval(setup.heartbeatInterval);
@@ -425,6 +433,7 @@ var _default = function () {
425433
console.log('WARNING: Presence timeout is less than the minimum. Using minimum value: ', this._presenceTimeout);
426434
}
427435

436+
this.setHeartbeatInterval(this._presenceTimeout / 2 - 1);
428437
return this;
429438
}
430439
}, {
@@ -479,7 +488,21 @@ var _default = function () {
479488
}, {
480489
key: "getVersion",
481490
value: function getVersion() {
482-
return '4.27.2';
491+
return '4.27.3';
492+
}
493+
}, {
494+
key: "_addPnsdkSuffix",
495+
value: function _addPnsdkSuffix(name, suffix) {
496+
this._PNSDKSuffix[name] = suffix;
497+
}
498+
}, {
499+
key: "_getPnsdkSuffix",
500+
value: function _getPnsdkSuffix(separator) {
501+
var _this = this;
502+
503+
return Object.keys(this._PNSDKSuffix).reduce(function (result, key) {
504+
return result + separator + _this._PNSDKSuffix[key];
505+
}, '');
483506
}
484507
}, {
485508
key: "_decideUUID",
@@ -3282,6 +3305,11 @@ var _default = function () {
32823305
value: function getVersion() {
32833306
return this._config.getVersion();
32843307
}
3308+
}, {
3309+
key: "_addPnsdkSuffix",
3310+
value: function _addPnsdkSuffix(name, suffix) {
3311+
this._config._addPnsdkSuffix(name, suffix);
3312+
}
32853313
}, {
32863314
key: "networkDownDetected",
32873315
value: function networkDownDetected() {
@@ -5571,6 +5599,13 @@ function generatePNSDK(config) {
55715599
}
55725600

55735601
base += "/".concat(config.getVersion());
5602+
5603+
var pnsdkSuffix = config._getPnsdkSuffix(' ');
5604+
5605+
if (pnsdkSuffix.length > 0) {
5606+
base += pnsdkSuffix;
5607+
}
5608+
55745609
return base;
55755610
}
55765611

dist/web/pubnub.min.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

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

0 commit comments

Comments
 (0)