Git Product home page Git Product logo

Comments (9)

Enchoseon avatar Enchoseon commented on August 28, 2024 1

Thank you for the video capture and logs. The logs ended up not revealing anything, but the video helped me replicate the issue. I believe that I've narrowed down the problem to be the infinite scroll feature.

I was finally able to replicate the issue by scrolling down past a lot of images in the list view with infinite scroll and clicking on posts until one went blank. However, this effect was usually temporary and the page would display after a few seconds.

Gelbooru Overhaul is most likely blocking the event loop and causing the entire page to stall—possibly indefinitely in your case—and most likely because of the infinite scroll feature.

I still need to figure out how to consistently get it to happen before I can try out any solutions, but it's a start.

from gelbooru-overhaul-userscript.

Enchoseon avatar Enchoseon commented on August 28, 2024

I have not come across this issue on Firefox 102 on Tampermonkey v4.18.1 with no other extensions enabled (besides uBlock origin) in a private window.

I assume the base script you're talking about is the pre-refactor main branch available from Petrk39's fork, which narrows down the search to 99 commits that changed every part of the code 😰—so any more help narrowing down the search would be greatly appreciated.

  • Does the issue only happen on the individual post view and gallery view? (i.e. it doesn't happen on the homepage)
  • Does anything show up in browser's console logs under any category? (Error, Warning, Logs, Info, etc.)

p.s. Also, just to clarify, the infinite scroll was not my improvement, that was also implemented by the great PetrK39.

p.p.s. The script is currently in somewhat active development, where no breaking changes are planned and the only things in the works are minor changes and fixes. The current plan is not to move fast and break things.

from gelbooru-overhaul-userscript.

Pazu5512 avatar Pazu5512 commented on August 28, 2024

I made a quick video capture of the issue, running alongside the console. I used Chrome in this case to make sure I avoid any kind of conflict (Chrome v113, alongside Tampermonkey v4.18.1), though, as I said, the same behavior happens on Firefox. I didn't use a private window in this capture, but the same behavior happens if I do so. In any case, uBlock Origin is also active, but it being deactivated doesn't fix the issue.

  • Video capture : https://files.catbox.moe/85c3i0.mp4
  • Log file of the console : https://files.catbox.moe/tte0it.log
    (do note that there are errors being shown from Gelbooru itself, as even without the script installed, some will show up)
    (unfortunately it's just plain text, I don't know much about the console, maybe it can be imported on your end to get back the nice colors and formatting)

The issue more often than not happens when viewing individual images (as shown in the capture), this is when it starts breaking. From there, sometimes it's the search results view (for instance https://gelbooru.com/index.php?page=post&s=list&tags=scenery) that shows up a blank page , but this is not always the case, and a refresh or multiple refresh will usually make it come back (though in severe cases, it never shows up again, and I have to remove the script). And then the cycle starts again, when viewing an individual image, it goes blank page again.

Not shown in this particular capture, but blank page when viewing individual images also happen if, say, I stay on the search result list (thus without ever using the browser's "Previous button" ◀️ ) and instead open up the images individually in new tabs. Some will show up fine in their tab, some will be blank in their tab.

In any case, I can always go back to the homepage https://gelbooru.com/, it always show up as it should.

Not sure if that helps. Anyway, I believe there's something wrong on my end as neither you nor Donny-Pandairaz in #3 observe this behavior 😥

from gelbooru-overhaul-userscript.

PetrK39 avatar PetrK39 commented on August 28, 2024

I can't tell why the page becomes blank on infinite scroll, but you can see the 429 HTTP error that occurs when requests occur too often.
Previously this caused the page to hang with CSS body {display:none}, but this could only happen when the page loads.
Unlike the rate limit, which resolves itself after 15 seconds, using the site on pages other than gallery and post was completely impossible.
This behavior was greatly improved in version 1.0.0 (which currently lives in a separate branch and still has some bugs)
@Pazu5512 could you try to replicate it with 1.0.0?

from gelbooru-overhaul-userscript.

Pazu5512 avatar Pazu5512 commented on August 28, 2024

@Pazu5512 could you try to replicate it with 1.0.0?

I tried with 1.0.0, and indeed the behavior has been improved, thank you both for your work 😺

From my testing, so far, I don't end up with the blank pages anymore. No matter what I do, be it on the thumbnails page result, or when viewing an image individually, the page displays as it should, and I can always see the Gelbooru UI.

Though the current fix introduce an issue (or maybe it was always there) : when scrolling the thumbnails results page, everything is perfect for around ~8-10 "Gelbooru pages numbers" worth of infinite scrolls, quick and snappy as it should be, but at some point, the thumbnails stop charging for a good while.

Capture d’écran 2023-06-09 174904

Each new thumbnail gets stuck on the loading animation for ~30 sec up to 1 minute, it's variable. And then, they basically all load at once.

When it's stuck on the loading phase (see the attached pic), for any additional infinite scroll I do, I end up with the new thumbnails being stuck on the loading indicator. So let's say I add another set of "infinite scroll" number of thumbnails while some are still loading, then the loading time varies greatly : some "newer" thumbnails will load up, say, after 35sec, while older thumbnails that were already charging for 40sec will still load for another 30sec. The behavior is not consistent, or rather, not working in a logical/linear way. You'd think older charging thumbnails would load up first before additional ones, but it's not always the case.

While it's happening, I can still open up any image to see them individually, they display perfectly fine, no blank page whatsoever. No issues on that end. Though interestingly enough, the "More Like This" thumbnails on the bottom also are stuck in the loading phase, much like the thumbnails on the results page, even on different Tabs.

I tried playing with the Infinite Scroll Threshold setting, be it by increasing or diminishing the delay in milliseconds, but it didn't fix anything. I also tried disabling the loading indicator in the settings, but it didn't fix anything either.

Again, keep in mind that the thumbnails do load up after 30sec~1min, usually 40-45 sec (as long as I don't add new thumbnails with the infinite scrolling, and wait for their loading before proceeding to scroll again). So it's not the end of the world, but it hampers the browsing a bit.

I thought about Gelbooru throwing a fit about load charge (too much data, or too many requests at once), but then I don't end up with such an issue if I deactivate Gelbooru-overhaul and try to use another Infinite Scroll script. Besides, Gelbooru doesn't prevent me from displaying the full images even when stuck in the loading phase, so I'd say it's not on their end (they don't throw an error/warning message saying I'm using too much of their bandwidth, I don't know if it exists in the first place).

Hope that helps, I can make a video if necessary, it's a whole lot of text that could be summed up in a 1min video capture.

from gelbooru-overhaul-userscript.

PetrK39 avatar PetrK39 commented on August 28, 2024

This is expected behavior.
It's not about infinite scrolling. Gelbooru actually limits the frequency of requests. But it is worth noting that there is more than one request: each image on the screen creates a task to load tags, links, metadata.
With each page of infinite scrolling, 42 requests are added to the queue. I haven't found a specific limit, but a delay of 15 seconds seems optimal. (Not per page, but when we hit rate limit error)
Of course, I could just show the images while the request is going on, but one of the key features of the script is a "reliable" blacklist.
In the end, this behavior is expected with "unrealistically" fast scrolling endless pages. And since there is no way to request all the necessary data at once we are forced to play by the server's rules and wait for insurmountable limitations.
Thanks for testing and explaining.

from gelbooru-overhaul-userscript.

PetrK39 avatar PetrK39 commented on August 28, 2024

You may also notice that once an image has been loaded once, it is displayed instantly at a later time.
This is because the script caches the data to create fewer requests.
By default the cache size is set to 420 entities (about 10 pages) but if you often have to deal with long loading of images you've already seen you can increase this value in the config window.

from gelbooru-overhaul-userscript.

PetrK39 avatar PetrK39 commented on August 28, 2024

Note to self: probably should add a pop-up notification with a countdown

from gelbooru-overhaul-userscript.

Pazu5512 avatar Pazu5512 commented on August 28, 2024

Thanks for the explanation 👍
I think this Blank pages issue can be closed, I'll leave it to your appreciation

from gelbooru-overhaul-userscript.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.