Exclude private players from rankings#130
Merged
Merged
Conversation
Result image, recap, profile and ladder rankings counted private puzzlers in the totals and positions. Filter them out across the ranking SQL, with one exception: the subject of the ranking is always included so a private player still sees their own rank on their own pages. - GetRanking: JOIN player and require (is_private = false OR id = subject) in both allForPlayer and ofPuzzleForPlayer - GetFastestPairs / GetFastestGroups: HAVING bool_or(p.is_private = false) so the global ladder hides teams whose puzzlers are all private - GetPlayerRatingRanking: same subject exception in playerPosition and allForPlayer; the global ranking()/totalCount()/distinctCountries are unchanged Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
The result image (cached PNG, shared on social media), the post-submit recap page, the player profile, the compare-players page, and the global pairs/groups ladders all counted private puzzlers in their rank totals and positions. This PR makes the ranking SQL ignore private players, with one exception: the subject of the ranking is always included so a private user still sees their own rank on their own pages.
`PuzzleTimes` already filters per-viewer via `PuzzlesSorter::filterOutPrivateProfiles($grouped, $loggedPlayerId)` (with the logged-user exception), so its query stays untouched.
Test plan
New / extended PHPUnit tests cover:
Manual smoke (post-merge):
🤖 Generated with Claude Code