07th-mod / python-patcher

Mod Installer for the Higurashi and Umineko Games
151 stars 12 forks source link

If POST takes longer than 8 seconds, installer immediately gives up rather than continuing to wait #146

Open drojf opened 3 years ago

drojf commented 3 years ago

We had an issue where a user had an infinite loading screen on the part of the installer which autodetects game paths.

There were no relevant errors on the install log, but the browser showed a POST error, as if the python side never responded.

What actually happened was that the python side had no errors, but it took longer than 8 seconds to respond. Because the HTML side gives up after 8 seconds, the HTML side raised an error, but the Python side did not. This was because I implemented the timeout using the native XMLHttpRequest timeout functionality, which cancels the POST after a timeout (...or at least I think that's how it works).

The installer should really show an error after 8 seconds (or however many seconds), but continue to listen for the response.

The error message should also be adjusted to tell the user to wait some time in case the operation just takes a long time.

I actually had hard-coded that if the request type was showFileChooser, there was no POST timeout, but I feel hard-coding specific requests to not the right way to do this.

A related issue is why the game scanning step took so long - the user was using a SSD, and didn't have that many games installed on their computer. It could be:

The scanning should really give up if it took more than a certain amount of time to scan, as even if scanning fails, the installer can still be used. Or perhaps have a per-directory scan timeout.

The installer also doesn't print how long/which folders were scanned,