Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

doc.submitOp callbacks not being called #169

Closed
benogle opened this Issue · 2 comments

2 participants

@benogle

Basically, doc.inflightCallbacks can be overwritten with doc.pendingCallbacks before the server responds to a previous set of operations and calls their callbacks in doc._onMessage.

Here's the flow:

doc.submitOp([op1, op2], cb1)
// -> calls doc.flush() sets inflightCallbacks

// key/mouse event creates another set of ops
doc.submitOp([op3, op4], cb2)
// -> calls doc.flush() again and overwrites inflightCallbacks and inflightOp

// Server responds
doc._onMessage()
// -> does not call cb1; calls cb2

Maybe the solution is to concat the pending and inflight callbacks.
https://github.com/josephg/ShareJS/blob/master/src/client/doc.coffee#L256

We're attaching watchdogs to each submitOp call, and we rely on this callback to turn the watchdog off (and the saving... -> saved message in the interface). But the watchdogs are firing more than they should for folks with spotty connections, and it seems they are firing when data is actually making it to the server.

Also, if this is happening, there might be issues from overwriting the doc.inflightOp. But I'm not sure of the implications.

@josephg
Owner

Sorry I didn't see this at the time - I was moving house. Is this still happening? This code has since been rewritten for 0.7, but not merged into master yet. It should be fixed now, though we should add a test for it.

@benogle

We havent had any issues since upgrading to 0.6. Closing.

@benogle benogle closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.