Duplicate DDP messages

Hi, I have some standard infinity scroll pagination where subscription is changed by increasing the limit and everything works fine and correctly. However I noticed in meteor tools that after requesting to add 25 more elements I sometimes get 50 or 75 or even 100. After checking one I wound that it contains 2 ddp “added” messages with different ids for the same element. Is it normal? I checked publication and can confirm it correctly asks for 25, and everything works fine so those correct 25 are received, just sometimes duplicated. Is this meteor bug?

Most likely you need to use a debounce function on the event that triggers the fetch

Do you mean two different document ids for the same document? This should definitely not happen, even if you subscribe multiple times in quick succession (e.g. because of a missing debounce).

Another question: Did you use unblock() in your publication? I noticed that this will cause Meteor to re-send all documents that already existed in the subscription before extending the limit.

No it’s different is not a document id but the DDP message ids. Both messages contains exactly same documents. And no I don’t use unblock in publications, but planning to look into it in 2.3 when it will be enabled by meteor itself.

Actually I think it’s fake alarm, and there is some weird behavior with meteor tools extension itself. If I actually clear traces after each page it’s always has correct 25 documents loaded with each page. If not sometimes it increases by 25 with each page (like 50, 75, 100) and then 25 again. Sometimes even completely uneven numbers. I guess it’s buggy…
For some reason Monti doesn’t work either and shows fetched documents as zeroes. I’ll try to find what’s wrong and hopefully Monti will be able to confirm that everything is all right.