-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ensure that elements are added/removed in correct order #12
Comments
I also encountered documents that were missing. I'm sure that the document was smartPublished from server. But the client did not receive it. I checked the documents via Mongol tool. I'm not 100% sure that this is related to smartPublish API. But since I also encountered documents that was not received by client in correct order, maybe this is related. Here's my code and logs produced from server side: // Publications
Meteor.smartPublish("allitems", function (seed, limit) {
console.log("### publish(" + seed + ", " + limit + ")");
// return data with limit for infinite scrolling
var items = Items.find({});
var docCount = items.count();
var itemsArray = items.fetch();
var cursorArray = [];
var seedRandom = Meteor.npmRequire('seedrandom');
seedRandom(seed, {global: true});
for(var idx, i = 0; i < limit; i++) {
idx = Math.floor(Math.random() * docCount);
console.log("### publish::Math.random() [" + (i+1) + "][" + itemsArray[idx]._id + "][" + idx + "]");
cursorArray.push(
Items.find({_id: itemsArray[idx]._id}, {limit: 1})
);
}
return cursorArray;
}); As you can see from this logs from server, this document was not received by the client:
|
@joboyx would you mind creating a separate issue for that? I'll definitely look into. |
No description provided.
The text was updated successfully, but these errors were encountered: