-
Notifications
You must be signed in to change notification settings - Fork 722
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
Infinite loop/DDos when reaching end of container #186
Comments
yap i am have a similar issue. and the above solution should be working. can we please merge it ? |
Yeah I have found this exact issue when there is no initial data being loaded. |
Thank you for reporting this issue, I'll have a look ASAP.
|
How did that look go? I've been spending the past 24 hours on this exact issue.. but still no luck. I can't stop the infinite loading. |
Anyone have any work arounds for this? |
I believe I was having this issue. When my remote returned a small number of results, when a user scrolled down and hit the bottom of the container, infinite scroll would begin an endless loop of calls to the backend for data, which was always returning an empty array. In case anyone experiences this and still needs a work-around, you can use the "infinite-scroll-disabled" setting to ensure infinite scroll is disabled if remote has returned less than a certain number of docs. For example, in somewhat pseudo-code, in your HTML:
And in your javascript:
Now if we hit the bottom of our infinite scroll and there are no more results to show from remote, the last call to remote that had less than 25 items will have set vm.loading to true, meaning the intinite-scroll-disabled setting will also be true. |
Hey. We've got a bug with infinite scroll going into infinite loop, and because we're using ajax it results in overloading/DDosing our server. It happens only if you reach the end of the scroll
We're using version 1.2 with container that is absolutely positioned and takes part of the screen
As I said, the data is loaded through service over ajax (and then cached in _storage) with custom offset params. And basically when you reach the end of the container, only empty array is returned so no divs are added
I think this is primarily caused by ng-infinite-scroll.js:67
shouldScroll = remaining <= height(container) * scrollDistance + 1;
If i replace it with
shouldScroll = remaining < 0 && remaining <= height(container) * scrollDistance + 1;
then it works fine
The text was updated successfully, but these errors were encountered: