I’ve tried searching for this and not having much luck… sorry if this is clearly posted elsewhere. The best I could do is find this post, but it’s not really clear to me. I searched the commit on github as well… but I’m lost.
Perhaps my issue is not related to this, so here is a brief explanation of the issue I am running into:
I am sorting multiple nested items, which requires multiple
collection.update()
to be called. At times this fails, on the client I see a glitch where the item is moved back to it’s original position… if I refresh (reload) the order is corrected.
While debugging I have noticed that the helper that builds the hierarchy is called more than once after the update, anywhere from 2-4 times. For some reason the last update at times contains the wrong order information for the document moved, even though the previous one is correct… In other words: if client updates 3 times and I write the output of .find().fetch(), the 1st and 2nd updates has the correct data, but 3rd has incorrect values returned?! (all is written properly to db, just last update is wrong, which is why page reload works).
I am assuming the issue here could be solved by increasing bufferedWritesInterval
from 5ms to something slightly higher to ensure the client only updates once and all values are correct?
What I am not understanding is:
- Where/how do I set this to a higher value
- Other than grater delay, would setting the value to something like 100ms cause any other side-effects? I’ll probably try 20, 40…
- Is this a global setting, or can I set it for a specific pub/sub as to not affect the rest of the app.
Any information, pointers, and help would be greatly appreciated – thanks in advance