Mictronics / readsb-protobuf

Readsb is a Mode-S/ADSB/TIS decoder for RTLSDR, BladeRF, Modes-Beast and GNS5894 devices. Future development version with protocol buffer storage.
Other
86 stars 24 forks source link

Sometimes the UI shows no planes #20

Closed courtarro closed 1 year ago

courtarro commented 2 years ago

More conversation over at a Docker container that uses this tool.

The main symptom is that the UI loads but there's a script load failure due to the wrong URL being passed to the server. The more I experience it, the more I wonder if it's some kind of weird race condition in the base URL.

I stumbled on the problem again today on a browser that was working fine before. This time was an error attempting to load aircraftCollection.js. I will note that the readsb UI is running behind a reverse proxy that adds a layer to the path, so the UI is at https://hostname/planes. The script at uiBody.ts (line 44) was attempting to load "./script/readsb/backend/aircraftCollection.js" which was, for some reason, resolving to https://hostname/script/readsb/backend/aircraftCollection.js instead of https://hostname/planes/script/readsb/backend/aircraftCollection.js.

While I was experiencing the bug I loaded the page in an incognito window. It worked fine! I went back to the normal browser and it was still broken. I pressed Ctrl-Shift-R, I browsed through the code in the Chrome DevTools, I reloaded a few times, went back and forth ... eventually it magically started working again in the normal browser and I don't know why. Now it's working again. The browser asks for the correct URL for aircraftCollection.js.

Note that my original bug report on the other page was not running behind a reverse proxy.

wiedehopf commented 2 years ago

pretty sure that's a caching issue ... because the location of that js file changed.

courtarro commented 2 years ago

I've tried Ctrl-Shift-R and that didn't work. Is there another form of storage in use that isn't cleared by Ctrl-Shift-R?

wiedehopf commented 2 years ago

i think that might be a problem with the container, i don't think it's related to this project.

well this project doesn't have any cache busting but .... can't have everything.

wiedehopf commented 2 years ago

So i'm pretty sure the described issue has to do with lighttpd.

When mod_deflate is enabled, lighttpd will sometimes cause an internal 404 for aircraftCollection.js which leads to an automatic redirect to aircraftCollection.js/ .... this changes all relative paths and causes the issue. Further that redirect is a 301 which seems to persist even a Ctrl - shift -R .... you need to clear all cache for that page to remove it in chrome.

courtarro commented 2 years ago

Oooh, that sounds like a very reasonable possibility. I will relay this suggestion to the Docker container team and see if we can track it down there. Thanks!