communication-ui-library: DeviceManager.getCameras: Failed to enumerate device. code=500 subCode=40617
Describe the bug; what happened? On Android and ios, when callAdapter.dispose() is called it intermittently throws an error which breaks the call composite until the page is refreshed.
What are the steps to reproduce the issue?
- Use the test code from https://azure.github.io/communication-ui-library/?path=/docs/composites-javascript-loaders--docs
- On Android or ios: Join a call, then leave it and call
adapter.dispose()(either directly or in ngOnDestroy, it doesn’t matter) - Intermittently you’ll get this error:
global-error-handler.service.ts:219 Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'updateDevices') - Now every time you try to call
communicationreact.loadCallComposite(...)you’ll get this error:Unhandled Promise rejection: DeviceManager.getMicrophones: Failed to enumerate device. code=500 subCode=40617 ; Zone: <root> ; Task: Promise.then ; Value: CallError: DeviceManager.getMicrophones: Failed to enumerate device. code=500 subCode=40617 - The only way to fix it at this point is a full page refresh
What behavior did you expect?
I should be able to call adapter.dispose() on mobile browsers without error, and be able to join a call later without having to refresh the page.
If applicable, provide screenshots: Ran on an actual Android device, the chrome preview lags a bit: https://github.com/user-attachments/assets/5bc619f8-454e-4065-bb77-39ab60b4c295
Log file: patient.local.qhrtech.com-1747332700357.log
In what environment did you see the issue?
-
@azure/communication-reactnpm package version (if applicable): 1.26.0 -
@azure/communication-callingnpm package version (if applicable): 1.34.1 -
@azure/communication-chatnpm package version (if applicable): N/A -
OS & Device: Android and ios (multiple devices)
-
Browser: [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
-
Browser Version: Android 13, ios 18.4.1 (and also other versions)
Is there any additional information?
I can fix the problem by just not calling adapter.dispose() at all on mobile devices.
I also have the .har file but github won’t let me upload it.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (12 by maintainers)
Glad we could help! going to close this issue. Please reopen the issue if you have any more questions related to this!
For our use case it’s appointment based using a predefined group id, and the user will only ever join one call at a time. The rejoin should only ever be for accidental departure, and like you said the component would be destroyed by angular when the route changes.
Since it sounds like it’s expected to not have to call dispose in our case I’m happy with the current functionality, thank you for your help!
Thanks for letting me know! will get back to you soon with more information on your logs. In the short term I would make sure that you only dispose of the adapter and composite when you know the calling sessions are done in the app.
I’m just using the rejoin button in the composite in the sample; in our main app I’ve tried using that and our own custom angular page to rejoin the conference.
Also, I know calling dispose from callEnded isn’t best practice I was just trying to isolate it away from being a problem with angular. I can make some more changes to the sample if that’s helpful, but from my testing on this and in our main app it doesn’t matter how/where/when dispose is called. I’ll always get the error on Android/ios.
Amazing thanks for putting that together @levimiller-qhrtech will look into this and get back to you soon!
Hi, sorry about the delay. Here’s the log files: acs-call-logs.txt
I also created a simple repo that I’m able to use to reproduce the bug on Android/ios: https://github.com/levimiller-qhrtech/acs-issues-5848
Amazing! Thanks for all the detail in the code @levimiller-qhrtech I will take this and connect with our service team on the issue. For your logs are you familiar with the Azure logger and how you might use it to collect what the SDK’s are doing on the local device? We need those logs to see what might be happening as the adapter is disposed. Here’s a link on how to do that https://learn.microsoft.com/en-us/azure/communication-services/concepts/troubleshooting-info?tabs=csharp%2Cjavascript%2Cdotnet#enable-and-access-call-logs
For the environment that is also not working and isn’t angular what is the environment that is running in?
Thanks for the info @levimiller-qhrtech will get back to you when I know more!