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 Override #69

Open
toledoroy opened this issue Sep 24, 2020 · 4 comments
Open

Subscription Override #69

toledoroy opened this issue Sep 24, 2020 · 4 comments

Comments

@toledoroy
Copy link

Hi,

After replacing some of the Meteor subscriptions to cached subscriptions some of them seem to have been overriding each other. (when one subscribes the former disappears)

I'm not sure when it happens or how to recreate this... or how to avoid it.

When making multiple subscriptions to the same point (I.e. 'post, 1', 'post, 2',[...]) how does the cache keep track and determine which subscription is which?

@paranoico
Copy link
Collaborator

Hi,

It should work the same way Meteor does, depending on the parameters, meteor on client decides if it is a new subscription and store it on cache.

We currently use this package on our biggest app and have not seen problems like that.

Are you changing the collection locally our how do you know it is overridden?

@jankapunkt
Copy link
Contributor

@toledoroy

When making multiple subscriptions to the same point (I.e. 'post, 1', 'post, 2',[...]) how does the cache keep track and determine which subscription is which?

Can you please show the post publication? Usually it is best practice to have one publication for one use case. How should post behave in your opinion, if the same client subscribes to the same publication with different parameters?

@toledoroy
Copy link
Author

toledoroy commented Sep 30, 2020

Are you changing the collection locally our how do you know it is overridden?

@paranoico I have quite an unusual case of subsequent subscriptions happening in my app. I guess that would usually not be a problem under common usage.
By "being overwritten" I mean that a previous subscription (that's displayed on the same page) disappears.
I see the package uses a hash made of a JSON stringify of all the parameters do identify subscriptions, which seems like it should prevent such overrides...
I'm still looking into it. I'll let you know if I find something out.

How should post behave in your opinion, if the same client subscribes to the same publication with different parameters?

@jankapunkt I'm not sure how it should behave, I just expected it would be interchangeable with the Meteor subscribe and behave the same.

@paranoico
Copy link
Collaborator

@toledoroy How do you determine the subs is overridden? Are you pushing changes using Meteor methods? Or are you changing data locally?

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

3 participants