Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Inserting multiple items with the same _id into a local collection results in very confusing error #1246
Both myself and at least one other user have seen the following very strange bug pop up spontaneously in a Meteor app:
It doesn't tell you what exactly the problem is (why is minimongo on the server anyway?) and I could only get it to go away by randomly changing my code around.
As you can see, it's not related to the fact that I was using Tinytest as another user has also had the same problem during normal Meteor use.
I can try to show code that reproduces this error if that helps, although when I was observing it, it was not deterministic.
EDIT: Title updated after we found out what was going on.
I've spent several hours trying to track this down. The collection hooks don't appear to be responsible -- in the case of digilord's codebase, the "user-status" smart package was responsible for causing his problems.
mizzao, that package looks like it's one of yours. Did you by any chance have that smart package enabled when you got your error?
@matb33 thanks for finding this. To reproduce
On the client, this says "insert failed". On the server, it just prints the following. I think both error messages could be enhanced a bit and save some poor fool like me several hours of debugging in the future.