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

Subscription not expiring #67

Open
afuggini opened this issue Jan 12, 2016 · 5 comments
Open

Subscription not expiring #67

afuggini opened this issue Jan 12, 2016 · 5 comments

Comments

@afuggini
Copy link

I'm subscribing through Iron Router's waitOn. I initiated an instance as:

App.Subs = new SubsManager(
  cacheLimit: 20
  expireIn: 1
)

Then did App.Subs.subscribe 'inventory' within waitOn but after I change the route and wait for 1 minute, documents are still there if I query them using the client console.

Any ideas? Thank you!

@joegoldbeck
Copy link

+1. Subscription still seems to be active in Meteor.default_connection._subscriptions too

@afuggini
Copy link
Author

afuggini commented Feb 7, 2016

@arunoda What are we missing here?

@arunoda
Copy link
Contributor

arunoda commented Feb 28, 2016

Can I have a sample case? may be a simple app?

@dnish
Copy link

dnish commented Mar 29, 2016

+1 not working

@arunoda You can check it with a simple app that uses a subscription. The subscription data is still available after the expire time. I've tried it on a chat application, set expireIn to 1 minute and still got messages after 5 minutes.

@vuhrmeister
Copy link

+1

I experienced the same issue. I can give an example.

I have a list with a pagination:

---- Item 1 ----
---- Item 2 ----
---- Item 3 ----

< | 1 | 2 | 3 | >

Initially (being on page 1) I subscribe to the list collection with skip and limit param to get only results for the first page. Navigating to page 2 subscribes to the same publication but with different skip value.

Now let's count the documents (the result is as expected):

MyCollection.find().count() // => 6

Let's wait until the subscriptions are expired (after expireIn) and count again:

MyCollection.find().count() // => 6

So even when the subscriptions are expired all documents are still cached.

Going back to page 1 count() would still return 6.

Let's wait again until the subscription is expired. Now we navigate to page 3.
What happens?

MyCollection.find().count() // => 3

So only when subscribing with different parameters the old subscriptions are actually removed!

I hope that helps.

For the moment I need to increase expireIn to something high for not getting trouble when paging through the list.

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

5 participants