• Mahmoud Aglan's avatar
    fix: auto-reconnect on homepage + auto-close match after 30s inactivity · c6478774
    Mahmoud Aglan authored
    Player reconnection:
    - On app boot, checks localStorage for active match
    - Verifies match is still 'in_progress' on server before rejoining
    - If match ended/aborted → clears recovery, goes to homepage
    - If server unreachable → tries to rejoin anyway (optimistic)
    
    Match auto-close:
    - handleGet() checks updated_at timestamp on every poll
    - If match hasn't been updated in 30+ seconds → both players inactive
    - Server marks match as 'completed' with result 'aborted'
    - Next player who polls sees status='completed' → game ends cleanly
    - Prevents zombie matches lingering forever
    
    Flow:
    1. Both players disconnect → no pings → updated_at goes stale
    2. After 30s, if either player comes back and polls → server closes match
    3. Match shows as 'aborted' → player sees 'game ended' UI
    4. If only one player comes back within 30s → they keep playing (match alive)
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    c6478774
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...
public Loading commit data...
screenshots 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...
PLAN.md Loading commit data...
Stockfishbotsapi.txt Loading commit data...
bell.png Loading commit data...
captain-definition Loading commit data...
index.php Loading commit data...