sente
sente copied to clipboard
socket_ gets replaced by plain object in Firefox
Using 1.13.1 at the moment, and I keep seeing a few errors in Firefox. Works fine in Chrome, Edge and iexplore11. The main issue, is that at some point in Firefox, the socket_ atom no longer references a WebSocket object, but a plain JS object with two fields: listeners and websocket.
Related to this is an error I see in the console upon establishing the connection: this.listeners.onopen is not a function (called internally by Firefox as far as I can tell). At this point the socket_ points to a WebSocket object directly.
If there are other issues in the application, like the user session timing out without us being able to refresh their token, we disconnect the websocket. In Firefox we cannot re-establish the connection, due to the change in object type.
When we try to call chsk-disconnect! we get an error that there's no close function in the object, as it doesn't reference the WebSocket directly. This screws up the state. We can probably throw in a try around the call to chsk-disconnect! to make sure or state doesn't end up broken, but it seems like there's a bug in Sente on Firefox or Firefox itself (I'm currently on FF 67.0.4)