dim icon indicating copy to clipboard operation
dim copied to clipboard

Receiving "Connection to server lost" and "restored" all the time

Open mohammadrafigh opened this issue 2 years ago • 6 comments

Describe the bug I receive "Connection to server lost" and immediately "Restored" exactly like #360 . I receive these messages directly and when I'm behind an Nginx reverse proxy. Is there any way to turn off these messages? or at least some config I can fine tune? Currently these toast messages cover screen while watching a video which makes Dim unusable.

To Reproduce Steps to reproduce the behavior:

  1. Run Dim using Docker behind Nginx and directly

Expected behavior

  1. A way to increase Websocket timeout
  2. A way to turn off WS connection lost toasts
  3. A configuration example for Nginx reverse proxy

mohammadrafigh avatar Apr 10 '23 13:04 mohammadrafigh

The websocket connection is important in the webui. It can't be disabled.

We do not have any developers with nginx experience around, but I'd assume nginx prematurely closes the websocket connection which causes the webui to reconnect.

vgarleanu avatar Apr 10 '23 13:04 vgarleanu

The websocket connection is important in the webui.

Yes I just wanted to know if we can disable toast messages not the whole WS.

We do not have any developers with nginx experience around, but I'd assume nginx prematurely closes the websocket connection which causes the webui to reconnect.

The problem also happens when I connect directly. If it helps I use Cloudflare too.

mohammadrafigh avatar Apr 10 '23 13:04 mohammadrafigh

in the nginx location i have:

location / { proxy path stuff ... ... # WebSocket support proxy_http_version 1.1; proxy_buffering off; proxy_connect_timeout 43200000; proxy_read_timeout 30d; proxy_send_timeout 30d; ... i think the 30d timeout solves it proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }

gbeliako avatar Apr 17 '23 11:04 gbeliako

Nope I already have the same config with 7d, I assume 7d and 30d doesn't make any difference since the point is to increasing the timeout to something bigger than a few seconds or minutes.

mohammadrafigh avatar Apr 17 '23 14:04 mohammadrafigh

I think just removing toast messages for connection loss and instead logging in console would be a better solution, Or at least an option in preferences to disable connection loss/established toast messages.

mohammadrafigh avatar Apr 17 '23 14:04 mohammadrafigh

Same for me, really annoying. Solved temporarily by adding custom css: .notifications { display: none }

maybe the toast should wait a few (mili)seconds before popping out - and in case the connection is reestablished it would cancel the pending toast. I could do that - the question is: "Is that an acceptable solution?"

prostolyubo avatar Aug 10 '25 23:08 prostolyubo