[solved] Connection issue / user status issue

Summary
Since the update from 6.2.x to 6.3.1, we have disconnects (messages are delivered with delay, notifications do not arrive at all or are delayed, online status of the person is not updated properly). I first suspected it was related to the app, but that was not the case. The problem also occurs independently of the operating system (MacOS & Linux).

Steps to reproduce
The problem seems to occur when the client PC is locked and you then log back in. (App maybe in some kind of “frozen” / sleep state.). There are no problems with the websocket connection, at least as far as I can tell. Nothing has changed on the gateway / proxy either. As soon as View → Reload is selected in the desktop app via the menu, everything works as usual again.

Versions:

  • Mattermost Server 6.3.1 (Official Docker)
  • Mattermost Client (Linux & MacOS) 5.0.2
  • postgres 10 (Official Docker)
  • Haproxy 2.4.12 (Running behind Proxy)
  • Loaded plugin com.mattermost.plugin-todo, version 0.5.0
  • Loaded plugin jira, version 3.1.0
  • Loaded plugin com.github.matterpoll.matterpoll, version 1.4.0
  • Loaded plugin com.mattermost.plugin-channel-export, version 1.0.0
  • Loaded plugin jitsi, version 2.0.0

Expected behavior
I would like to have the old behavior back where after losing focus the app still works as usual.

Observed behavior
The desktop app logs the following error messages after the problem occurs (repeating):

Server Logs flooded with:

{"timestamp":"2022-01-28 09:26:00.662 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user1"}
{"timestamp":"2022-01-28 09:26:00.871 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user2"}
{"timestamp":"2022-01-28 09:26:01.411 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user3"}
{"timestamp":"2022-01-28 09:26:01.482 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user2"}
{"timestamp":"2022-01-28 09:26:01.528 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user1"}
{"timestamp":"2022-01-28 09:26:01.693 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user5"}
{"timestamp":"2022-01-28 09:26:01.747 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user1"}
{"timestamp":"2022-01-28 09:26:02.109 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user1"}
{"timestamp":"2022-01-28 09:26:02.401 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user1"}
{"timestamp":"2022-01-28 09:26:02.406 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user3"}
{"timestamp":"2022-01-28 09:26:02.417 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user4"}
{"timestamp":"2022-01-28 09:26:02.947 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user7"}
{"timestamp":"2022-01-28 09:26:03.363 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user8"}
{"timestamp":"2022-01-28 09:26:03.605 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user1"}
{"timestamp":"2022-01-28 09:26:03.780 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user8"}
{"timestamp":"2022-01-28 09:26:03.986 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user3"}
{"timestamp":"2022-01-28 09:26:04.007 +01:00","level":"error","msg":"webhub.broadcast: cannot send, closing websocket for user","caller":"app/web_hub.go:535","user_id":"user4"}

DB Error log (Appears every 4 hours):

2022-01-28 06:06:46.014 UTC [16664] ERROR:  duplicate key value violates unique constraint "systems_pkey"
2022-01-28 06:06:46.014 UTC [16664] DETAIL:  Key (name)=(LastSecurityTime) already exists.
2022-01-28 06:06:46.014 UTC [16664] STATEMENT:  UPDATE Systems SET Name=$1, Value=$2

Edit:
Looks like the todo plugin creating the issues here: Various plugin on Community throw JS errors after upgrading to version 0.5.0 · Issue #155 · mattermost/mattermost-plugin-todo · GitHub
I deactivated the plugin and the log flood on the server stopped and the connection seems to be stable again.