wip changed published document can go into buffer

This commit is contained in:
Slava Kim
2014-02-15 01:32:05 -08:00
committed by David Glasser
parent 10d97c70c5
commit 92d38af16d

View File

@@ -276,6 +276,12 @@ _.extend(OplogObserveDriver.prototype, {
} else {
// after the change doc doesn't stay in the published, remove it
self._removePublished(id);
// but it can move into buffered now, check it
var maxBuffered = self._unpublishedBuffer.get(self._unpublishedBuffer.maxElementId());
if (self._justUpdatedBuffer || (maxBuffered && comparator(newDoc, maxBuffered) < 0))
self._addPublished(id, newDoc);
else
self._justUpdatedBuffer = false;
}
} else if (bufferedBefore) {
// after the change we can't know if doc is still in the buffer limit