josephg / ShareJS

Collaborative editing in any app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Will not reconnect when inflightOp

benogle opened this issue · comments

With no pending operations, a disconnect -> reconnect works as expected. I added logging to each of the connection's events and a logline to doc._onMessage(). Check it

no pending ops

If I add operations after killing the server, then restart, the behavior is different. You can reproduce in one of your text examples by killing the server, typing a bit, then restarting the server.

pending ops

The two POSTs in the middle of the requests there are operations.

  1. After it prints on onopen, it hangs for a second.
  2. There is an auth timeout here: https://github.com/josephg/ShareJS/blob/master/src/client/connection.coffee#L58 The message msg.error is Timeout waiting for client auth message
  3. Then onclosed is fired and the connection state is set to stopped.

This is with version 0.6.2. We think it might be related to the fix for #140 fb1a9fb

Of note, on the server, the session never fires a message event. So this is never called: https://github.com/josephg/ShareJS/blob/master/src/server/session.coffee#L326

I'll get you request dumps from chrome.

Here are the HAR ( https://github.com/janodvarko/harviewer )

Normal Reconnect: http://d.pr/f/os2R
Failed Reconnect: http://d.pr/f/cDJQ

Note that chrome does not track the requests that cant connect to a server. So the har files will be missing the op requests when the server is not running.

This issue is very easy for us to reproduce.

  • kill server
  • add ops
  • restart server

Hm, I can't reproduce the problem locally. It seems to work fine for me. I'll take a look at the logs you sent.

What OS & version of NodeJS are you using?

Also see my comment on issue #197 - Are you running the example server with a database or not?

This is our issue. Really sorry about that.

We are running the postgres DB local.

No worries.