Loading image when scrolling with mouse wheel

Describe the problem you’re having:
I am in combined mode. I noticed that sometimes, when scrolling with the mouse wheel, sometimes the content of the articles are not showed and replaced with a loading gif. I am not sure, but it happens with feeds with short articles.

If possible include steps to reproduce the problem:

Find a feed with many short articles and scroll with the mouse wheel

tt-rss version (including git commit id):

Tiny Tiny RSS v20.10-e13d665

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
shared hosting. It happens with Chrome and Firefox

Please provide any additional information below:


I’ve also noticed this, my guess would be IntersectionObserver skipping some elements, sometimes, for whatever reason. this stuff is hard to debug though because it only happens maybe once in a few days to me.

e: javascript - Intersection Observer fails sometimes when i scroll fast - Stack Overflow IntersectionObserver too fast site:stackoverflow.com - Поиск в Google etc

e2: it would be interesting to see whether observer simply ignores those elements or provides incorrect intersectionRatio.

if there is any way I can help you let me know.

figure out how to replicate this issue. :slight_smile:

i made a test feed with a lot of very short posts but that didn’t work.

e: i managed to make one post not unpack after scrolling for like 5 minutes. meh.

e2: now that we have native lazy image loading (img loading=lazy) there might not be that much point in the whole unpacking thing, maybe it needs to be removed altogether.

e3: if nothing else the UI seems a bit faster without unpacking

e4: https://git.tt-rss.org/fox/tt-rss/commit/ab53591957d877908b89f6874e91c282bf59d165

I am at work right now, but will update as soon as possible and will post again if it happens again, with the impacted feed.

Thanks for digging into this.

I’m using combined display mode without expanded articles. This commit doesn’t break anything, per se, but today I noticed a significant performance drop in the UI. I follow a few Apple-centric feeds and with their latest products now shipping/being reviewed, many feeds are embedding YouTube videos. Because the UI is only showing headlines it can fit a lot of articles in the view port and it results in loading all of those videos at once. It’s having a noticeable impact on performance, even on my 3.4 GHz i5-7500 desktop.

i haven’t noticed it myself but i can see how this could happen if there’s many iframes (even invisible ones) at once. well, we can always bring back unpacking, and maybe seek some other way to deal with it missing articles sometimes.

e: https://git.tt-rss.org/fox/tt-rss/commit/e3da11bf6ddc90c11c1e6462c9287f446d20b363

We’re already working with iframes during sanitize, maybe we swap src with data-src and then use IntersectionObserver exclusively to lazy load iframes?

this is not a bad idea maybe but it’s a hack and i would prefer to not just add hacks. unpacking everything is more straightforward behavior to me.

also if observer continues to miss things we would have posts sometimes magically missing iframes.

there’s also a question of repacking when user changes view perspective, etc.

https://git.tt-rss.org/fox/tt-rss/commit/2933483393b20882b700811844a5bb538bb69d6c

i’ve added a hacky workaround for this issue.

So far seems to be working flawlessy.
Thank you very much for fixing this.