Skip to content
Snippets Groups Projects
Commit d49a39a1 authored by Jan Brodersen (Armitxes)'s avatar Jan Brodersen (Armitxes) Committed by Alexandre Kühn
Browse files

[FIX] mail: No crash from "enumerateDevices" in discuss calls

Before this commit, when accessing the discuss call settings
in non-localhost without SSL, there was the following crash:

```
"Cannot read 'enumerateDevices' of undefined"
```

Odoo uses zxing-js to detect devices within the discuss app.
zxing-js provides methods such as "hasNavigator",
"isMediaDevicesSuported" or "canEnumerateDevices" to check if
features are available. These are not called by Odoo before using
the related features what can result in a JS traceback.

This commit fixes the issue by showing a warning as a toaster
notification and in the dev tools, instead of a traceback.

The zxing-js methods are not exposed, hence the reliance on
truthy mediaDevices.

See also https://github.com/zxing-js/library/issues/225

Closes https://github.com/odoo/odoo/issues/112255
Closes https://github.com/odoo/odoo/pull/112813



closes odoo/odoo#119334

Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
parent 1280b3a2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment