If loadAllGameData is executed while the user’s data is conflicted, crash will occur before the “onLoadGameData” event of the crashed key is received.
logcat
java.lang.IllegalStateException: getData called when there is a conflict.
at com.google.android.gms.games.SnapshotsClient$DataOrConflict.getData(Unknown Source:7)
at com.sdkbox.plugin.SdkboxGPGSavedGames$9$1.onSuccess(SdkboxGPGSavedGames.java:541)
at com.sdkbox.plugin.SdkboxGPGSavedGames$9$1.onSuccess(SdkboxGPGSavedGames.java:529)
at com.sdkbox.plugin.SdkboxGPGSavedGames$6.onComplete(SdkboxGPGSavedGames.java:322)
at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
To reproduce the problem on one device.
device => saveGameDataBinary * 10 times
device => {“error”:"",“name”:“onSaveGameData”,“success”:true}
device => {“error”:"",“name”:“onSaveGameData”,“success”:true}
device => …
device => loadAllGameData
device => crash
Create a conflict by requesting saveGameDataBinary 10 times before the response is complete.
Requesting loadAllGameData after a lot of conflict will cause a crash while resolving conflicts with that key value.
To reproduce the issue on two devices
device 1 => saveGameDataBinary
device 2 => ariplane mode (network off)
device 2 => saveGameDataBinary
device 1 => saveGameDataBinary
device 2 => saveGameDataBinary
device 1 => saveGameDataBinary
device 2 => saveGameDataBinary
…
device 2 => network on … wait …
device 1 or 2 => loadAllGameData
It seems to occur when reading the game data with a certain number of conflicts. The crash occurs a few more times while the conflict is resolved and a normal response is given when the conflict is resolved.
Can it be changed by error response without crashing?