Bug with Playfab? (FIXED)



I’m trying to allow players to reconnect if they go offline but later reconnect. However, that doesn’t seem to be working. I’ve posted this issue on the Github repo as well. I couldn’t find anything obvious in the library, e.g. a check for internet connection or state saving when offline, so posting this here as well.

Steps to reproduce

  1. Start an app without an internet connection, e.g. with Wi-fi turned off.
  2. Attempt to send a request when offline, e.g. PlayFabClientApi.LoginWithCustomID. The request should fail as expected.
  3. Turn wifi on.
  4. Attemp to send a request without restarting the app.

Actual outcome

Request fails with the following error message:

Defold version

Version: 1.2.159
Editor SHA1: c3e32c38ee70eec1524e1d2d0ad596629285cfb3


Tested on macOS Mojave and Android 11


ERROR:SCRIPT: Unable to create HTTP connection to 'https://TitleId.playfabapi.com/Client/LoginWithCustomID?sdk=DefoldSdk_0.59.190625'. No route to host?
{ --[[0x10bcefed0]]
  error = "ServiceUnavailable",
  errorCode = 1123,
  code = 0,
  status = 0,
  errorMessage = "Could not deserialize reseponse from server: "

Expected outcome

Request should work

Let me know if it’s library issue and/or if there’s any additional info I could provide to help with debugging.



It was a while since I looked at the playfab code but it should be pretty straightforward. I would try with the debugger and follow the reconnect flow step by step.

Are your able to do a normal http.request() completely ignoring the playfab code?



I’ve tried it with a simple http.request() and I’m running into the same issue (which means that Playfab has nothing to do with this).

The following is the error that I get when trying to make a request after going through the mentioned steps (no wifi, start, re-enable wifi, click “Retry” from within the game):

ERROR:SCRIPT: Unable to create HTTP connection to 'http://www.google.com'. No route to host?

The same error happens whether the game is run from within defold or packaged up and run in macos or android.



And this happens even if you wait for a while as well?



I’ve waited for ~1 min and this was still an issue. Do you have a specific timeframe in mind that I should to wait for?



Nope, I will experiment some myself and get back to you.



We can confirm that it is a bug in Defold. We’re looking into it. It seems to have been introduced when we released the async dns lookup fix in May. I’m a bit surprised that we haven’t caught this sooner (I blame summer!).



@DeividasK this has been fixed in 1.2.161