Meteor-Community-Packages / meteor-collection-hooks

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

Calling Meteor.userAsync inside pub throws an error in meteor 3 beta #307

Open bratelefant opened 8 months ago

bratelefant commented 8 months ago

If you call Meteor.userAsync inside a publication you get a Meteor.userId can only be invoked in method calls or publications.

To Reproduce Steps to reproduce the behavior:

  1. Clone my minimal repo
  2. Start the app via meteor run
  3. Open the browser to call the pub links (from server/main.js), which calls Meteor.userAsync() inside.
  4. See error in the console

Expected behavior It is expected, that this exceptions is not thrown, since Meteor.userAsync() is called within a publication.

Screenshots

Desktop:

Smartphone: n/A

Additional context You can downgrade to 2.14 via meteor update --release 2.14 and the exception disappears. Also, you can meteor remove matb33:collection-hooks and the exceptions disappears.

github-actions[bot] commented 8 months ago

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee you issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.

Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know.

denihs commented 7 months ago

This is now fixed on beta.4!

bratelefant commented 7 months ago

Great, going to test it!