netbymatt / ws4kp

WeatherStar 4000+
https://weatherstar.netbymatt.com
MIT License
263 stars 44 forks source link

Loop stops after data refresh with hazards enabled #24

Closed rmitchellscott closed 1 year ago

rmitchellscott commented 1 year ago

Web Browser: Chrome, Firefox Client OS: Mac OS Server OS: Alpine Linux with Node 18 in Docker

After an automatic refresh, the loop hangs on the Progress screen. The play pause button indicates it should still be playing however, the screen never advances.

The issue is not present when I swap to a Node 16 Alpine image.

netbymatt commented 1 year ago

It's interesting that the change between node 16 and 18 changed this behavior. How consistent was the problem on 18? And does the progress screen show all green and/or disabled pages when it's hanging? And finally is the Hazards page enabled?

I'm asking because I've noticed exactly the situation that you describe when opening the web page with a previously stored location. There's a very nuanced timing issue that I have been so far unable to track down but it seems to have been introduced at the same time I added the hazards section and has to do with if the hazards data or current conditions data loads first.

rmitchellscott commented 1 year ago

It was very consistent for me on 18, and hasn't happened at all on 16 so far. While it's hanging on the progress page, the progress bar progresses, goes away, and the green/disabled links show up correctly. I did have the hazards page enabled, let me do some tests with that disabled and see if I can repeat the behavior!

rmitchellscott commented 1 year ago

Well, I said it was consistent... after seeing it all weekend, I can't replicate the issue on Node 18 today. If I see it again, I'll try disabling Hazards and report back!

rmitchellscott commented 1 year ago

The issue occurred today, on Node 16. Sorry about that, seems like Node version is not a factor here. I ran two browsers concurrently, one with Hazards enabled, one without, and the one with Hazards enabled hung. The one with it disabled is fine. Here's a screenshot of the hung one. image

netbymatt commented 1 year ago

This is excellent information. Did it hang on the very first auto-reload or did it take several tries?

Troubleshooting it in the reload situation might be a lot easier than what appears to be the same bug during page load that I describe above. I'm going to look at this in the very near future but any additional information we can gather up before than will be very helpful.

rmitchellscott commented 1 year ago

It took a few auto-reloads. I adjusted the refresh interval down to 30 seconds, and disabled all but two screens so I could go through the auto-refresh cycles quickly. Over last weekend, it would happen every refresh pretty consistently over the better part of a day, so maybe depending on hazard API response speed or something like that?

If there's any more data or logs I can enable to provide you, let me know! I've got my own instance running 24x7 and keep an eye on it at least most of the working day, so hopefully I'll spot when issues happen.

netbymatt commented 1 year ago

I put some deliberate delays in loading data for Hazards and Current Conditions. If Hazards loads really slowly and Current Conditions Arrives first then this line can't figure out what display to show first. https://github.com/netbymatt/ws4kp/blob/249cbb93e6f4a9b452af33c7b79674d5c00eb9b7/server/scripts/modules/navigation.mjs#L116 I'm working on an additional condition that won't also break the opposite: Hazards arrive before Current Conditions situation.