fix(audio): clear input device IDs if getUserMedia fails

Stored input device IDs are not cleaned up whenever getUserMedia fails
with `NotFoundError` (i.e.: device not found). This causes a couple of
issues whenever skipEchoIfPreviousDevice is enabled:
  - An unnecessary error screen if the user retries audio from scratch
    (it should just go straight to the audio settings modal)
  - A retry loop if no other devices are present in the system

Guarantee that stored input device IDs are cleared up whenever
getUserMedia fails with error name `NotFoundError`. This both the retry
loop and the unnecessary error screen.
This commit is contained in:
prlanzarin 2024-10-21 19:12:30 +00:00
parent d0ad8afe64
commit c2161b9a14

View File

@ -432,6 +432,8 @@ class AudioManager {
break;
case 'NotFoundError':
errorPayload.errCode = AudioErrors.MIC_ERROR.DEVICE_NOT_FOUND;
// Reset the input device ID so the user can select a new one
this.changeInputDevice(null);
logger.error({
logCode: 'audiomanager_error_device_not_found',
extraInfo: {