Make wafer and thin-auth check if SkotOS is fully booted #62
Labels
enhancement
New feature or request
good first issue
Good for newcomers
javascript
This bug is mostly or completely fixable in Javascript
Prior to cold-boot SkotOS, the game's DGD server was nearly always fully booted. It just wasn't much of an issue. In this new world, we cold-boot much more often and so we care more often. That's why deploy_scripts/shared/wait_for_full_boot.sh exists - so we can wait for SkotOS to finish loading all that MERRY code, open its ports, etc.
It would be really useful if wafer and thin-auth could indicate whether SkotOS appears to have booted fully. Because if you click through before that, errors are expected. When spinning up a new local install, we just don't boot wafer until DGD has finished booting -- but a bookmark will still get you to the not-yet-ready server. Some kind of visual indicator (warning text?) would be nice, and possibly a "reload" button to check right now instead of waiting for the next 30 second timer.
There's a URL for that, the same one used by wait_for_full_boot.sh. On the SkotOS raw HTTP port (localhost:10080 or the client URL's port 10080), the url "/FullyBooted" will only return 200 if it's fully booted. A 404 normally means "still booting" and a 5XX (error) response normally means "something went wrong and it's not going to boot up." It's possible to get an error where it will just 404 forever, but that's not normally what happens.
For wafer, the right answer is probably to colour or disable the "Play" and "Tree of WOE" buttons and add a setInterval to keep pinging the server (maybe every 30 seconds or so?) and enable them when the server is fully booted. After the server is up we can get rid of the setInterval and not keep doing it.
It would also be possible to check every you hit "Play" and give you a dialogue if it's not fully booted - not sure if that's a good idea. The up-side is that if you keep a stale Wafer browser tab open it will still tell you if your current boot isn't finished. The down-side is that sometimes you get a browser alert when you may not want one.
The text was updated successfully, but these errors were encountered: