sharedb 3.3.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sharedb",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "JSON OT database backend",
5
5
  "main": "lib/index.js",
6
6
  "dependencies": {
@@ -576,8 +576,10 @@ module.exports = function(options) {
576
576
  });
577
577
 
578
578
  it('only stores even-numbered versions', function(done) {
579
- db.on('save', function(collection, snapshot) {
580
- if (snapshot.v !== 4) return;
579
+ var snapshotCount = 0;
580
+ db.on('save', function() {
581
+ snapshotCount++;
582
+ if (snapshotCount < 2) return;
581
583
 
582
584
  async.waterfall([
583
585
  db.getMilestoneSnapshot.bind(db, 'books', 'catcher-in-the-rye', 1),
@@ -619,8 +621,10 @@ module.exports = function(options) {
619
621
  callback();
620
622
  });
621
623
 
622
- db.on('save', function(collection, snapshot) {
623
- if (snapshot.v !== 4) return;
624
+ var snapshotCount = 0;
625
+ db.on('save', function() {
626
+ snapshotCount++;
627
+ if (snapshotCount < 2) return;
624
628
 
625
629
  async.waterfall([
626
630
  db.getMilestoneSnapshot.bind(db, 'books', 'catcher-in-the-rye', 1),