-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(audio-mute): fix sometimes out-of-sync remote audio mute #3797
fix(audio-mute): fix sometimes out-of-sync remote audio mute #3797
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
7929174
to
7eac0be
Compare
// there is no need to trigger user update if no one muted user | ||
if (changedSelf.selfIdentity === changedSelf.modifiedBy) { | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted because this was causing the BEMS bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self, ask about this if not resolved lower. edit: resolved in next file
|
||
// never want to unmute the local stream from a server remote mute update | ||
if (muted) { | ||
this.muteLocalStream(meeting, muted, 'remotelyMuted'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New way to fix the bug that was fixed by the code I reverted. This is not called when the the meeting is in moderated mode and the host unmutes a user, so it did not affect that.
it('should return false when selfIdentity and modifiedBy are the same', function() { | ||
assert.equal(SelfUtils.mutedByOthersChanged( | ||
{ remoteMuted: false }, | ||
{ remoteMuted: true, selfIdentity: 'user1', modifiedBy: 'user1' } | ||
), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this
// there is no need to trigger user update if no one muted user | ||
if (changedSelf.selfIdentity === changedSelf.modifiedBy) { | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self, ask about this if not resolved lower. edit: resolved in next file
@@ -379,7 +379,11 @@ export class MuteState { | |||
} | |||
if (muted !== undefined) { | |||
this.state.server.remoteMute = muted; | |||
this.muteLocalStream(meeting, muted, 'remotelyMuted'); | |||
|
|||
// never want to unmute the local stream from a server remote mute update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -113,6 +113,30 @@ describe('plugin-meetings', () => { | |||
assert.isTrue(audio.isRemotelyMuted()); | |||
}); | |||
|
|||
it('does not locally unmute on a server unmute', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice test
|
||
// never want to unmute the local stream from a server remote mute update | ||
if (muted) { | ||
this.muteLocalStream(meeting, muted, 'remotelyMuted'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this logic makes sense and is a lot cleaner
…8-out-of-sync-remote-audio-mute
…ebex#3797)" This reverts commit d354100.
…ebex#3797)" This reverts commit d354100.
…ebex#3797)" This reverts commit d354100.
…ebex#3797)" This reverts commit d354100.
COMPLETES
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-555818
This pull request addresses
Fixes a BEMS case defect where remote audio mute can get out of sync with local audio mute.
BEMS space: webexteams://im?space=c4706ce0-56e0-11ef-81df-a39e6dd40a42
Steps to recreate bug:
The server remote audio is still muted (notice the muted icon in the participant list)
With the fix, the server remote audio is unmuted as expected.
by making the following changes
First, I needed to revert a fix from months ago. This fix was causing the locus diff update from step 5 to be skipped because the modifiedBy value was the same as the local user. We did not skip the update in step 3 because modifiedBy was undefined. I met with Rajesh Kadikar about this and he indicated that the modifiedBy should contain the current user in this scenario, and that we should not be skipping locus updates, even it they were modified by the current user.
Second, I needed to find a new way to fix what was reverted. I added console.logs in various places in the flow and found that if you unmute and mute quickly,
_LocalMicrophoneStream.setUserMuted(true)
happens before we receive the locus diff from the unmute. When the locus diff eventually comes in,handleServerRemoteMuteUpdate()
unmutes the local stream to match the remote mute state, which should not be done. So I added anif
around the local stream update to only execute it when muting, not unmuting.While testing this PR, I found a few problems around host mute/unmute (unrelated to this change) and opened these Jiras:
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-559101
https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-559095
Change Type
The following scenarios where tested
Manually tested the scenario in the BEMS Jira (SPARK-555818).
Manually tested the scenario in a related BEMS Jira.
Manually tested the scenario from the reverted PR/Jira.
Manually tested host unmuting a user when in a moderated meeting.
Updated unit tests.
I certified that
I have read and followed contributing guidelines
I discussed changes with code owners prior to submitting this pull request
I have not skipped any automated checks
All existing and new tests passed
I have updated the documentation accordingly