Skip to content
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

Open
yeputons opened this issue Feb 1, 2015 · 3 comments
Open

Ensure that elements are added/removed in correct order #12

yeputons opened this issue Feb 1, 2015 · 3 comments
Labels

Comments

@yeputons
Copy link
Owner

yeputons commented Feb 1, 2015

No description provided.

@joboyx
Copy link

joboyx commented May 11, 2015

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:

I20150512-01:40:12.941(8)? ### publish::Math.random() [14][tdR7DGk3RggHiuX7G][685]

I20150512-01:40:08.673(8)? ### publish(zzurkngpZkkJXrpaS, 10)
I20150512-01:40:08.686(8)? ### publish::Math.random() [1][rPFAPosdZXJZqSHCW][699]
I20150512-01:40:08.686(8)? ### publish::Math.random() [2][BWQdpx8YoQ2GJrATT][89]
I20150512-01:40:08.687(8)? ### publish::Math.random() [3][vDutaad3zEHcjSjWA][541]
I20150512-01:40:08.690(8)? ### publish::Math.random() [4][WMuCyqJBpvz9XNgn6][548]
I20150512-01:40:08.690(8)? ### publish::Math.random() [5][J69Xg8sTv3zbG8GYA][803]
I20150512-01:40:08.690(8)? ### publish::Math.random() [6][Bw2WSHu5y3KTLF94b][466]
I20150512-01:40:08.690(8)? ### publish::Math.random() [7][hL94tCLDFsxf39Ge3][457]
I20150512-01:40:08.690(8)? ### publish::Math.random() [8][bfAYhYN6h5M9fiYo3][632]
I20150512-01:40:08.691(8)? ### publish::Math.random() [9][4yFvTAJk7zj8qwDBn][192]
I20150512-01:40:08.691(8)? ### publish::Math.random() [10][AweG3rKyszix3cWXk][110]
I20150512-01:40:12.916(8)? ### publish(zzurkngpZkkJXrpaS, 20)
I20150512-01:40:12.938(8)? ### publish::Math.random() [1][rPFAPosdZXJZqSHCW][699]
I20150512-01:40:12.939(8)? ### publish::Math.random() [2][BWQdpx8YoQ2GJrATT][89]
I20150512-01:40:12.939(8)? ### publish::Math.random() [3][vDutaad3zEHcjSjWA][541]
I20150512-01:40:12.939(8)? ### publish::Math.random() [4][WMuCyqJBpvz9XNgn6][548]
I20150512-01:40:12.939(8)? ### publish::Math.random() [5][J69Xg8sTv3zbG8GYA][803]
I20150512-01:40:12.939(8)? ### publish::Math.random() [6][Bw2WSHu5y3KTLF94b][466]
I20150512-01:40:12.940(8)? ### publish::Math.random() [7][hL94tCLDFsxf39Ge3][457]
I20150512-01:40:12.941(8)? ### publish::Math.random() [8][bfAYhYN6h5M9fiYo3][632]
I20150512-01:40:12.941(8)? ### publish::Math.random() [9][4yFvTAJk7zj8qwDBn][192]
I20150512-01:40:12.941(8)? ### publish::Math.random() [10][AweG3rKyszix3cWXk][110]
I20150512-01:40:12.941(8)? ### publish::Math.random() [11][XQ2AhMnqrPngpST57][178]
I20150512-01:40:12.941(8)? ### publish::Math.random() [12][TedPF9Pxifsf3h3kQ][557]
I20150512-01:40:12.941(8)? ### publish::Math.random() [13][4yFvTAJk7zj8qwDBn][192]
I20150512-01:40:12.941(8)? ### publish::Math.random() [14][tdR7DGk3RggHiuX7G][685]
I20150512-01:40:12.942(8)? ### publish::Math.random() [15][vJWa9PPwMarApcxs9][813]
I20150512-01:40:12.942(8)? ### publish::Math.random() [16][ZjKXGE4kvdaewE3NP][684]
I20150512-01:40:12.942(8)? ### publish::Math.random() [17][symshYjbCmp9y3BXm][421]
I20150512-01:40:12.942(8)? ### publish::Math.random() [18][NXqpkFLbaPZecikYu][839]
I20150512-01:40:12.942(8)? ### publish::Math.random() [19][bXgg5nNkqRvh7TwAo][535]
I20150512-01:40:12.942(8)? ### publish::Math.random() [20][TJXiWe3xF4tcqACzt][84]

@yeputons
Copy link
Owner Author

@joboyx would you mind creating a separate issue for that? I'll definitely look into.

@yeputons
Copy link
Owner Author

@joboyx it'd be really useful if you can share the code that produces the error. I've tried your snippet like this and it worked correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants