Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ rules:
class-methods-use-this: 0
no-await-in-loop: 0
no-multi-assign: 0
arrow-parens: [2, "as-needed"]
operator-linebreak: ["error", "after"]
no-mixed-operators: 0
7 changes: 7 additions & 0 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
changelog:
-
changes:
-
text: "Disables the presence heartbeat by default when a subscribe is called. Presence heartbeat can still be enabled explicitly."
type: improvement
date: 2019-05-09
version: v4.24.0
-
changes:
-
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## [v4.24.0](https://github.com/pubnub/javascript/tree/v4.24.0)
May-09-2019


[Full Changelog](https://github.com/pubnub/javascript/compare/v4.23.0...v4.24.0)



- ⭐ Disables the presence heartbeat by default when a subscribe is called. Presence heartbeat can still be enabled explicitly.



## [v4.23.0](https://github.com/pubnub/javascript/tree/v4.23.0)
March-14-2019

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ please use the [master_3x](https://github.com/pubnub/javascript/tree/master_3x)



* https://cdn.pubnub.com/sdk/javascript/pubnub.4.23.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.23.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.24.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.4.24.0.js
57 changes: 38 additions & 19 deletions dist/titanium/pubnub.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 4.23.0 / Consumer */
/*! 4.24.0 / Consumer */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -502,12 +502,14 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setAuthKey',
value: function setAuthKey(val) {
this.authKey = val;return this;
this.authKey = val;
return this;
}
}, {
key: 'setCipherKey',
value: function setCipherKey(val) {
this.cipherKey = val;return this;
this.cipherKey = val;
return this;
}
}, {
key: 'getUUID',
Expand All @@ -529,7 +531,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setFilterExpression',
value: function setFilterExpression(val) {
this.filterExpression = val;return this;
this.filterExpression = val;
return this;
}
}, {
key: 'getPresenceTimeout',
Expand All @@ -556,7 +559,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setHeartbeatInterval',
value: function setHeartbeatInterval(val) {
this._heartbeatInterval = val;return this;
this._heartbeatInterval = val;
return this;
}
}, {
key: 'getSubscribeTimeout',
Expand All @@ -566,7 +570,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setSubscribeTimeout',
value: function setSubscribeTimeout(val) {
this._subscribeRequestTimeout = val;return this;
this._subscribeRequestTimeout = val;
return this;
}
}, {
key: 'getTransactionTimeout',
Expand All @@ -576,7 +581,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setTransactionTimeout',
value: function setTransactionTimeout(val) {
this._transactionalRequestTimeout = val;return this;
this._transactionalRequestTimeout = val;
return this;
}
}, {
key: 'isSendBeaconEnabled',
Expand All @@ -586,12 +592,13 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setSendBeaconConfig',
value: function setSendBeaconConfig(val) {
this._useSendBeacon = val;return this;
this._useSendBeacon = val;
return this;
}
}, {
key: 'getVersion',
value: function getVersion() {
return '4.23.0';
return '4.24.0';
}
}, {
key: '_decideUUID',
Expand Down Expand Up @@ -1441,7 +1448,9 @@ return /******/ (function(modules) { // webpackBootstrap
});

channelGroups.forEach(function (channelGroup) {
if (channelGroup in _this._channelGroups) _this._channelGroups[channelGroup].state = state;
if (channelGroup in _this._channelGroups) {
_this._channelGroups[channelGroup].state = state;
}
});

return this._setStateEndpoint({ state: state, channels: channels, channelGroups: channelGroups }, callback);
Expand Down Expand Up @@ -1501,11 +1510,13 @@ return /******/ (function(modules) { // webpackBootstrap
_args$withPresence = args.withPresence,
withPresence = _args$withPresence === undefined ? false : _args$withPresence,
_args$withHeartbeats = args.withHeartbeats,
withHeartbeats = _args$withHeartbeats === undefined ? true : _args$withHeartbeats;
withHeartbeats = _args$withHeartbeats === undefined ? false : _args$withHeartbeats;


if (!this._config.subscribeKey || this._config.subscribeKey === '') {
if (console && console.log) console.log('subscribe key missing; aborting subscribe');
if (console && console.log) {
console.log('subscribe key missing; aborting subscribe');
}
return;
}

Expand Down Expand Up @@ -1609,7 +1620,10 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'unsubscribeAll',
value: function unsubscribeAll(isOffline) {
this.adaptUnsubscribeChange({ channels: this.getSubscribedChannels(), channelGroups: this.getSubscribedChannelGroups() }, isOffline);
this.adaptUnsubscribeChange({
channels: this.getSubscribedChannels(),
channelGroups: this.getSubscribedChannelGroups()
}, isOffline);
}
}, {
key: 'getHeartbeatChannels',
Expand Down Expand Up @@ -1681,12 +1695,16 @@ return /******/ (function(modules) { // webpackBootstrap

this.getSubscribedChannels().forEach(function (channel) {
var channelState = _this5._channels[channel].state;
if (Object.keys(channelState).length) presenceState[channel] = channelState;
if (Object.keys(channelState).length) {
presenceState[channel] = channelState;
}
});

this.getSubscribedChannelGroups().forEach(function (channelGroup) {
var channelGroupState = _this5._channelGroups[channelGroup].state;
if (Object.keys(channelGroupState).length) presenceState[channelGroup] = channelGroupState;
if (Object.keys(channelGroupState).length) {
presenceState[channelGroup] = channelGroupState;
}
});

var onHeartbeat = function onHeartbeat(status) {
Expand All @@ -1709,7 +1727,8 @@ return /******/ (function(modules) { // webpackBootstrap
this._heartbeatEndpoint({
channels: heartbeatChannels,
channelGroups: heartbeatChannelGroups,
state: presenceState }, onHeartbeat.bind(this));
state: presenceState
}, onHeartbeat.bind(this));
}
}, {
key: '_startSubscribeLoop',
Expand All @@ -1722,14 +1741,14 @@ return /******/ (function(modules) { // webpackBootstrap
return channels.push(channel);
});
Object.keys(this._presenceChannels).forEach(function (channel) {
return channels.push(channel + '-pnpres');
channels.push(channel + '-pnpres');
});

Object.keys(this._channelGroups).forEach(function (channelGroup) {
return channelGroups.push(channelGroup);
channelGroups.push(channelGroup);
});
Object.keys(this._presenceChannelGroups).forEach(function (channelGroup) {
return channelGroups.push(channelGroup + '-pnpres');
channelGroups.push(channelGroup + '-pnpres');
});

if (channels.length === 0 && channelGroups.length === 0) {
Expand Down
6 changes: 3 additions & 3 deletions dist/titanium/pubnub.min.js

Large diffs are not rendered by default.

57 changes: 38 additions & 19 deletions dist/web/pubnub.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 4.23.0 / Consumer */
/*! 4.24.0 / Consumer */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -524,12 +524,14 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setAuthKey',
value: function setAuthKey(val) {
this.authKey = val;return this;
this.authKey = val;
return this;
}
}, {
key: 'setCipherKey',
value: function setCipherKey(val) {
this.cipherKey = val;return this;
this.cipherKey = val;
return this;
}
}, {
key: 'getUUID',
Expand All @@ -551,7 +553,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setFilterExpression',
value: function setFilterExpression(val) {
this.filterExpression = val;return this;
this.filterExpression = val;
return this;
}
}, {
key: 'getPresenceTimeout',
Expand All @@ -578,7 +581,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setHeartbeatInterval',
value: function setHeartbeatInterval(val) {
this._heartbeatInterval = val;return this;
this._heartbeatInterval = val;
return this;
}
}, {
key: 'getSubscribeTimeout',
Expand All @@ -588,7 +592,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setSubscribeTimeout',
value: function setSubscribeTimeout(val) {
this._subscribeRequestTimeout = val;return this;
this._subscribeRequestTimeout = val;
return this;
}
}, {
key: 'getTransactionTimeout',
Expand All @@ -598,7 +603,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setTransactionTimeout',
value: function setTransactionTimeout(val) {
this._transactionalRequestTimeout = val;return this;
this._transactionalRequestTimeout = val;
return this;
}
}, {
key: 'isSendBeaconEnabled',
Expand All @@ -608,12 +614,13 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'setSendBeaconConfig',
value: function setSendBeaconConfig(val) {
this._useSendBeacon = val;return this;
this._useSendBeacon = val;
return this;
}
}, {
key: 'getVersion',
value: function getVersion() {
return '4.23.0';
return '4.24.0';
}
}, {
key: '_decideUUID',
Expand Down Expand Up @@ -1463,7 +1470,9 @@ return /******/ (function(modules) { // webpackBootstrap
});

channelGroups.forEach(function (channelGroup) {
if (channelGroup in _this._channelGroups) _this._channelGroups[channelGroup].state = state;
if (channelGroup in _this._channelGroups) {
_this._channelGroups[channelGroup].state = state;
}
});

return this._setStateEndpoint({ state: state, channels: channels, channelGroups: channelGroups }, callback);
Expand Down Expand Up @@ -1523,11 +1532,13 @@ return /******/ (function(modules) { // webpackBootstrap
_args$withPresence = args.withPresence,
withPresence = _args$withPresence === undefined ? false : _args$withPresence,
_args$withHeartbeats = args.withHeartbeats,
withHeartbeats = _args$withHeartbeats === undefined ? true : _args$withHeartbeats;
withHeartbeats = _args$withHeartbeats === undefined ? false : _args$withHeartbeats;


if (!this._config.subscribeKey || this._config.subscribeKey === '') {
if (console && console.log) console.log('subscribe key missing; aborting subscribe');
if (console && console.log) {
console.log('subscribe key missing; aborting subscribe');
}
return;
}

Expand Down Expand Up @@ -1631,7 +1642,10 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'unsubscribeAll',
value: function unsubscribeAll(isOffline) {
this.adaptUnsubscribeChange({ channels: this.getSubscribedChannels(), channelGroups: this.getSubscribedChannelGroups() }, isOffline);
this.adaptUnsubscribeChange({
channels: this.getSubscribedChannels(),
channelGroups: this.getSubscribedChannelGroups()
}, isOffline);
}
}, {
key: 'getHeartbeatChannels',
Expand Down Expand Up @@ -1703,12 +1717,16 @@ return /******/ (function(modules) { // webpackBootstrap

this.getSubscribedChannels().forEach(function (channel) {
var channelState = _this5._channels[channel].state;
if (Object.keys(channelState).length) presenceState[channel] = channelState;
if (Object.keys(channelState).length) {
presenceState[channel] = channelState;
}
});

this.getSubscribedChannelGroups().forEach(function (channelGroup) {
var channelGroupState = _this5._channelGroups[channelGroup].state;
if (Object.keys(channelGroupState).length) presenceState[channelGroup] = channelGroupState;
if (Object.keys(channelGroupState).length) {
presenceState[channelGroup] = channelGroupState;
}
});

var onHeartbeat = function onHeartbeat(status) {
Expand All @@ -1731,7 +1749,8 @@ return /******/ (function(modules) { // webpackBootstrap
this._heartbeatEndpoint({
channels: heartbeatChannels,
channelGroups: heartbeatChannelGroups,
state: presenceState }, onHeartbeat.bind(this));
state: presenceState
}, onHeartbeat.bind(this));
}
}, {
key: '_startSubscribeLoop',
Expand All @@ -1744,14 +1763,14 @@ return /******/ (function(modules) { // webpackBootstrap
return channels.push(channel);
});
Object.keys(this._presenceChannels).forEach(function (channel) {
return channels.push(channel + '-pnpres');
channels.push(channel + '-pnpres');
});

Object.keys(this._channelGroups).forEach(function (channelGroup) {
return channelGroups.push(channelGroup);
channelGroups.push(channelGroup);
});
Object.keys(this._presenceChannelGroups).forEach(function (channelGroup) {
return channelGroups.push(channelGroup + '-pnpres');
channelGroups.push(channelGroup + '-pnpres');
});

if (channels.length === 0 && channelGroups.length === 0) {
Expand Down
6 changes: 3 additions & 3 deletions dist/web/pubnub.min.js

Large diffs are not rendered by default.

Loading