Fix fast meeting join race condition #2591
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #:
In Safari, if the user navigates from preview screen to the meeting very quickly the application runs into a race condition. The preview screen is responsible for calling
navigator.mediaDevices.getUserMedia
and in Safari this call seems to be slower than FireFox and Chrome. This issue is only reproducible in Safari.When the user redirects from authentication page to preview page, the following code is executed via AsyncScheduler: https://github.com/aws/amazon-chime-sdk-js/blob/main/demos/browser/app/meetingV2/meetingV2.ts#L3403-L3492.
Inside this code includes the call to capture media devices via
await this.openAudioInputFromSelectionAndPreview()
;.If the user navigates to meeting quickly, the code linked above is not done executing and it causes a race condition where the
MonitorTask
is initialized as part of meeting join and starts processing the metrics. RTC metrics reports the audio bit rate to be 0 which is recorded as asendingAudioFailed
event.Description of changes:
Adding an
openAudioInputFromSelection
call to make sure that there is an audio input device as the user enters the meeting.Testing:
Can these tested using a demo application? Please provide reproducible step-by-step instructions.
join
buttonsendingAudioFailed
event in the console.Without this change, the meeting roster will not appear and there will be a
sendingAudioFailed
event logged in the console.Checklist:
Have you successfully run
npm run build:release
locally?Yes
Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
No
Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
No
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.