Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subs manager will send null as a subscription parameter #43

Open
elie222 opened this issue Jun 3, 2015 · 4 comments
Open

Subs manager will send null as a subscription parameter #43

elie222 opened this issue Jun 3, 2015 · 4 comments

Comments

@elie222
Copy link

elie222 commented Jun 3, 2015

I'm having trouble narrowing down what's happening, but I have the following line:

  console.log(n);

  if (n)
    subscription = subsManager.subscribe('fixtures', n);

and n is always an int, but the publication will sometimes receive null instead of the number.

What does help me fix this is increasing the subsmanager cachelimit. It seems that when the cache limit is hit, the subscription sends null instead of the number.

This also causes the page to refresh (using iron router). It seems like it's a subsmanager problem since increasing the cachelimit helps things.

@arunoda
Copy link
Contributor

arunoda commented Jun 4, 2015

I'm quite not sure, this is happening or not. We simply send all your arguments to the original function. I don't think this is true.

But, nothing is impossible. So, if you have isolated case and sample repo, that helps me to debug.

@elie222
Copy link
Author

elie222 commented Jun 4, 2015

I'll dig deeper tonight and try find exactly where the null subscription happens in the subscribe code.

@arunoda
Copy link
Contributor

arunoda commented Jun 4, 2015

Kool.

On Thu, Jun 4, 2015 at 2:35 PM Eliezer [email protected] wrote:

I'll dig deeper tonight and try find exactly where the null subscription
happens in the subscribe code.


Reply to this email directly or view it on GitHub
#43 (comment)
.

@elie222
Copy link
Author

elie222 commented Jun 5, 2015

I think I figured out the issue. It's a problem with using iron router (IR) and subs manager (SM) together.

I was making template level and route level subscriptions. Each time I clicked a button on the page, I was making another subscription without changing the route. Eventually, I made so many subscriptions that SM dropped some of the route level subs. This caused IR to refresh the page. The null subscription was an after effect of the refresh. Still not sure how it happened, but that's not the main issue.

Anyway, to solve this problem, I just subscribe using Meteor.subscribe in my template now. I should probably do this throughout the site, or move all subs to the router level.

Hope this might be useful to someone else, and wondering if there are better ways around this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants