playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Action scheduled for later (connection currently in progress) [13401757]

opened this issue · comments

Hi guys,

first of all Thank you for your plugins. Really appreciated!

Almost each time the game start and the user login manually, when there's a request for leaderboard or postScore, nothing happens. Every calls is put in a queue and wait until...ever. The only way I found is to put the game in background manually and come back and every actions in the queue happens. What can we do? We are testing it on Nexus 7 and Nexus S.

Thank you
David

Ok, the issue isn't really here. When the user cancel the login the first time, automatically the play game service is asking again to login. If the user login the second time, all action request are put in a queue.

This is a very serious issue, I'm experiencing it too. I've been able to reproduce it in a similar way to the one described here:

When the user logs out ingame, e.g. via the leaderboard settings, and tries to log in again, often the authentification process completes but our cloud load call is put into the queue. We're waiting for the cloud callback when the user logs in and this puts us in an infinite loop. Closing and reopening the game is not a solution for live apps.

[Removed adb log because of new repro steps below]

Got the same issue here :( Any quick temporary fix?

Just to confirm the steps to repro this:

  1. Log in
  2. Open up a leaderboards screen and sign out from that screen
  3. Close the leaderboards screen
  4. Log in again

Is that correct?

Also, is this happening on 0.8.00 or 0.8.01?

It is reproducible with the Cubic Pilot sample running version 0.8.01.

  1. Sign in
  2. Sign out
  3. Repeat step 1-2 until the cloud load fails (scheduled for later).

Sorry for the triple post. (will delete the 2 older ones) Just discovered an error in my implementation. So now I am exactly able to reproduce the error in everybodys way and actually really only in that way. I am sorry for the wrong informations i provided earlier.

I'm having the same issue here.

The problem occurs after a manual sign-out. When loading the game with an account signed in from a previous session, everything works correctly.

If you:

  • Sign out
  • Then Sign in again

all actions are scheduled for later:
[Play Games Plugin DLL] Action scheduled for later (connection currently in progress).

If, however, I Sign out / Sign in again, the error goes away. Until I Sign out again.
Sending the app to the background (or killing and re-launching it) also fixes the issue.

It is only happening with 0.8.01 version. I downgrade to 0.8.00 and everythings is working fine.

I believe our next bugfix update (coming soon) will fix this. At least I can't repro the bug any more. But just to be sure, could someone enable debug logs, produce logs for this problem and attach them here?

To enable debug logs, do this before calling Authenticate:

PlayGamesPlatform.Instance.DebugLogEnabled = true;

Awesome. Could you push the bug-fix update in a different branch so I can test it? Thanks :)

Here the data I just logged. As you will notice, I wasn't able to reproduce the bug directly, the second try did it. I replaced my ID with [ID] and my name with [NAME]. I also deleted the Achievements. Here the link to the log-file. I hope it will help. =) If you have questions, I would like to hear/read from you.

http://pastebin.com/yyUFU7Qr

Regards
Kalle

EDIT: I want to add, that I sometimes, after a reinstall get this problem on first login. So I login and I am initially not able to do an action. I will try to log that also.

EDIT2: not able to reproduce this at the moment. The bug has a very low probability at first login.

Let's try something. Could you please try downloading this JAR:
https://docs.google.com/file/d/0B1IdIjhHcunCMEtkU3ZXR1prYW8/edit

And overwrite your play-games-plugin-support.jar here:
PluginDev/Assets/Plugins/Android/MainLibProj/libs/play-games-plugin-support.jar

Then rebuild and redeploy your APK.
Does the problem persist after this?

Sadly I am still able to reproduce the bug in the same way on first try. Here is the log: http://pastebin.com/jkReDMiL

(Made two (what a stupid mistake) runs, both same result)

Thanks for trying this. Could you please enable the debug logs so I can see what's going on in greater detail? Just add this right before the call to Authenticate:

PlayGamesPlatform.Instance.DebugLogEnabled = true;

If I try to add this. I get this error: "Assets/Scripts/MenuControllScript.cs(294,52): error CS0176: Static member `GooglePlayGames.PlayGamesPlatform.DebugLogEnabled' cannot be accessed with an instance reference, qualify it with a type name instead"

Should this line do something different then: "PlayGamesPlatform.DebugLogEnabled = true;"?

My code fragment:

PlayGamesPlatform.Activate ();
PlayGamesPlatform.Instance.DebugLogEnabled = true;
Social.localUser.Authenticate ((bool success) => { ...

There's typo there, you're missing 'Instance':

GooglePlayGames.PlayGamesPlatform.Instance.DebugLogEnabled = true;

If i try this:

PlayGamesPlatform.Activate ();
GooglePlayGames.PlayGamesPlatform.Instance.DebugLogEnabled = true;
Social.localUser.Authenticate ((bool success) => {...

I still get this error:

"Assets/Scripts/MenuControllScript.cs(294,68): error CS0176: Static member `GooglePlayGames.PlayGamesPlatform.DebugLogEnabled' cannot be accessed with an instance reference, qualify it with a type name instead"

Are you sure that I need the "Instance"?

Hmmm try this instead:

GooglePlayGames.PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate ();
Social.localUser.Authenticate ((bool success) => {...

I think that is what I did for the last log. But I'll try it. Oh I think I should filter for another Tag in logcat i that possible?

If possible, show me the whole logcat. Things come in with a lot of different tags.

If you can, clear your logcat before running the test (with "adb logcat -c") so that the log will only contain the test's output.

Actually I am not able to reproduce it. I will change back from the .jar you uploaded to the old one. I don't get it why I am sometimes be able to reproduce it, sometimes I get the error without logging out and now I am not able to reproduce it.

I'll try it with the old files now. Moment pls.

Is there a way to submit this log to you in private? Would like to not show all IDs etc. to the complete internet. ;)

http://dpaste.com/1740679/

This is using the test jar you posted.
I still have the same issue.

Now that I know what you need...:

http://pastebin.com/XdxLjLrU

Ok, from the logs and some investigation (and especially with the help of friikyeu@), it looks like this is what's happening:

  1. When the sign-in helper activity (SignInHelperActivity.java in the plugin support library) reports sign in success, the main Activity (the game) starts its sign in flow; this happens in GameHelperManager.cs, OnSignInSucceeded.
  2. The sign-in helper Activity quits and the game gets OnApplicationPaused false, causing GameHelperManager to start the sign in flow and set the "connecting" flag

Depending on the order these two things happen, the game activity gets into a state where it thinks it's undergoing a connection flow when in fact it isn't. Particularly, when (1) happens before (2), the result is that (2) will set the state to "connecting" even though (1) has already done that, so the race condition causes the state to remain as "connecting" forever, which means actions will be put on the queue.

I'm rolling out a fix to this bug in the next few days.

Good to hear, thank you for looking into it. Can't wait for the fix :)

I believe this is fixed in 0.9.00. Please reopen this issue if this is not the case.