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

All published records removed and re-added on subsequent subscriptions in 1.7.1 #124

Closed
sean-kates opened this issue Aug 26, 2019 · 4 comments

Comments

@sean-kates
Copy link

Hi there,

Seems to be that in the most recent update (1.7.0 -> 1.7.1), the publication behavior changed somewhat significantly. Not positive if it is intended, I certainly didn't expect it.

We use publish-composite for a list of items that a user can scroll through, sorted by some field. We pass the subscription a limit (lets say 25 items), and once the user reaches the bottom of the list, they click "Load More", which bumps the limit up to 50, and re-subscribes with the new limit.

In 1.7.0, the re-subscription just published the next 25 items in the list since the first 25 are already published. In 1.7.1, the re-subscription actually removes all the currently published items, and then publishes the 50 items.

This is a problem for the pagination since the user all of a sudden has no items in their view, which scrolls them up to the top of the page, and then once the 50 items are published, they have to scroll all the way back down to where they were before.

Thanks!

@yched
Copy link

yched commented Sep 6, 2019

We're also seeing unintended behavior changes after 1.7.1 and #121.

In our case this happens when a user logs in - when that happens, it seems Meteor stops and immediately restarts all existing subscriptions (composite and "regular" ones).
For documents published by regular, non-composite publications, this is transparent, causing no actual DDP activity.
For composite publications, this was transparent too until 1.7.0.
In 1.7.1, the documents returned by the top-level 'find' in each composite subscription get removed and readded over DDP, causing UI flickering and the loss of scroll position due to the unmounting / remounting of the corresponding DOM nodes.

@reywood
Copy link
Collaborator

reywood commented Sep 6, 2019

I have reverted the previous changes and released a new version. Let me know if this fixes the problem.

@yched
Copy link

yched commented Sep 6, 2019

@reywood works perfectly, thanks a lot for the quick fix !

@sean-kates
Copy link
Author

Works great! Appreciate the fix.

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