'/participant/connection' were called twice with connect event
cythiaY opened this issue · 13 comments
Verison:1.1.12
Usage:
const customerChatSession = connect.ChatSession.create({
chatDetails: {
contactId: ****,
participantId: ****,
participantToken: ****,
},
options: {
region: "us-west-2",
},
type: connect.ChatSession.SessionTypes.CUSTOMER,
});
await customerChatSession.connect();
Other,I can't pass “Type” parameter to function connect
like CreateParticipantConnection
This should be two separate calls to the participant service. The first one is an OPTIONS method, the second the actual POST call.
Can anyone help me?😣
Hi, I have a few questions
- do you know if this is a new issue in the latest version or was it existing in old versions as well?
- can you check in browser how many websocket connections were established?
Please let me know. Thanks
This behavior is ongoing for some time. Possibly since the beginning of the library. There was a release awhile back that was designed to eliminate the double calls, but it was rolled back in the next release because of some issues that I do not have details on. The release that addressed this was https://github.com/amazon-connect/amazon-connect-chatjs/tree/1.0.7, then it was rolled back.
This behavior is ongoing for some time. Possibly since the beginning of the library. There was a release awhile back that was designed to eliminate the double calls, but it was rolled back in the next release because of some issues that I do not have details on. The release that addressed this was https://github.com/amazon-connect/amazon-connect-chatjs/tree/1.0.7, then it was rolled back.
Verison 1.0.7 doesn't work, even without TS.
When will u fix this problem in the future? 😊
We have the item to fix it in our backlog but it hasn't been prioritized yet. Can you explain more on how this behavior becomes a problem for you?
It's not urgent now.
We just listen to the ’connect‘ event in server to do something. We have found another workaround.
I am see the same behaviour, the connection is called twice, each time it turn a different websocket url(token is different), the library use the 2nd response token to establish the websocket.
I believe the problem probably related to the connectionDetailsProvider.js
baseConnectionHelper.js (line 32) ---> invokes this.connectionDetailsProvider.fetchConnectionToken()
LpcConnectionHelper.js (line 139) ----> invokes the connectionDetailsProvider.fetchConnectionDetails()
these calls will cause the provide to _callCreateParticipantConnection twice (and create two participant connections).
the fetchConnectionDetails() and fetchConnectionToken() should check if connectionDetails or token already available, if not make a connection otherwise return it.
This issue is fixed in the latest release 1.3.2