Closed riodeuno closed 2 years ago
It is happening due to:
Chrome’s security policy will only allow you to access your device’s microphone/camera when a sites has a secure origin
Following this article helped users unblocked for the time being - https://medium.com/@Carmichaelize/enabling-the-microphone-camera-in-chrome-for-local-unsecure-origins-9c90c3149339. The user who was facing the issue will be adding the SSL certificate as well.
Not sure why it started happening in v1.6.6. Shri will be checking this soon. Still need to do RCA for this.
cc: @somangshu
Okay, so first up, media devices API is not available without HTTPS, which means widgets like Camera, AudioRecorder etc. will require HTTPS to work.
Second, this is true of our previous Appsmith version, v1.6.5 as well. The difference is that in that version, we weren't crashing, it was just another error logged to the console. Screenshot:
Third, in the latest version, v1.6.6,
I'm not sure why dropping a file picker widget is making the call to enumerateDevices
that's there in the Camera widget's code. I tried looking into the imports to see how dropping a file picker can call code from Camera widget, but couldn't find a connection.
So, in summary, widgets based on media device APIs were never working on HTTP, they require HTTPS. What changed in v1.6.6 is the addition of the Camera widget, and the File picker is calling into this and is crashing. That part we still need to figure out.
PS: I have a temp instance running an Appsmith installation on HTTP, where I reproduced this. Let me know if you need access to troubleshoot this.
We should at least wrap the enumerateDevices
function in a try-catch so that the app doesn't crash. @somangshu, can paul do this?
Yes.
@jsartisan, @sharat87 I could repro this issue in the below scenario I have checked scenario in the link : http://3.110.209.147/applications/61e67a4c5e0814517e03a582/pages/61e67a4c5e0814517e03a585/edit
@RakshaKShetty we have pushed the fix, please check
Is there an existing issue for this?
Current Behavior
Reported by A-Cityzen#3550 on discord.
The user added a filepicker - which calls a multipart POST api - into a modal. The modal crashes the application on
showModal
Logs from the crash:.
Steps To Reproduce
Not clear at the moment. We can attempt to do the following
Environment
Production
Version
Cloud