What about other transports. Engine io for example?
You received this message because you are subscribed to a topic in the Google Groups "ShareJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sharejs/AE-M5GQndcY/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to sharejs+u...@googlegroups.com.
If you're subscribed to a document that I'm editing, the server will send you operations in order (op 100 then op 101 then op 102). If the operations arrive out of order, the client will throw. I could buffer up the operations in the client and replay them when I have them all, but I'm not going to do that. That code is tricky to implement correctly (I know this from experience) and in my opinion its the responsibility of the data transport. The logic doesn't belong in ShareJS.
I'm also quietly convinced that there are other bugs in socket.io that will cause other issues. I've wasted days of engineering time tracking down obscure bugs in ShareJS, only to find that they're actually bugs in socket.io. For example, if a socket.io connection closes then reopens later (I sleep my laptop and wake it later on), what do you think happens? Last I checked, socketio emits an event telling you that the client is gone (so I flush all state related to that connection). When it comes back you simply get messages from a clientID which no longer exists. This crashed the ShareJS server (it was an obscure null reference that should be impossible, that I couldn't figure out how to reproduce). When I found out, I was shocked and appalled. Sockjs is better about this sort of thing but it still doesn't give you ordering guarantees.
By all means use a bad transport if you want. I won't judge you, but if you encounter obscure bugs I will ask you to switch to websockets or browserchannel and try to reproduce the problem before I waste my own time tracking it down. And I won't accept pull requests which add message ordering to ShareJS - it would only encourage more bug reports complaining about other socketio problems that I really can't do anything about.
As an aside, I get into these conversations every month or two. Most people I talk to who are building real realtime software in node have been burned by socketio as well, and I've shared a fair few war stories with them. I don't know anyone who runs socket.io in production, and I don't recommend you do either.
-J
It should be fine so long as messages stay ordered - browserchannel or
websockets both guarantee this.
On Mon, Mar 3, 2014 at 8:01 PM, Joseph Gentle <jos...@gmail.com> wrote:
It should be fine so long as messages stay ordered - browserchannel or
websockets both guarantee this.
That's the whole point - to provide a library that tries the best transport first (WebSockets) and falls back to the second best (Browserchannel). None of the other (broken) messaging libraries would be supported.The goal would be to plug this into ShareJS (either as-is, or via share-primus).