meteor-publication-collector icon indicating copy to clipboard operation
meteor-publication-collector copied to clipboard

Behaviour onStop

Open Gitii opened this issue 8 years ago • 3 comments

Since 1.0.4 the behaviour of collect(...) regarding this.stop() seems to be changed, the callback will not be called if the publication is stopped before it is "ready". Is this intended?

Thanks

Gitii avatar Mar 07 '17 18:03 Gitii

AFAIK, a Meteor publication isn't marked as "ready" if this.stop() is called within it. I might be wrong though.

johanbrook avatar Mar 07 '17 21:03 johanbrook

I think that, too. My question is: Should the callback passed in to collect(...) be called on stop or not? In 1.0.4 that is the case, in 1.0.7 not.

Gitii avatar Mar 07 '17 21:03 Gitii

I think it should, that's my opinion. One can check the callback's parameter to see if zero documents were published, hence stop() was called.

Feel free to look into it if you'd like.

johanbrook avatar Mar 07 '17 21:03 johanbrook