-
Notifications
You must be signed in to change notification settings - Fork 341
"Client is not connected to a websocket" #55
Comments
@booboothefool I think this might happen if you subscribe when the websocket isn't ready yet. Could you try to submit a failing test case for this? It should be feasible to do so by creating a test case which subscribes as quickly as possible after initializing the client. |
Since #53 merged, there is a new INIT message in the protocol, and new subscriptions are initialized only after init is done. |
@Urigo I'm not seeing in the code how the INIT message acts as a guard to prevent subscription messages from being sent. Additionally in the case of a reconnect previous subscriptions are reestablished prior to the INIT event firing. |
I no longer get
and it seems to always connect successfully initially, but now instead I am getting an error that reads
It seems to be a lot worse because it happens much more frequently, and while I am not sure why this is happening, as it seems completely random. It's like it's dropping the connection. Well when it happens every time I restart my server, so the reconnect might be what's messing it up, but it also happens in production too where my server isn't restarting. All I did was I upgraded to the new library and changed My subscriptions look something like this (based on http://dev.apollodata.com/react/receiving-updates.html#Subscriptions):
|
@booboothefool I've noticed that with native WebSockets I'm seeing the client disconnect and reconnect more often. On the server do you have the |
@NeoPhi cool so:
Then I upgraded to Can you explain what that does and how it solves the problem (and what the problem actually is)? |
Without I've not walked through the code but I suspect that there is a race condition between the WebSocket reconnecting and the previously active subscriptions being reestablished such that the client thinks it is okay to send a message when in fact it shouldn't, resulting in the error |
+1 facing the same error again using version |
Sorry for the ambiguity, but sometimes I get this error when I start my app.
I am pretty sure I set up most things correctly because I have subscriptions flying all over my app, and it does connect about 90% of the time, but it's a real bummer when it doesn't (nothing realtime works of course) and I have no idea why. :c
The text was updated successfully, but these errors were encountered: