• 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
.claude Loading commit data...
ChessPieces Loading commit data...
Connections and docs Loading commit data...
Logo El3ab Loading commit data...
admin Loading commit data...
api Loading commit data...
app icons Loading commit data...
config Loading commit data...
docs Loading commit data...
includes Loading commit data...
ludo-playtest Loading commit data...
promo Loading commit data...
public Loading commit data...
screenshots Loading commit data...
test-screenshots Loading commit data...
tests Loading commit data...
.gitignore Loading commit data...
.htaccess Loading commit data...
ARCHITECTURE.md Loading commit data...
ASSET_REGISTRY.json Loading commit data...
ASSET_REGISTRY.md Loading commit data...
BUILD_ORDER.md Loading commit data...
DATABASE_REFERENCE.md Loading commit data...
DESIGN.md Loading commit data...
Dockerfile Loading commit data...
FIX_PLAN.md Loading commit data...
HANDOVER.md Loading commit data...
MULTIPLAYER_RULES.md Loading commit data...
PLAN.md Loading commit data...
ROADMAP.md Loading commit data...
Stockfishbotsapi.txt Loading commit data...
WTF.md Loading commit data...
backgammon-test.mjs Loading commit data...
bell.png Loading commit data...
captain-definition Loading commit data...
chess-browser-test.mjs Loading commit data...
chess-multiplayer-test.mjs Loading commit data...
chess-sync-test.mjs Loading commit data...
domino-test.mjs Loading commit data...
index.php Loading commit data...
logof.png Loading commit data...
manifest.json Loading commit data...
package-lock.json Loading commit data...
package.json Loading commit data...
privacy-policy.php Loading commit data...
qr-code.png Loading commit data...
terms.php Loading commit data...
test-tournament-swiss.mjs Loading commit data...
test-tournament-ui.mjs Loading commit data...