Skip to content
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

[BUG] Twilio error code not being returned when microphone access is blocked #95

Closed
4 of 6 tasks
chsweet opened this issue Jun 13, 2022 · 14 comments
Closed
4 of 6 tasks
Labels
bug Something isn't working

Comments

@chsweet
Copy link

chsweet commented Jun 13, 2022

  • I have verified that the issue occurs with the latest twilio.js release and is not marked as a known issue in the CHANGELOG.md.
  • I reviewed the Common Issues and open GitHub issues and verified that this report represents a potentially new issue.
  • I verified that the Quickstart application works in my environment.
  • I am not sharing any Personally Identifiable Information (PII)
    or sensitive account information (API keys, credentials, etc.) when reporting this issue.

Code to reproduce the issue:

Block microphone access in browser. Create a new Device

  const { Device } = import('@twilio/voice-sdk');
  device = new Twilio.Device(token);

  device.on('error', twilioError => {
    console.log(twilioError);
  });

  device.connect();

Expected behavior:

When a new Device is created and the user has denied access to microphone we should be receiving the Twilio error code 31401 (updated from 31208) should be returned.

Actual behavior:

We are not receiving the Twilio error code when the user has denied access to microphone. Instead we are getting an error. Slightly different in Chrome, Firefox, and Safari.

Chrome
error Uncaught (in promise) TypeError: Cannot ready properties of null (reading 'updatePreferredURI'

Screen Shot 2022-06-13 at 12 54 19 PM

Firefox
error Uncaught (in promise) TypeError: f._stream is null

Screen Shot 2022-06-13 at 4 37 47 PM

Safari
error Unhandled Promise Rejections: TypeError: null is not an object (evaluating 'f._stream.updatePreferredURI

Screen Shot 2022-06-13 at 4 50 52 PM

Software versions:

  • Browser(s): Chrome, Firefox, & Safari
  • twilio.js: 2.0.1
@chsweet chsweet added the bug Something isn't working label Jun 13, 2022
@mhuynh5757
Copy link
Collaborator

Hi @chsweet, the team is tracking this internally and we've created a ticket for this. Thanks!

@ostap0207
Copy link

Are there any updates on ETA? User denying microphone permissions is a fairly common use case, so this blocks us from migrating from the v1 to v2 Twilio client.

@SiimMardus
Copy link

SiimMardus commented Aug 18, 2022

Found that in maybeUnsetPreferredUri function, (which is called also when there is an error from Call and call.status() isclosed), it calls this._stream.updatePreferredURI(null);, but in our case the _stream is null.

Opened a PR to check if stream exists, before calling updatePreferredURI on it. Tested it out with our use case and it worked like it should again.

#106

@samusgray
Copy link

Great catch! Thanks so much.

@samusgray
Copy link

Can we prioritize a code review on the PR Siim submitted? 🙏 That looks like it may solve the problem.

@mhuynh5757
Copy link
Collaborator

Hi @samusgray apologies for the delays. The team will discuss priorities to see when we can investigate this further.

@charliesantos
Copy link
Collaborator

I left a review on the PR @samusgray

@samusgray
Copy link

Thank you so much! 🙏 cc @SiimMardus :)

@charliesantos
Copy link
Collaborator

Should be fixed in #144 and will be released soon.
Closing this now.

@samusgray
Copy link

Hello again, we upgraded to the latest and are still seeing this issue, just in a slightly different location in the codebase.

Cannot read properties of null (reading 'updatePreferredURI')
/node_modules/@twilio/voice-sdk/es5/twilio/device.js:1014:46 maybeUnsetPreferredUri
/node_modules/@twilio/voice-sdk/es5/twilio/device.js:1039:32 t.<anonymous>
/node_modules/events/events.js:158:6 c.emit
/node_modules/@twilio/voice-sdk/es5/twilio/call.js:859:18 

We're certain that when this error gets thrown it results in a broken user experience for our customers, so finally getting it fixed is a really high priority for us. Is there anything we can do to help debug or track down the root cause? Happy to provide any more information that may be useful.

@charliesantos
Copy link
Collaborator

@samusgray what version did you upgrade to? The fix for this issue hasn't been released yet and still under internal testing.

@samusgray
Copy link

Oh, I didn't realize. We bumped to the latest and I noticed the error go away in our bug tracker, only to realize it popped back up at a different location, prompting this post. Sorry to bother!

Any rough idea on when you you're aiming to have the next release out?

@charliesantos
Copy link
Collaborator

@samusgray no worries! It should come out any day now. If you want to test sooner, please feel free to use the RC version. https://github.com/twilio/twilio-voice.js/releases/tag/2.3.2-rc1

@samusgray
Copy link

Amazing. I'll start testing the RC in our staging envs. Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants