Bug 5652 - Websocket sometimes closes with unexpected errors on logout
Summary: Websocket sometimes closes with unexpected errors on logout
Status: CLOSED WORKSFORME
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Web Access (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.11.0
Assignee: Samuel Mannehed
URL:
Keywords:
Depends on: 6132
Blocks: 5780
  Show dependency treegraph
 
Reported: 2015-09-23 17:56 CEST by Samuel Mannehed
Modified: 2019-10-09 15:37 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Samuel Mannehed cendio 2015-09-23 17:56:54 CEST
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
Comment 1 Samuel Mannehed cendio 2016-01-25 16:59:47 CET
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.
Comment 2 Peter Åstrand cendio 2016-01-26 10:29:54 CET
We have decided that we want to investigate why these errors happens; not just ignore them.
Comment 3 Pierre Ossman cendio 2016-10-13 10:23:21 CEST
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?
Comment 4 Samuel Mannehed cendio 2016-10-18 09:35:47 CEST
While touching this code we should probably replace the error codes with the corresponding, more user friendly strings, in the user visible messages.
Comment 5 Pierre Ossman cendio 2019-10-09 15:35:51 CEST
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.

Note You need to log in before you can comment on or make changes to this bug.