DDP Web Socket Reset Cycle in Meteor 0.8.1.1 #2125
Was there a change in the websocket implementation in Meteor v0.8.1.1?
A corresponding ObjectiveDDP issue has been created here: boundsj/ObjectiveDDP#74
STEPS TO REPRODUCE
Run the iOS app in the simulator.
Observe that a "You are not connected" error is returned from the login call. The websocket then goes into a cycle of being ready and not ready.
The websocketReady/NotReady cycle is caused by the SocketRocket delegate method below, called with a code of 1000 and a nil reason string. wasClean is true.
ObjectiveDDP makes the websocket connection using the following command. Note the "pre1" protocol version. Is this the version that should be used with Meteor v0.8.1.1?
To demonstrate expected behavior, execute the same steps to reproduce, except start meteorite from the meteor-example-passing-0.8.0.1 directory.
The text was updated successfully, but these errors were encountered:
While on the one hand, the library maintainer should upgrade to use pre2, it's supposed to be backwards compatible with pre1.
It looks like the problem is
So all of these things should happen:
Previously, you could leave out the "support" field (or claim to not support the version you were proposing) which would mean your connection would succeed iff the proposed version is the server's favorite version. This led to (eg) ObjectiveDDP accidentally writing a client that stopped working when servers started preferring pre2 over pre1. By making this a blatant error, DDP client libraries are more likely to be written in a way that works with version negotiation. Also, remove the delay in sending connect failure messages, which was intended to avoid connect storms from clients that are by now 1.5 years old. Fixes #2125.
@jamesfebin This sounds like a different issue. I hope the good folks at https://github.com/boundsj/ObjectiveDDP can help you with it; if it turns out to be a Meteor issue, read https://github.com/meteor/meteor/wiki/Contributing-to-Meteor#reporting-a-bug-in-meteor and open a bug here.
Sending nil is nonconformant and should result in a disconnection, because the client is then saying “I don’t support any protocol versions at all”, according to meteor/meteor#2125 . Sending “support: [‘pre1’]” is a more correct fix than sending “version: pre2”, since ObjectiveDDP doesn’t actually support pre2 yet. This is a more correct fix to boundsj#74 .