Skip to content

Commit 1cb6c95

Browse files
author
raipubnub
authored
Merge pull request pubnub#34 from davidnub/feature/CE-4217-presence-heartbeat
fix default presence timeout to undefined
2 parents e0901c2 + 77a5181 commit 1cb6c95

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/core/components/config.js

-2
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ export default class {
249249
);
250250
}
251251

252-
this.setHeartbeatInterval(this._presenceTimeout / 2 - 1);
253-
254252
return this;
255253
}
256254

test/integration/components/reconnection_manager.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('#components/reconnection_manger', () => {
2727
subscribeKey: 'mySubKey',
2828
publishKey: 'myPublishKey',
2929
uuid: 'myUUID',
30+
heartbeatInterval: 149,
3031
});
3132
clock = sinon.useFakeTimers();
3233
});

test/integration/components/subscription_manager.test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,23 @@ describe('#components/subscription_manager', () => {
2828
publishKey: 'myPublishKey',
2929
uuid: 'myUUID',
3030
autoNetworkDetection: false,
31+
heartbeatInterval: 149,
3132
});
3233
pubnubWithPassingHeartbeats = new PubNub({
3334
subscribeKey: 'mySubKey',
3435
publishKey: 'myPublishKey',
3536
uuid: 'myUUID',
3637
announceSuccessfulHeartbeats: true,
3738
autoNetworkDetection: false,
39+
heartbeatInterval: 149,
3840
});
3941
pubnubWithLimitedQueue = new PubNub({
4042
subscribeKey: 'mySubKey',
4143
publishKey: 'myPublishKey',
4244
uuid: 'myUUID',
4345
requestMessageCountThreshold: 1,
4446
autoNetworkDetection: false,
47+
heartbeatInterval: 149,
4548
});
4649
});
4750

@@ -554,7 +557,7 @@ describe('#components/subscription_manager', () => {
554557
}, 250);
555558
});
556559

557-
it('supports deduping on shawllow queue', (done) => {
560+
it('supports deduping on shallow queue', (done) => {
558561
pubnub._config.dedupeOnSubscribe = true;
559562
pubnub._config.maximumCacheSize = 1;
560563
let messageCount = 0;

test/unit/common.test.js

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import PubNub from '../../src/node/index';
66
import CryptoJS from '../../src/core/components/cryptography/hmac-sha256';
77

88
describe('#core / mounting point', () => {
9+
it('should have default heartbeat interval undefined', () => {
10+
let pn = new PubNub({});
11+
assert(pn._config.getHeartbeatInterval() === undefined);
12+
});
13+
914
it('supports UUID generation', () => {
1015
assert.equal(lilUUID.isUUID(PubNub.generateUUID()), true);
1116
});

0 commit comments

Comments
 (0)