Only show duplicate id warning if really from _id

Fixes #1980
This commit is contained in:
Joe Gallo
2014-06-18 17:36:51 -07:00
committed by David Glasser
parent 4bec4877e3
commit 3c6c8e591c
2 changed files with 3 additions and 2 deletions

View File

@@ -116,7 +116,8 @@ ObserveSequence = {
var idString = idStringify(id);
if (idsUsed[idString]) {
warn("duplicate id " + id + " in", seq);
if (typeof item === 'object' && '_id' in item)
warn("duplicate id " + id + " in", seq);
id = Random.id();
} else {
idsUsed[idString] = true;

View File

@@ -483,7 +483,7 @@ Tinytest.add('observe sequence - number arrays', function (test) {
{removedAt: [{NOT: 1}, 1, 1]},
{addedAt: [3, 3, 1, 2]},
{addedAt: [{NOT: 3}, 3, 3, null]}
], /*numExpectedWarnings = */2);
]);
});
Tinytest.add('observe sequence - cursor to other cursor, same collection', function (test) {