Skip to content

Commit 64a1a84

Browse files
raipubnubdavidnub
authored andcommitted
Release v4.24.4 (#160)
* add minimum presence timeout (#159) * Bump versions for 4.24.4 release Includes compiled stuff - David
1 parent 3197728 commit 64a1a84

File tree

11 files changed

+93
-26
lines changed

11 files changed

+93
-26
lines changed

.pubnub.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
---
22
changelog:
3+
-
4+
changes:
5+
-
6+
text: "Add minimum presence timeout"
7+
type: improvement
8+
date: 2019-07-26
9+
version: v4.24.4
310
-
411
changes:
512
-
@@ -663,4 +670,4 @@ supported-platforms:
663670
- "Ubuntu 14.04 and above"
664671
- "Windows 7, 8, 10"
665672
version: "Pubnub Javascript for Node"
666-
version: "4.24.3"
673+
version: "4.24.4"

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
## [v4.24.3](https://github.com/pubnub/javascript/tree/v4.24.3)
1+
## [v4.24.4](https://github.com/pubnub/javascript/tree/v4.24.4)
2+
July-26-2019
3+
4+
5+
[Full Changelog](https://github.com/pubnub/javascript/compare/v4.24.0...v4.24.4)
6+
7+
8+
9+
- ⭐ Add minimum presence timeout
10+
11+
12+
13+
## [v4.24.3](https://github.com/pubnub/javascript/tree/v4.24.3)
214
June-19-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.24.3.min.js
26-
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.24.3.js
25+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.24.4.min.js
26+
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.24.4.js

dist/titanium/pubnub.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.24.3 / Consumer */
1+
/*! 4.24.4 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -429,6 +429,9 @@ return /******/ (function(modules) { // webpackBootstrap
429429

430430
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
431431

432+
var PRESENCE_TIMEOUT_MINIMUM = 20;
433+
var PRESENCE_TIMEOUT_DEFAULT = 300;
434+
432435
var _class = function () {
433436
function _class(_ref) {
434437
var setup = _ref.setup,
@@ -485,7 +488,7 @@ return /******/ (function(modules) { // webpackBootstrap
485488

486489
this.setSendBeaconConfig(setup.useSendBeacon || true);
487490

488-
this.setPresenceTimeout(setup.presenceTimeout || 300);
491+
this.setPresenceTimeout(setup.presenceTimeout || PRESENCE_TIMEOUT_DEFAULT);
489492

490493
if (setup.heartbeatInterval != null) {
491494
this.setHeartbeatInterval(setup.heartbeatInterval);
@@ -542,8 +545,16 @@ return /******/ (function(modules) { // webpackBootstrap
542545
}, {
543546
key: 'setPresenceTimeout',
544547
value: function setPresenceTimeout(val) {
545-
this._presenceTimeout = val;
548+
if (val >= PRESENCE_TIMEOUT_MINIMUM) {
549+
this._presenceTimeout = val;
550+
} else {
551+
this._presenceTimeout = PRESENCE_TIMEOUT_MINIMUM;
552+
553+
console.log('WARNING: Presence timeout is less than the minimum. Using minimum value: ', this._presenceTimeout);
554+
}
555+
546556
this.setHeartbeatInterval(this._presenceTimeout / 2 - 1);
557+
547558
return this;
548559
}
549560
}, {
@@ -598,7 +609,7 @@ return /******/ (function(modules) { // webpackBootstrap
598609
}, {
599610
key: 'getVersion',
600611
value: function getVersion() {
601-
return '4.24.3';
612+
return '4.24.4';
602613
}
603614
}, {
604615
key: '_decideUUID',

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: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! 4.24.3 / Consumer */
1+
/*! 4.24.4 / Consumer */
22
(function webpackUniversalModuleDefinition(root, factory) {
33
if(typeof exports === 'object' && typeof module === 'object')
44
module.exports = factory();
@@ -451,6 +451,9 @@ return /******/ (function(modules) { // webpackBootstrap
451451

452452
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
453453

454+
var PRESENCE_TIMEOUT_MINIMUM = 20;
455+
var PRESENCE_TIMEOUT_DEFAULT = 300;
456+
454457
var _class = function () {
455458
function _class(_ref) {
456459
var setup = _ref.setup,
@@ -507,7 +510,7 @@ return /******/ (function(modules) { // webpackBootstrap
507510

508511
this.setSendBeaconConfig(setup.useSendBeacon || true);
509512

510-
this.setPresenceTimeout(setup.presenceTimeout || 300);
513+
this.setPresenceTimeout(setup.presenceTimeout || PRESENCE_TIMEOUT_DEFAULT);
511514

512515
if (setup.heartbeatInterval != null) {
513516
this.setHeartbeatInterval(setup.heartbeatInterval);
@@ -564,8 +567,16 @@ return /******/ (function(modules) { // webpackBootstrap
564567
}, {
565568
key: 'setPresenceTimeout',
566569
value: function setPresenceTimeout(val) {
567-
this._presenceTimeout = val;
570+
if (val >= PRESENCE_TIMEOUT_MINIMUM) {
571+
this._presenceTimeout = val;
572+
} else {
573+
this._presenceTimeout = PRESENCE_TIMEOUT_MINIMUM;
574+
575+
console.log('WARNING: Presence timeout is less than the minimum. Using minimum value: ', this._presenceTimeout);
576+
}
577+
568578
this.setHeartbeatInterval(this._presenceTimeout / 2 - 1);
579+
569580
return this;
570581
}
571582
}, {
@@ -620,7 +631,7 @@ return /******/ (function(modules) { // webpackBootstrap
620631
}, {
621632
key: 'getVersion',
622633
value: function getVersion() {
623-
return '4.24.3';
634+
return '4.24.4';
624635
}
625636
}, {
626637
key: '_decideUUID',

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: 14 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.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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pubnub",
3-
"version": "4.24.3",
3+
"version": "4.24.4",
44
"author": "PubNub <[email protected]>",
55
"description": "Publish & Subscribe Real-time Messaging with PubNub",
66
"bin": {},

src/core/components/config.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import {
99
ProxyStruct,
1010
} from '../flow_interfaces';
1111

12+
const PRESENCE_TIMEOUT_MINIMUM: number = 20;
13+
const PRESENCE_TIMEOUT_DEFAULT: number = 300;
14+
1215
type ConfigConstructArgs = {
1316
setup: InternalSetupStruct,
1417
db: DatabaseInterface,
@@ -186,7 +189,7 @@ export default class {
186189
// set config on beacon (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon) usage
187190
this.setSendBeaconConfig(setup.useSendBeacon || true);
188191
// how long the SDK will report the client to be alive before issuing a timeout
189-
this.setPresenceTimeout(setup.presenceTimeout || 300);
192+
this.setPresenceTimeout(setup.presenceTimeout || PRESENCE_TIMEOUT_DEFAULT);
190193

191194
if (setup.heartbeatInterval != null) {
192195
this.setHeartbeatInterval(setup.heartbeatInterval);
@@ -234,8 +237,20 @@ export default class {
234237
}
235238

236239
setPresenceTimeout(val: number): this {
237-
this._presenceTimeout = val;
240+
if (val >= PRESENCE_TIMEOUT_MINIMUM) {
241+
this._presenceTimeout = val;
242+
} else {
243+
this._presenceTimeout = PRESENCE_TIMEOUT_MINIMUM;
244+
245+
// eslint-disable-next-line no-console
246+
console.log(
247+
'WARNING: Presence timeout is less than the minimum. Using minimum value: ',
248+
this._presenceTimeout
249+
);
250+
}
251+
238252
this.setHeartbeatInterval(this._presenceTimeout / 2 - 1);
253+
239254
return this;
240255
}
241256

@@ -281,7 +296,7 @@ export default class {
281296
}
282297

283298
getVersion(): string {
284-
return '4.24.3';
299+
return '4.24.4';
285300
}
286301

287302
_decideUUID(providedUUID: string): string {

0 commit comments

Comments
 (0)