Open SundayDelight opened 3 years ago
I suspect this comes down to an implementation detail of the browser. I couldn't find any open chromium tickets, but I found related, closed tickets. RxJS checks the wasClean
flag of the websocket close event. There is no vendor-specific behavior. If wasClean
, then close, else error. A WebSocket error and an RxJS observable error are similar, both indicate the stream has closed.
Bug Report
Current Behavior When closing a websocket on Chrome for Android, the WebSocketSubject calls its complete callback. When closing a websocket on Chrome for desktop, the WebSocketSubject calls its error callback.
Expected behavior Behavior should be consistent on both browsers.
Reproduction Create a WebSocketSubject connecting to a homemade server, subscribe to it so that the websocket actually connects. Then, from the server, close the connection with code 1000 (normal closure). WebSocketSubject on Chrome desktop will throw error while the one on Chrome Android will complete.
Environment
Additional context/Screenshots The Websocket server I used was one built from Qt, that simply calls the QWebSocket class close() method to trigger the callbacks of WebSocketSubject.