You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code to reproduce the issue:
Use device normally somewhere in the context of a browser extension worker (v3)
import{Device}from'@twilio/voice-sdk'constdevice=newDevice(token)awaitdevice.register()device.on('unregistered',()=>{device.destroy()// throws})// we unregister when the user logs outawaitdevice.unregister()
Expected behavior:
Device unregisters normally and closes its WS connection. When creating a new device in the same runtime context, everything works correctly and we're able to receive inbound calls.
Actual behavior:
device.destroy() throws, and even if we create a new device it's no longer capable of receiving inbound calls.
thrownewNotSupportedError('Enumeration is not supported');
}
This kinda makes sense, because we grab _mediaDevices from navigator.mediaDevice, which is undefined in the worker, but it probably doesn't make sense to throw it then.
I had to patch it on my end, just by replacing the error with the return statement, but I'm not sure it's the best solution.
This is the error that happens after we create a completely new device and try to receive an inbound call:
I suspect this happens because the first exception interrupts the cleanup procedure and some stale references remain. Software versions:
or sensitive account information (API keys, credentials, etc.) when reporting this issue.
Code to reproduce the issue:
Use device normally somewhere in the context of a browser extension worker (v3)
Expected behavior:
Device unregisters normally and closes its WS connection. When creating a new device in the same runtime context, everything works correctly and we're able to receive inbound calls.
Actual behavior:
device.destroy()
throws, and even if we create a newdevice
it's no longer capable of receiving inbound calls.More specifically, this place:
twilio-voice.js/lib/twilio/audiohelper.ts
Lines 427 to 429 in 41e4412
This kinda makes sense, because we grab
_mediaDevices
fromnavigator.mediaDevice
, which isundefined
in the worker, but it probably doesn't make sense to throw it then.I had to patch it on my end, just by replacing the error with the return statement, but I'm not sure it's the best solution.
This is the error that happens after we create a completely new device and try to receive an inbound call:
I suspect this happens because the first exception interrupts the cleanup procedure and some stale references remain.
Software versions:
@twilio/[email protected]
The text was updated successfully, but these errors were encountered: