meteorhacks / unblock

this.unblock inside publications :D
MIT License
87 stars 14 forks source link

this.unblock() is not honoured when doing login / logout after pub / sub #7

Closed williamli closed 8 years ago

williamli commented 8 years ago

even if the pub is unblocked when it was first setup, the this.unblock() is not honoured when user login / logout after established the pub / sub. (Meteor always republish everything upon user changes - login / logout)

arunoda commented 8 years ago

Hi,

I think you are bit confused about the use the unblock. Meteor publish will always do it's job. Please read this article: https://meteorhacks.com/understanding-meteor-wait-time-and-this-unblock

williamli commented 8 years ago

with this.unblock in a publish, the subscription doesn’t have to queue up and wait for DDP to come back.

this works until the account status changes (user logged in / logged out)

On 24 Sep 2015, at 11:44, Arunoda Susiripala notifications@github.com wrote:

Hi,

I think you are bit confused about the use the unblock. Meteor publish will always do it's job. Please read this article: https://meteorhacks.com/understanding-meteor-wait-time-and-this-unblock https://meteorhacks.com/understanding-meteor-wait-time-and-this-unblock — Reply to this email directly or view it on GitHub https://github.com/meteorhacks/unblock/issues/7#issuecomment-142799979.

williamli commented 8 years ago

@arunoda FYI, Meteor is not doing its job when a user status changes (logged in / logged out) after a subscribing to a publish with this.unblock() in it. Meteor will refresh all the pub / sub and the previously established unblock publish will get reset / re-established but the this.unlock call will no longer be effective in this case.

In our project, we have unblock pub / sub (like 10 of those) and they initially get established fine and quickly (done in less than a second), which results coming in at a later time (unblock working). When we toggle the user state (login / logout), the site will take forever before a user is logged in / out (waiting for the pub / sub to be reestablished before user is logged in / out). We have server logs to back this.

lutzklai commented 8 years ago

Any news on this? I am having the same issue with methods. unblock works fine if multiple methods are called, however if I try to logout while this method is running it waits till the method is finished