Normally when we log out from a session in the HTML5 client the websocket closes with the proper 1000 code. But sometimes we get 1006 which means CLOSE_ABNORMAL. This should not happen. Error code explanations can be found here: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
Microsoft Edge very often (9 out of 10 tries) returns code 1005 when logging out. According to mozilla, this code means "CLOSE_NO_STATUS". When it doesn't close with 1005, it closes with 1006. When the websocket closes with an unexpected code we display the message "Failed to connect" to the user, instead of the normal "Your session has ended". As of commit 30846 made for bug 5603 we have a temporary special case for error 1006. Thus, when we get error 1006 we display "Server Disconnected". I would argue that we should fix this bug in order to say we support Microsoft Edge. We should at the very least make the same temporary special case for error 1005. Assigning to -- for discussion.
We have decided that we want to investigate why these errors happens; not just ignore them.
Happens with Chrome as well. The bug is most likely in our WebSocket server, given the definition of this error code. Perhaps we fail to flush sockets properly when the VNC side closes?
While touching this code we should probably replace the error codes with the corresponding, more user friendly strings, in the user visible messages.
We removed the workaround in r32157 as part of bug 6132 over two years ago. The new code doesn't really care about the codes. So there is no issue to fix here.