play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

Saved Games API returns successful status codes after exceeding quota limits

Open KyryloKuzyk opened this issue 2 years ago • 0 comments

Describe the bug When a rate limit for a Saved Games snapshot is reached, the call to PlayGamesPlatform.Instance.SavedGame.CommitUpdate() will still produce SavedGameRequestStatus.Success status. This leads to a snapshot silently reverting or disappearing after the app is reinstalled.

To Reproduce Steps to reproduce the behavior:

  1. Reach a rate limit for a Saved Game snapshot. I didn't do anything exceptional to reach the limit, just debugged my saved games code normally without any stress loads.
  2. Commit an update to a snapshot by calling the PlayGamesPlatform.Instance.SavedGame.CommitUpdate().
  3. Reinstall the app.
  4. Discover the recently committed update is missing after calling the PlayGamesPlatform.Instance.SavedGame.OpenWithManualConflictResolution(fileName, DataSource.ReadNetworkOnly,...). The file will be reversed to the state before the rate limit was reached (or will be missing if the snapshot was manually deleted after the limit was reached).

Expected behavior PlayGamesPlatform.Instance.SavedGame.CommitUpdate() should at least return an error code to signal that the snapshot upload failed after reaching the rate limit.

Observed behavior PlayGamesPlatform.Instance.SavedGame.CommitUpdate() returns SavedGameRequestStatus.Success after reaching the rate limit.

Versions

  • Unity version: 2021.3.4.f1
  • Google Play Games Plugin for Unity version: v11.01

Additional context To observe the rate limit is reached, launch the adb tool with these filters: adb logcat -s Unity Volley SnapshotUploaderImpl And observe these errors after successful CommitUpdate():

E Volley  : [348] BasicNetwork.performRequest: Unexpected response code 403 for https://www.googleapis.com/games/v1/snapshotsExtended/gameSave:prepareRevision
W SnapshotUploaderImpl: {"code":403,"errors":[{"reason":"UrlLeaseLimitExceeded","domain":"usageLimits","message":"Too many pending uploads for this snapshot. Please finish or cancel some before creating more."}]}

My current workaround Using a different save file name fixes the issue because the rate limit is tied to a particular snapshot name. I tested my cloud save code with a different file name, then reverted it back before releasing the app to production.

KyryloKuzyk avatar Jun 20 '22 10:06 KyryloKuzyk