Repository navigation
refactor(game-center): narrow LeaderboardLoader to local-player centring (#150) - #285
Merged
Merged
Conversation
…ing (#150) PR #146's loadSlice(around: PlayerID?) silently substituted GKLocalPlayer.local for any passed id — a dishonest contract (CR S3). True non-local centring isn't reachable via public GameKit API (teamPlayerID->GKPlayer has no mapping). Make the signature honest (aroundLocalPlayer: Bool); update Live/GK/Fake impls + doc, drop the narrowing note. Real non-local centring deferred to a friends feature. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #150 (PR #146 CR S3 follow-up).
loadSlice(around: PlayerID?)was dishonest — the liveGKLeaderboardLoaderonly branched on!= niland always centred onGKLocalPlayer.local(the id payload was dead). Replaced witharoundLocalPlayer: Bool(Leader-approved Option 2), narrowing the FULL chain so the VM-facing surface stops lying:GameCenterClient.fetchLeaderboardSlice→LeaderboardSliceService.fetch→LeaderboardLoader.loadSlice, both fakes, theFakeGameCenterOperationenum case, both test files, and the one outside consumerCompletionViewModel(around: nil→aroundLocalPlayer: false). Arbitrary non-local centring deferred to a future friends-leaderboard feature (friends scope hands backGKPlayerdirectly, sidestepping the teamPlayerID↔gamePlayerID mapping).Code Review: APPROVE-WITH-NITS. Verified:
truepath = the unchanged PR #146 local-player centring;false= top-of-board;CompletionViewModel'sfalsepreserves its pre-changenil→top behavior (no silent regression); full chain consistent (zero leftoveraround:/String?); friends-auth gate untouched; 53 tests pass. Sole nit is a doc-only mismatch in the impl-notes (mentions a= falsedefault that isn't in the code) — non-functional.🤖 Generated with Claude Code