Skip to content

fix: expose actionable leaderboard score errors - #244

Draft
JoelFerrando wants to merge 2 commits into
Abedalkareem:developfrom
JoelFerrando:codex/leaderboard-score-errors
Draft

fix: expose actionable leaderboard score errors#244
JoelFerrando wants to merge 2 commits into
Abedalkareem:developfrom
JoelFerrando:codex/leaderboard-score-errors

Conversation

@JoelFerrando

@JoelFerrando JoelFerrando commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • map Android SIGN_IN_REQUIRED by ApiException.statusCode, without parsing localized messages
  • return a dedicated code when the player declines the Android friends-list resolution
  • map GameKit GKError.notAuthenticated and GKError.cancelled to stable codes
  • expose LeaderboardScoresErrorCode constants through the Dart package
  • document the recoverable cases

Why

loadLeaderboardScores currently collapses native failures into failed_to_load_leaderboard_scores. Callers cannot distinguish an expired sign-in session, a declined friends-list request, or a canceled GameKit operation from an unknown service failure.

This supersedes only the leaderboard portion accidentally included in #238. It deliberately avoids localized-message matching and does not classify GKError.cancelled as a consent error.

Verification

  • Android native unit tests cover SIGN_IN_REQUIRED, DEVELOPER_ERROR, and non-ApiException failures: :games_services:testDebugUnitTest passes
  • physical V2310 / Android 15, using an isolated registered test credential:
    • authenticated global leaderboard load completed successfully through Dart → MethodChannel → Kotlin → Play Games
    • rejecting the real Play Games friends-list consent sheet returned friends_list_access_denied with Player declined friends list access
  • an unregistered dev build returns Play Games status 10 and the plugin preserves it as failed_to_load_leaderboard_scores; this verifies that configuration/developer failures are not misclassified as authentication-required
  • dart analyze in games_services_platform_interface: clean
  • flutter analyze --no-fatal-warnings in games_services: only the existing development path dependency warning
  • Android debug APK compiles successfully through the consumer app

Still to verify before marking ready:

  • compile and exercise the GameKit changes on macOS/Xcode. We do not currently have an Apple test environment available; this is planned for next week. No iOS behavior is being claimed as verified yet.

@JoelFerrando

Copy link
Copy Markdown
Contributor Author

Android verification is now complete: an authenticated global load succeeded on a physical device, and rejecting the real Play Games friends-list consent sheet returned friends_list_access_denied as intended. I am keeping this as a draft because I do not currently have macOS/Xcode available to compile and exercise the GameKit changes; I expect to have access next week and do not want to claim the iOS side is verified before then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant