pokerogue icon indicating copy to clipboard operation
pokerogue copied to clipboard

Retry api post request on timeout

Open MonsieurDMA opened this issue 10 months ago • 2 comments

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.

MonsieurDMA avatar May 01 '24 17:05 MonsieurDMA

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

PaulBeslin avatar May 03 '24 17:05 PaulBeslin

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.

MonsieurDMA avatar May 05 '24 15:05 MonsieurDMA

Closing this due to inactivity. Feel free to make a new request if interest is reignited

bennybroseph avatar May 19 '24 13:05 bennybroseph