Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

Weird behaviour on before.insert - failing silently #33

Closed Lobosque closed 10 years ago

Lobosque commented 10 years ago

I have a before.insert for a given collection, the code (supposedly) runs on both client and server, but for some reason, sometimes the hook is called only in the client, but it does not run on the server. In the client, everything works just fine, I even get an _id for the document I just inserted in my collection. But on the server, the document never gets there, and the before hook is never called (or gets called, but fails silently). Anyone been through a similar issue? I will try to gather more info, but this is being a pain to debug, as it happens randomly. Update: This is most definitely related to meteor-collection-hooks, as removing the hook make the insertion works just fine. Update2: The problem was in my code. Sorry!