Skip to content

Commit 7294692

Browse files
committed
v19.2.6
1 parent bf05a76 commit 7294692

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const AGClientSocket = require('./lib/clientsocket');
22
const factory = require('./lib/factory');
3-
const version = '19.2.5';
3+
const version = '19.2.6';
44

55
module.exports.factory = factory;
66
module.exports.AGClientSocket = AGClientSocket;

lib/clientsocket.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,12 @@ AGClientSocket.prototype._flushOutboundBuffer = function () {
735735
while (currentNode) {
736736
nextNode = currentNode.next;
737737
let eventObject = currentNode.data;
738+
// For an eventObject which does not have a callback (no response expected),
739+
// the timeout can be cleared immediately as soon as the object is transmitted.
740+
if (!eventObject.callback) {
741+
clearTimeout(eventObject.timeout);
742+
delete eventObject.timeout;
743+
}
738744
currentNode.detach();
739745
this.transport.transmitObject(eventObject);
740746
currentNode = nextNode;
@@ -802,6 +808,9 @@ AGClientSocket.prototype._processOutboundEvent = function (event, data, options,
802808

803809
let ackTimeout = options.ackTimeout == null ? this.ackTimeout : options.ackTimeout;
804810

811+
// The timeout should always be set, including for events which do not expect
812+
// a response because they may sit on the _outboundBuffer for some time and
813+
// in-order processing should still be guaranteed.
805814
eventObject.timeout = setTimeout(() => {
806815
this._handleEventAckTimeout(eventObject, eventNode);
807816
}, ackTimeout);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "socketcluster-client",
33
"description": "SocketCluster JavaScript client",
4-
"version": "19.2.5",
4+
"version": "19.2.6",
55
"homepage": "https://socketcluster.io/",
66
"contributors": [
77
{

socketcluster-client.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.

0 commit comments

Comments
 (0)