aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
713 stars 476 forks source link

TCP and UDP connection checks failing randomly #2715

Open mycroft-cesar opened 1 year ago

mycroft-cesar commented 1 year ago

What happened and what did you expect to happen?

We are currently using the meeting readiness checker provided by you to test the users' connections to the conference before having the actual conference but results are being massively affected by these two methods. They only return the connection failed status code (2)

const meetingReadinessChecker = new DefaultMeetingReadinessChecker(meetingSession.logger, meetingSession);
const networkTcpResp = await meetingReadinessChecker.checkNetworkTCPConnectivity();
const networkUdpResp = await meetingReadinessChecker.checkNetworkUDPConnectivity();

image

we really need these checks to make sure users won't have any issues to access/during the conference.

Have you reviewed our existing documentation?

Reproduction steps

unfortunately this has happened in the production environment so we couldn't reproduce it.

Amazon Chime SDK for JavaScript version

3.14.1

What browsers are you seeing the problem on?

Chrome and Edge

Browser version

115

Meeting and Attendee ID Information.

No response

Browser console logs

  "errors": [
            "2023-07-24T03:11:50.194Z: \"Meeting Readiness Checker failed. TCP: 2 ; UDP: 2\""
        ],

this is the only logs we have from this issue.

michhyun1 commented 1 year ago

So you're running the meeting readiness checker from here: https://github.com/aws/amazon-chime-sdk-js/tree/main/demos/browser/app/meetingReadinessChecker

And you are running it locally?

michhyun1 commented 1 year ago

And I'm assuming you are getting this failure: https://github.com/aws/amazon-chime-sdk-js/blob/main/src/meetingreadinesschecker/DefaultMeetingReadinessChecker.ts#L403

Am I correct?

mycroft-cesar commented 1 year ago

the only environment we have enough data about this is Production. Nobody on our team has such errors and that's really annoying.

And yes, you're right, that's the failure.

michhyun1 commented 1 year ago

I guess I'm asking if you deployed the demo that is provided by us in the JS SDK repo, or did you implement your own?

It sounds like you created your own and deployed it to Production.

It seems that that error is created when you have failed to start a meeting.

mycroft-cesar commented 1 year ago

Oh, I apologize. I misunderstood your question. It's our own. We do have a tech check page where the users can test the connection with chat/conference. This is happening when they reach the conference check.

Yeah, the meeting is failing to start but why? sometimes people with a really good connection fail to pass on the test and it doesn't make sense.

michhyun1 commented 1 year ago

I can't say from what you've provided - you might double check your meeting start logic - because the issue is coming from that.

mycroft-cesar commented 1 year ago

The step by step is:

create a new meeting and create a config

 const { Meeting, Attendee } = await api.createChimeMeeting();
 const configuration = new MeetingSessionConfiguration(Meeting, Attendee);

then we save the result from

new DefaultMeetingSession(configuration, _logger, deviceController)

and we finally check the connection:

 const meetingReadinessChecker = new DefaultMeetingReadinessChecker(meetingSession.logger, meetingSession);
 const networkTcpResp = await meetingReadinessChecker.checkNetworkTCPConnectivity();
 const networkUdpResp = await meetingReadinessChecker.checkNetworkUDPConnectivity();

 if (networkTcpResp === CheckNetworkTCPConnectivityFeedback.Succeeded && networkUdpResp === CheckNetworkUDPConnectivityFeedback.Succeeded) {
    // save the result
} else {
    onError(`Meeting Readiness Checker failed. TCP: ${networkTcpResp} ; UDP: ${networkUdpResp}`);
    // save the result
 }

meeting and attendee example: Group 2 (1)

Well, that's pretty much the logic used. Let me know if I can provide more info on this.