Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

There is a possibility that It isn't catching "open" at LiveEngage server failure. #135

Open
tubone24 opened this issue Nov 9, 2020 · 0 comments

Comments

@tubone24
Copy link

tubone24 commented Nov 9, 2020

Background

When using AgentSDK.js to connect to LiveEngage server, there was an issue that occurred after the "init" process was started, but the action was frozen.

What's the problem?

The behavior got stuck in the following areas, as I guessed from the our server's logs.

https://github.com/LivePersonInc/node-agent-sdk/blob/master/lib/AgentSDK.js#L323

In transport.js, when creating a websocket instance in the code, it was implemented by receiving "open" from the websocket instances and emitting it as it is.

https://github.com/LivePersonInc/node-agent-sdk/blob/master/lib/Transport.js#L62

However, due to some effects (e.g., LiveEngage Server failure), there was the case that didn't emit "open" from a websocket instance because of not connected when creating the instance, so that our code was stopped working.

How should you fix this?

I thin it is preferable to use "setTimeout" to force the connection to be dropped if the "open" is not emitted for a certain period of time, and reconnect it.

And also I haven't tested it myself yet, but there seems to be a timeout option in Websocket.
(I'm sorry that I haven't checked it properly, so it may be a meaningless option.)
https://github.com/websockets/ws/blob/3d5066a7cad9fe3176002916aeda720a7b5ee419/lib/websocket.js#L470

@tubone24 tubone24 changed the title If you don't set the timeout option in websocket instantiating in trasport.js, there is a possibility that It isn't catching "open" at LiveEngage server failure. There is a possibility that It isn't catching "open" at LiveEngage server failure. Nov 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant