Mathieu Bouchard matb33

@matb33

What you need to do is find a way to use minimongo on the server. I'll be honest... I don't remember how to do this without packages. My meteor pro…

matb33 opened issue meteor/meteor#4005
@matb33
Template instance setTimeout and setInterval
@matb33

I agree it would be helpful. Have any of you tried just leveraging LocalCollection._modify directly? Something like: coll.before.update(function (u…

@matb33

Have you tried restructuring a bit by having your notification created in a server-defined Messages.after.insert hook? It's safer in general

@matb33

I don't think the second argument is optional: http://docs.meteor.com/#/basic/Meteor-publish

matb33 commented on pull request matb33/meteor-collection-hooks#102
@matb33

It's been busy on my end -- I will look at this as soon as I can. Thank you for the pull request!

@matb33
Accessing variable from a require where spawned code is minified
matb33 commented on issue meteor/meteor#2920
@matb33

Apologies @Slava, I don't have a project using meteor's cordova at the moment. That being said the repo I provided should be useful in testing befo…

matb33 commented on pull request matb33/meteor-collection-hooks#96
@matb33

Out of curiosity, is there a reason you are using that getUserId() instead of Meteor.userId()?

@matb33
@matb33
collection.direct.update(id, ...) doesn't work
@matb33

This may be the same issue as in #89

@matb33

Unfortunately not... interesting use case though. I can certainly see it being handy if you know for sure you need createdAt/modifiedAt across the …

@matb33

@scottsimock unfortunately I wrote that only as an example, but it shouldn't be too hard to write. That being said, there are a ton more options ar…

@matb33
Collection Hooks uses modifier from first document for all documents when an update is run with multi=true
@matb33

Right, calling throw will exit out of the current function. Your insert is still getting called somehow.

@matb33

The collection hooks wrap the insert function, not the method from Meteor.methods. In your code, if you throw an error within your insertOrganizati…

@matb33

Strange... Can you confirm with a small reproduction scenario that I could run?

@matb33

Something somewhere is calling insert. Collection hooks don't tail the oplog or anything fancy like that -- they literally just wrap the original i…

@matb33

Perhaps if you detect multi: true in your before update, do the find loop with individual updates yourself and be sure to return false so the under…

@matb33

Huh... There is literally nothing I can easily do about it by virtue of how it's a single operation. You get once chance to mutate the modifier, as…

@matb33

Don't forget that your Meteor method is defined on both server and client. That means that both will run when called from the client. And recall th…

@matb33

If that throw really does occur on the client, the remainder of the function is never called and thus the insert is never called. Collection hooks …

@matb33

It really just seems like your checks are leaking through on the client and hitting the insert on the client, subsequently firing on the server uni…

@matb33

So on the client, it gets through your checks and calls Organizations.insert then? And then no allow/deny logic on the server end?

@matb33

OK, do I have this pieced together accurately? ## Shared Meteor.methods({ "yourInsert": function (doc) { if (!isAllowed(this.userId)) { throw new M…

@matb33

I think I need a clearer picture of what you're doing. Are you calling with a Meteor.call? Can I see in what context your insert is called? Is it r…

@matb33

Just FYI, I spent a bit of time on this and it's a tough one to fix. I'll get back to it as soon as I can.

@matb33

Unfortunately, the server will trust your insert if called server-side. It makes sense, but it means you may need to rejig your code a bit, i.e. br…