The item passed to the addItem method gets saved as it should be (i.e., addItem is being executed as intended on the server side), but none of the code in the callback appears to be run.
What might be the cause of this? I read that it might be an issue around (a)synchronicity, but I can’t make much of that at the moment.
TIA
Matt
NB: This should be an almost exact copy from Commit 7-7 in “Discover Meteor”, so I am a bit at a loos why this wouldn’t be working.
What does the method addItem look like? What parameters does it expect?
BTW, the server method knows who the this.userId is. Adding the userId to the parameters of the method makes it inherently insecure, because now I can call addItem from the client side browser console with some arbitrary other userid
Are you absolutely certain your method is on the server? What you are seeing suggests that the method is being executed as a client stub.
…On the client, the return value of a stub is ignored. Stubs are run for their side-effects: they are intended to simulate the result of what the server’s method will do, but without waiting for the round trip delay…
Your Items.insert(item) would still work if the insecure package was present, or you have appropriate allow rules for that user.