aws / amazon-chime-sdk-js

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

no transition found from NotConnected with Update #2734

Closed andreisergiu98 closed 7 months ago

andreisergiu98 commented 1 year ago

What happened and what did you expect to happen?

Hello!

We are seeing this warning "no transition found from NotConnected with Update" raised for a lot of attendees in our meetings.

This issue says that the warning is raised if you start the local video tile before audiovideo is connected.

But this shouldn't be the case for us.

We are publishing the tile after the MeetingStatus provided by https://github.com/aws/amazon-chime-sdk-component-library-react is connected as seen below:


    if (meetingStatus !== MeetingStatus.Succeeded) {
        return null;
    }

    return (
        <>
            <AudioInputStreamController />
            <VideoInputStreamController />
            <MeetingController />
            <ChimeEvents />
        </>
    );

So to my understanding there is either:

Have you reviewed our existing documentation?

Reproduction steps

Amazon Chime SDK for JavaScript version

3.14.1

What browsers are you seeing the problem on?

any

Browser version

any

Meeting and Attendee ID Information.

No response

Browser console logs

We don't have any for now, since debugging is disabled in production.

simmkyu commented 1 year ago

From the MeetingManager code, the Chime SDK React Component Library listens to the audioVideoDidStart observer event from the Chime SDK for JavaScript and then changes the meeting status to MeetingStatus.Succeeded.

  audioVideoDidStart = (): void => {
    console.log(
      '[MeetingManager audioVideoDidStart] Meeting started successfully'
    );
    this.meetingStatus = MeetingStatus.Succeeded;
    this.publishMeetingStatus();
  };

Therefore, the SDK should not produce the no transition found from NotConnected with Update message when you initiate video after receiving the MeetingStatus.Succeeded.

Testing

For an experiment, I've added this code snippet into the Chime SDK React Component Library Demo.

  const { toggleVideo, isVideoEnabled } = useLocalVideo();
  const meetingStatus = useMeetingStatus();
  if (meetingStatus === MeetingStatus.Succeeded && !isVideoEnabled) {
    toggleVideo();
  }

The SDK transitions as follows:

2023-08-18T23:28:29.573Z [INFO] ChimeComponentLibraryReactDemo - transitioning from NotConnected to Connecting with Connect
2023-08-18T23:28:30.069Z [INFO] ChimeComponentLibraryReactDemo - transitioning from Connecting to Connected with FinishConnecting
2023-08-18T23:28:30.170Z [INFO] ChimeComponentLibraryReactDemo - transitioning from Connected to Updating with Update
2023-08-18T23:28:30.267Z [INFO] ChimeComponentLibraryReactDemo - transitioning from Updating to Connected with FinishUpdating
2023-08-18T23:28:30.269Z [INFO] ChimeComponentLibraryReactDemo - transitioning from Connected to Updating with Update
2023-08-18T23:28:30.315Z [INFO] ChimeComponentLibraryReactDemo - transitioning from Updating to Connected with FinishUpdating

This experiment starts a video immediately after MeetingStatus.Succeeded. However, the no transition found from NotConnected with Update message also occurs when the attendee tries to start a video after the meeting has ended.

Could you please confirm if it's possible to enable the video after the meeting has ended? Also, the Chime SDK INFO-level browser logs would be helpful in troubleshooting any potential race conditions.

andreisergiu98 commented 1 year ago

Hi @simmkyu!

I digged a little deeper and it seems the warning is not raised by startLocalVideoTile but by audioVideo.setContentShareVideoCodecPreferences?.([VideoCodecCapability.vp8()]);. Which we call immediately after MeetingStatus.Succeeded.

simmkyu commented 1 year ago

I confirm that calling the meetingSession.audioVideo.setContentShareVideoCodecPreferences API initiates the update action. The SDK triggers this action to update audio/video subscriptions in several scenarios, including but not limited to:

https://github.com/aws/amazon-chime-sdk-js/blob/53d35c034530208a0580cb734134888db2bbdf40/src/audiovideocontroller/DefaultAudioVideoController.ts#L1554-L1558

You can ignore this warning message for the time being. The meetingSession.audioVideo.setContentShareVideoCodecPreferences should work whether it's called prior to or during the session.

simmkyu commented 1 year ago

Merged the fix. In the upcoming version 3.17.0, the SDK will no longer display a warning message in the console when meetingSession.audioVideo.setContentShareVideoCodecPreferences is invoked prior to the start of the session.