Meteor-Community-Packages / meteor-publish-composite

Meteor.publishComposite provides a flexible way to publish a set of related documents from various collections using a reactive join
https://atmospherejs.com/reywood/publish-composite
MIT License
553 stars 58 forks source link

Meteor collection hook direct not working #147

Open Sergeant61 opened 1 year ago

Sergeant61 commented 1 year ago

Hello, I'm going to talk about a bug we noticed. We use priority redis oplog and we don't have the problem when we don't use it. During the use of meteor-collection-hook with publishComposite, we enter the before hook in the collection queries we make with direct and our queries do not work correctly.

Example:

...
    children: [
      {
        find(session) {
          this.unblock();
          return Channels.direct.find({ _id: session.channelId });
        }
    ]
 ...

Normal publish works correctly:

Meteor.publish('name', function () {
  return Channels.direct.find({  _id: session.channelId })
});