Delay the preCollection remove after upload to workaround sporadic timing issue. Fixes #324#331
Conversation
…ming issue. Fixes veliovgroup#324 Though the call to Collection.update should be blocking (server side) according to metoer API: https://docs.meteor.com/api/collections.html#Mongo-Collection-update In fact the update sometimes is not completed before the remove kicks in, which in turn triggers the preCollection.obeserve("remove") code. This leads to the situation that the oberver code sees an unfinished upload while the upload actually finished correctly.
|
Hi @derwok , I this issue solved on your end? I'm still experiencing it on heavy MongoDB load (when response is slightly delayed). And often on setup with remote MongoDB, like on mongolab (mlab.com). |
|
Hm. For me it was fine... I had one more idea (where my coffescript knowledge is not good enough to implement it)... Could we remove this part here: and move it in an observer changed() block like this: So we would decouple the $set {isFinished: true} from the remove() operation and we would wait for the observer-changed callback when MongoDB signals the doc has changed. Now if any preCollection doc changed and newDoc.isFinished==true then this could be our real signal to remove this doc from the preCollection...? Just an idea... |
Though the call to Collection.update should be blocking (server side) according to metoer API:
https://docs.meteor.com/api/collections.html#Mongo-Collection-update
In fact the update sometimes is not completed before the remove kicks in, which in turn triggers the preCollection.obeserve("remove") code. This leads to the situation that the oberver code sees an unfinished upload while the upload actually finished correctly.