Meteor-Community-Packages / meteor-collection-hooks

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

defaultUserId always gets overridden #222

Closed hluz closed 7 years ago

hluz commented 7 years ago

CollectionHooks.defaultUserId does not appear to "stick". Always gets overriden by the userId of the context even when there is no context.

Scenario is exactly what the CollectionHooks.defaultUserId is supposed to cover: API end point where User id is derived from a token.

Code block appears to confirm this: https://github.com/matb33/meteor-collection-hooks/blob/master/collection-hooks.js#L28-L51

zimme commented 7 years ago

Yeah, seems that would result in it always being the overridden with the contexts userId even if that is null or undefined.

zimme commented 7 years ago

Should be solved with b0191f0786a5dd7e3a1bfad6450b823b65859fef. Try 0.9.0-rc.4 and see if that solves if for you, also keep in mind that 0.9.0 contains some "breaking" changes also so have a look in History.md to see what those are.

hluz commented 7 years ago

0.9.0-rc.4 does it! Many thanks for quick response.