Skip to content

eventObject timeout has a timeout set when it's not expecting a response #152

Closed
@gak10100

Description

@gak10100

Inside the _processOutboundEvent event Objects are created and a timeout is set. The problem is that a timeout is set for event objects that aren't expecting a response.

eventNode.data = eventObject;
let ackTimeout = options.ackTimeout == null ? this.ackTimeout : options.ackTimeout;
eventObject.timeout = setTimeout(() => {
this._handleEventAckTimeout(eventObject, eventNode);
}, ackTimeout);
this._outboundBuffer.append(eventNode);

Inside the _flushOutboundBuffer function Event Objects are passed off to the transport object

AGClientSocket.prototype._flushOutboundBuffer = function () {
let currentNode = this._outboundBuffer.head;
let nextNode;
while (currentNode) {
nextNode = currentNode.next;
let eventObject = currentNode.data;
currentNode.detach();
this.transport.transmitObject(eventObject);
currentNode = nextNode;
}
};

but because the event object doesn't have a callback it doesn't add it to the callbackMap

https://github.com/SocketCluster/socketcluster-client/blob/f5514434f51369166de9e5dafba2f7da147fb93e/lib/transport.js#L373C10-L387

This can lead to the timeout to hang even after the client has disconnected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions