I am using amazon-chime-sdk-component-library-react for creating the meeting manager and everything is working as expected. The code is as follows.
const data = await response.json();
const { Info } = data;
const { Meeting, Attendee } = Info;
const configuration = new MeetingSessionConfiguration(Meeting.Meeting, Attendee.Attendee);
await meetingManager.join(configuration);
await meetingManager.start();
But the issue is when the deleteAttendee is called and the user is successfully deleted from the meeting. Then If the user tries to connect again within a few seconds the user joins the meeting and after 5 to 10 seconds. He automatically left the meeting with these console errors.
ChimeSDKReactComponent - failed with status code SignalingBadRequest and error: The signaling connection was closed with code 4403 and reason: attendee unavailable failed with status code SignalingBadRequest and error: The signaling connection was closed with code 4403 and reason: attendee unavailable
ChimeSDKReactComponent - the session will not be reconnected.
I have called the await meetingManager.leave();. After the attendee successfully deleted from the meeting. The code sample
const response = await fetch(`${BASE_URL}/meeting/delete-attendee`, {
method: "DELETE",
});
if (!response.ok) {
throw new Error(`HTTP status ${response.status}`);
}
await meetingManager.leave();
What's the solution to these issues and why the attendee left the meeting automatically?
There are two reasons why this issue occurred, Which are as follows
await meetingManager.leave();
Note*: First, clear the meetingManager resources and call await meetingManager.leave();
meetingManager?.audioVideo?.removeVideoTilesByAttendeeId(attendeeId); meetingManager?.audioVideo?.stop(); meetingManager?.audioVideo?.stopAudioInput(); meetingManager?.audioVideo?.stopContentShare(); meetingManager?.audioVideo?.stopVideoInput(); meetingManager?.audioVideo?.stopLocalVideoTile(); meetingManager?.audioVideo?.unbindAudioElement();