pokerogue
pokerogue copied to clipboard
Retry api post request on timeout
This PR add a timeout on the apiPost request after 8000ms. This timeout trigger an error and the caller as the choice to retry the request.
It was only added to saveGame and saveSession as it seems to be the ones that trigger the more often. I also think these one are the least at risk for save corruption.
For the context, I have a lot of short disconnection while traveling in train and I think this could be a handy solution. The current state of the game is to block indefinitely and need a full restart.
I'm not an expert in typescript, feel free to challenge and edit this feature.
Also, I don't know how to test this feature in local. If you have any ideas or advices on that, please comment and I will try.
Hi, Chrome has a dev tool for network throttling that you could use to test your changes: https://developer.chrome.com/docs/devtools/network/reference#throttling
Hi, Chrome has a dev tool for network throttling that you could use to test your changes: https://developer.chrome.com/docs/devtools/network/reference#throttling
Correct, I will try to connect my local instance to the server or make the server run locally.
Closing this due to inactivity. Feel free to make a new request if interest is reignited