• Mahmoud Aglan's avatar
    fix: restore spectating, and make "watch this player" watch the right player · 2710cab1
    Mahmoud Aglan authored
    Two problems, one of them mine.
    
    Mine: locking api/game.php's `get` to the two participants broke spectating
    outright. Watching a live board is a normal part of a chess event — the profile
    "watch" button and the tournament live board both rely on it — and on
    championship day it is what most people will be doing. Non-participants now get a
    spectator projection: position, clocks, move list, players and result, but no
    `my_color` and none of the private game_state (draw offers, heartbeats).
    
    Pre-existing: handleFindActiveMatch ignored the player_id it was given and always
    looked up the *caller's* match, so clicking "watch" on someone else silently
    opened your own game. It now honours the requested player. The board itself still
    goes through `get`, which decides what a spectator may see.
    
    Both lookups are also bounded to the last 12 hours. Production carries 27 matches
    stuck in a non-final state since May and July; without that bound, "watch" would
    open a game that ended three months ago.
    
    Test-harness hardening in the same commit: pgshim silently ignored any PostgREST
    filter it did not implement, so a query with `gte.` matched every row and the test
    passed while production filtered correctly. It now implements gte/lte and throws
    on anything unrecognised, rather than quietly matching everything.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    2710cab1
Name
Last commit
Last update
..
achievements.php Loading commit data...
activity.php Loading commit data...
ads.php Loading commit data...
analysis.php Loading commit data...
auth.php Loading commit data...
avatar.php Loading commit data...
backgammon-match.php Loading commit data...
battlepass.php Loading commit data...
bots.php Loading commit data...
branding.php Loading commit data...
challenges.php Loading commit data...
chat.php Loading commit data...
config.php Loading commit data...
cron.php Loading commit data...
daily-reward.php Loading commit data...
domino-match.php Loading commit data...
domino.php Loading commit data...
friends.php Loading commit data...
game.php Loading commit data...
groups.php Loading commit data...
leaderboard.php Loading commit data...
ludo-match.php Loading commit data...
ludo.php Loading commit data...
match-cleanup.php Loading commit data...
match-history.php Loading commit data...
matchmaking.php Loading commit data...
multiplayer.php Loading commit data...
notifications.php Loading commit data...
org-apply.php Loading commit data...
orgs.php Loading commit data...
profile.php Loading commit data...
puzzles.php Loading commit data...
ratings.php Loading commit data...
shop.php Loading commit data...
swiss.php Loading commit data...
theme.php Loading commit data...
tournament-admin.php Loading commit data...
tournament-match.php Loading commit data...
tournaments.php Loading commit data...