migratetoflarum / lab.migratetoflarum.com

The health scanner for Flarum
https://lab.migratetoflarum.com/
MIT License
10 stars 2 forks source link

Built with Flarum website covers show loading screen instead of forum index #19

Open Ralkage opened 3 years ago

Ralkage commented 3 years ago

There seems to be a bunch of scanned sites listed on BWF that have a screenshot of the IndexPage loading.

image

Is this because some forums could possibly have had performance issues already around the time the forum was scanned and when screenshot was taken?

I see that Browsershot has a method for delaying screenshots until the page is fully loaded (or wait for the JS to fully load) and can be added here.

There's also forums in the showcase that don't have screenshots at all, not sure what's up with that.

clarkwinkelmann commented 3 years ago

Hi Christian,

Yes I am aware of that issue, though I don't have a clear plan on how to address it. This is the settings I'm currently using with Browsershot:

https://github.com/migratetoflarum/lab.migratetoflarum.com/blob/dcae4bb72e2e91d283b90c4720b4bae186aba82b/app/Jobs/ShowcaseScreenshot.php#L32-L36

I remember trying the delay methods, but I don't remember what issues I had with it. I wonder if there wasn't an issue with the need to recompile Chrome to be able to run javascript from Browsershot, and that might have been a deal breaker.

I believe the "wait on network traffic" option wasn't reliable, because since Flarum pre-loads the data, there would be a moment where no network activity happens, but Flarum still hasn't booted the javascript side, which caused the spinner to be rendered as well. And I can't predict exactly how much time Flarum will take to boot, and I didn't want to wait multiple seconds for that.

The real solution would be to have a javascript condition that looks for Flarum's boot state, or for a specific DIV on the page. But as I said above, I remember having an issue with that. I'll need to try again to see whether it's still a problem.

The websites without screenshots are an event bigger mystery I haven't properly investigated yet. I think it might be when the Browsershot job times out. And because I don't preserve the older screenshot, a failing job always results in a missing image.

I have to say, I'm really ashamed at how the Built with Flarum page is generated. It's a complete mess and there are now so many websites in there that I can't afford to manually fix the issues anymore. I have many ideas for a replacement website where the list would be somewhat curated (only generate screenshots and statistics for whitelisted websites, raise minimum conditions to appear on the list at all) but I haven't found much time to dedicate to this project in the last year.

The Sentry dashboard is also filling with many errors I need to tackle at some point. Most are caused by the Built with Flarum monitoring scripts that update a website data. Since so many websites are just test websites, they quickly stop working and I've got all kind of timeout and DNS resolve issues that aren't properly handled :grimacing: