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

Clear scroll context also when empty page was received #1660

Merged
merged 1 commit into from Sep 5, 2019

Conversation

@mjanser
Copy link
Contributor

mjanser commented Sep 5, 2019

No description provided.

Copy link
Owner

ruflin left a comment

Could you add a changelog entry?

I wonder if this could also have some side effects? Perhaps you could share some more background info on how you stumbled over this and what problem it solves?

Scroll contexts should always be cleared when they're not used
anymore. Retrieving an empty page from a scroll means it's finished
and the context can be cleared.
@mjanser

This comment has been minimized.

Copy link
Contributor Author

mjanser commented Sep 5, 2019

Added a changelog entry.

The scroll context was already cleared when a foreach loop over the scroll was finished (currentPage >= $totalPages). This change clears the context also when the page contains an empty result. This can happen if there aren't any hits and therefore the first page contains no results. This directly ends the foreach loop and the scroll context was kept open.

@ruflin

This comment has been minimized.

Copy link
Owner

ruflin commented Sep 5, 2019

Thanks for the additional details. I must confess I have not used this part of the code enough myself to fully understand the potentially side effects but it looks good. So let's get it in, especially as it doesn't break any tests :-)

Thanks for the contribution.

@ruflin ruflin merged commit 9990f64 into ruflin:master Sep 5, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mjanser mjanser deleted the liip-forks:fix-scroll-clear branch Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.