Omnichannel LiveChat not updating in browser applet

Description

Trying to implement Omnichannel within our service desk portal I have embedded the script in a purely static web page. Although the Omnichannel agent side of things works perfectly, it is presenting a few problems in the browser applet which may or may not all be related:

  • The Chat icon in bottom right corner takes around 20 seconds to appear
  • The user / agent avatar icons in the livechat applet are just black squares
  • The applet does not refresh and show the latest comments by either the user or the agent
  • Sound notifications do not work in the browser applet.

Any guidance on this would be gratefully appreciated.

Server Setup Information

  • Version of Rocket.Chat Server: 3.4.2
  • Operating System: Debian
  • Deployment Method: Snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version: 12.16.1
  • MongoDB Version: 3.6.14
  • Proxy: nginx
  • Firewalls involved: pfSense

Any additional Information

Have you checked your CORS configuration in your webapp? You’ll have to allow your chat.* domain

thanks for the tip @loscil06
I added this to httpd.conf:

Header set Access-Control-Allow-Origin “*”

But still no luck.
Both of my boxes are behind the same nginx reverse proxy which handles the SSL. Do you know if I would have to do anything with CORS on that?

Can you open up the dev tools once in the web app (usually by pressing f12 in any browser), in the console section it’ll tell you what specific scripts or resources are being locked, maybe that may give us some pointers to the issue.

OK, this is what I get from the console which looks promising, however it means very little to me I’m afraid @loscil06 !

Rocket.Chat.js.SDK.chunk.77365.js:1 WebSocket connection to ‘wss://chat.mydomain.com//websocket’ failed: Error during WebSocket handshake: Unexpected response code: 502
(anonymous) @ Rocket.Chat.js.SDK.chunk.77365.js:1

4Rocket.Chat.js.SDK.chunk.77365.js:1 Uncaught (in promise) DOMException: Failed to execute ‘send’ on ‘WebSocket’: Still in CONNECTING state.
at https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:22158
at new Promise ()
at e. (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:21889)
at https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:17828
at Object.next (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:17933)
at https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:16846
at new Promise ()
at R07M.s (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:16623)
at e.r.send (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:21815)
at e.r.subscribe (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:23924)

route-Chat.chunk.4f829.js:1 Uncaught (in promise) TypeError: Cannot read property ‘error’ of undefined
at g (route-Chat.chunk.4f829.js:1)

4Rocket.Chat.js.SDK.chunk.77365.js:1 Uncaught (in promise) DOMException: Failed to execute ‘send’ on ‘WebSocket’: Still in CONNECTING state.
at https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:22158
at new Promise ()
at e. (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:21889)
at https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:17828
at Object.next (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:17933)
at https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:16846
at new Promise ()
at R07M.s (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:16623)
at e.r.send (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:21815)
at e.r.subscribe (https://chat.mydomain.com/livechat/Rocket.Chat.js.SDK.chunk.77365.js:1:23924)

Rocket.Chat.js.SDK.chunk.77365.js:1 WebSocket connection to ‘wss://chat.mydomain.com//websocket’ failed: Error during WebSocket handshake: Unexpected response code: 502
(anonymous) @ Rocket.Chat.js.SDK.chunk.77365.js:1

25Rocket.Chat.js.SDK.chunk.77365.js:1 WebSocket connection to ‘wss://chat.mydomain.com//websocket’ failed: Error during WebSocket handshake: Unexpected response code: 502
(anonymous) @ Rocket.Chat.js.SDK.chunk.77365.js:1
(anonymous) @ Rocket.Chat.js.SDK.chunk.77365.js:1
(anonymous) @ Rocket.Chat.js.SDK.chunk.77365.js:1
s @ Rocket.Chat.js.SDK.chunk.77365.js:1