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

Broken server side subscription on Meteor 2.0 #154

Open
1 task
aessig opened this issue Feb 20, 2021 · 7 comments
Open
1 task

Broken server side subscription on Meteor 2.0 #154

aessig opened this issue Feb 20, 2021 · 7 comments
Labels

Comments

@aessig
Copy link

aessig commented Feb 20, 2021

What

The client collection gets fed with results and the results accumulate. So we have 5 entries (for example) at the first letter input, then when the second letter is typed in, we have 10 entries in the client collection. The client-side of the code displays everything it has in the collection, therefore the autocomplete doesn't work. It looks like the _publishCursor doesn't purge the collection every time it's updated.

Reproduction

  • Run Meteor 2.0 with meteor-autocomplete (last commit of master branch) and server-side subscription.

Here is what the code looks like on the server:

Meteor.publish("autocompleteMyCollection", function(selector, options) {
  Autocomplete.publishCursor(MyCollection.find(selector, options), this);
  this.ready();
});
@aessig aessig added the bug label Feb 20, 2021
@aessig
Copy link
Author

aessig commented Feb 20, 2021

@StorytellerCZ Have you encounter anything like this?

@StorytellerCZ
Copy link
Member

@jankapunkt is probably the better person to ask.

@aessig
Copy link
Author

aessig commented Feb 21, 2021

Thanks, @StorytellerCZ.
It really looks like the .stop() function is not clearing the collection. Might be a Meteor issue? @jankapunkt

@jankapunkt
Copy link
Member

Hi @aessig @StorytellerCZ ,

I currently develop autocomplete for AutoForm but it's generic and not bound to this package (but can be used with this package). I actually am not very deep into this package so I can't really help (I also have always big trouble understanding cofeescript...).

@aessig do you use some package or technique to cache subscriptions like kadira SubsManager or ccorcos SubsCache?

@aessig
Copy link
Author

aessig commented Feb 22, 2021

Thanks for this quick reply. No, I don't use any subs manager. If you have an alternative for AutoForm, it might be a solution too. Is it based also on pub/sub or methods? Do you have anything public?

@jankapunkt
Copy link
Member

Regarding AutoForm: this is simply the ui and form component (the input field + some rendering) but you have to provide the autocomplete options on your own (so it is compatible with any implementation) so I think this won't be an alternative. You can check the latest PR on it.

@aessig
Copy link
Author

aessig commented Feb 22, 2021

Thanks @jankapunkt. I will have a look.

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

No branches or pull requests

3 participants