webex / webex-js-sdk

JavaScript SDK for Webex
https://webex.github.io/webex-js-sdk/
Other
167 stars 334 forks source link

fix(calling): switching off stream listeners to avoid having multiple listeners #3653

Closed Kesari3008 closed 2 weeks ago

Kesari3008 commented 2 weeks ago

COMPLETES #https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-511584

This pull request addresses

While updating the local track, a DOM exception error was encountered complaining for the peer connection to be closed. Hence enabling BNR fails after the first call. This happens because the old listener is used for the OutputTrackChange event on the localAudioStream, which uses the previous media connection, which is closed while updating the local track.

index.js:6603 Uncaught (in promise) DOMException: The peer connection is closed. at https://localhost:8000/samples/calling.min.js:2:3712596 at Array.forEach () at r.value (https://localhost:8000/samples/calling.min.js:2:3712231) at r.value (https://localhost:8000/samples/calling.min.js:2:3713170) at r.value (https://localhost:8000/samples/calling.min.js:2:3847575) at Je. (https://localhost:8000/samples/calling.min.js:2:3976135) at Ne.emit (https://localhost:8000/samples/calling.min.js:2:3059270) at Xe.emit (https://localhost:8000/samples/calling.min.js:2:3061589) at r.changeOutputTrack (https://localhost:8000/samples/calling.min.js:2:3064449) at NoiseReductionEffect.t (https://localhost:8000/samples/calling.min.js:2:3065066)

Steps to reproduce:

  1. Initiate a call, enable BNR then disable BNR followed by call disconnect. Everything works fine till this point.
  2. Initiated 2nd call and enabled BNR, updating local track fails and it complains of peer connection being closed.

by making the following changes

Switching off the localAudioStream listener for the OutputTrackChange event fixes this issue.

Change Type

The following scenarios where tested

  1. Initiate a call, enable BNR then disable BNR followed by call disconnect. Everything works fine till this point.
  2. Initiated 2nd call and enabled BNR, enabling BNR works smoothly and no error is observed.

DOM_Exception_Fix.log

I certified that


Make sure to have followed the contributing guidelines before submitting.

aws-amplify-us-east-2[bot] commented 2 weeks ago

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3653.d3m3l2kee0btzx.amplifyapp.com

Kesari3008 commented 2 weeks ago

In the PR description where you are talking about the problem, can you please mention the sequence of events that leads to this issue? Also, please mention the tests performed in the PR description.

PR description updated