DDP Web Socket Reset Cycle in Meteor 0.8.1.1 #74
Comments
Thank you. Looks like v0.8.1.1 requires "pre2" for version. MeteorClient should allow users to set the version string. Will add that soon. |
Want me to implement that and send you a pull request? |
Are you comfortable updating the specs too? If not then no worries, I can take care of it by the end of the day today. In any case, many many thanks!!! |
No but I'd like to learn...if you are going to do it today, I'll wait. I will study them so in the future I can contribute. Thanks!!! |
Ok. It'll be easier in the future, too, since cedar will be a pod. Will follow up here / offline. |
@premosystems please see commit 4ea0fd7 for details. Most relevant file changes are MeteorClient.h and MeteorClientSpec.mm. Note that ddpVersion is now a required param when initing MeteorClient - use "pre1" or "pre2" depending on which meteor server you use. I also updated the Example app and it's meteor app/server to reflect all of this. I will forward port this feature to the ongoing work in this branch for the next release. It's worth noting that on that branch cedar is linked to as a pod and so the development environment and test running is generally easier to set up. Getting started with Cedar is still somewhat involved though and requires reading the cedar docs. |
See my comment on meteor/meteor#2125 ! |
[#fixes boundsj#74] Add meteor version as required parameter
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 .
If we pretend to be "pre2" without actually conforming to pre2, that means the server expects us to implement heartbeats and randomSeed (https://github.com/meteor/meteor/blob/devel/History.md#ddp-and-mongodb) but the client just ignores those messages. That sounds like things will start breaking. I've followed @glasser's recommendation in meteor/meteor#2125 to add a "support:['pre1']" field to the connection message in lookback@3af67b4 . |
You'll need to implement heartbeats for pre2 (and should eventually: after all, we're in pre-1.0 land so I don't expect that we will implement pre1 indefinitely) but randomSeed is an optional feature sent by clients, so there's nothing to implement if you don't want to make it available to your users. |
DESCRIPTION
Was there a change in the websocket implementation in Meteor v0.8.1.1?
A corresponding Meteor issue has been created here: meteor/meteor#2125
PRE-REQUISITES
STEPS TO REPRODUCE
Run the iOS app in the simulator.
ACTUAL BEHAVIOR
meteor-example-failing-0.8.1.1
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?
EXPECTED BEHAVIOR
meteor-example-passing-0.8.0.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: