-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffered livedata fix #167
Conversation
… the same tick anymore.
...As of meteor/meteor#5680. This can be left as it was though, and seems to work fine either way, though not overriding _waitingForQuiescence would be nice.
Should be completely backwards compatible too! |
Hey. Thanks for the awesome fix. |
Published as |
conn._waitingForQuiescence = function() {return false}; | ||
conn._livedata_data(message); | ||
conn._waitingForQuiescence = originalWait; | ||
if (conn._bufferedWrites) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change should not have been included because if the connection is _waitingForQuiescence
(for instance if a login method is run on startup), the writes get placed into a _messagesBufferedUntilQuiescence
queue.
Those messages will not get into the _bufferedWrites
queue until quiescence happens (the method returns from the server). So the later _flushBufferedWrites()
will not pick them up.
See (meteor/meteor#7618)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I had things working at some point, but indeed, that makes sense. Looks like @dnish already got the fix applied for this. Good catch!
Since meteor/meteor#5680 provides (awesome) support for buffered DDP, two (what seem to be) false-positive issues popped up in
fast-render
. Nothing seemed actually wrong unless you were trying to do things mid-CPU tick (like tests or error checking). Both of these were found during accidental release of that PR in Meteor 1.3.2.1/2. The PR will be back in Meteor 1.3.3 and this should hopefully address the problems.flow-router
started throwing a false-positiveYou can't use reactive data sources like Session inside the '.subscriptions' method
error (despite the lack of subscriptions) because of the lack of flushing on the same tick inFastRender.init
. Calling the connection's_flushBufferedWrites
(if it exists), fixed this issue with no changes necessary toflow-router
. The (incorrectly) thrown error was affecting subscriptions ability to becomeready
because theTracker
.fast-render
package tests started failing because livedata updates were not happening in the same tick as the test that was checking them. I changed the tests that do this to useTinytest.addAsync
and wait until the default_bufferedWritesInterval
milliseconds have passed. This value is hardcoded to 5 inlivedata
, so I used that here too.Fixes #166