Hello everyone,
While I was testing the game, I realized that if a client has a poor Internet connection, the result of Cloudscript sometimes doesn't reach the client. I think, it's due to the timeout value. Is there a way to handle this?
In my case, I tried to sell an item in my inventory. I pressed the sell button and waited for about 30 seconds. After that, the code executed the error callback with the error code of 1123. (The error isn't about making too many API calls too quickly. I check the Internet connection after getting the error, and the phone had a poor Internet connection). However, when I checked the inventory on PlayFab, the item was sold. So that means the request reached PlayFab, but the function result couldn't reach the client.
This causes the item still appears on the client since I couldn't get the result. My current solution is that if the client tries to sell the item again after the error, I return a result that represents "item couldn't find" message from Cloudscript and remove the item on the client side. So that the both inventories on PlayFab and the client will be synced.
I wonder if there's any other solution for this? Or in general, how can I handle a poor Internet connection?