• Mahmoud Aglan's avatar
    fix: friendship system + friend invite/challenge lobby · 1ae4c0ac
    Mahmoud Aglan authored
    Friendship bugs fixed:
    - Accept now uses service key (bypasses RLS that blocked updates)
    - Duplicate request prevention (checks both directions)
    - Reject uses proper POST action instead of broken DELETE call
    - Cleaned up stale duplicate rows in DB
    
    New features:
    - Friend invite system: challenge dialog with game/time selection
    - Match created as 'friendly' with status 'waiting'
    - Opponent sees invite banner (polls every 5s), can accept/decline
    - Accept starts the match, both players enter the game
    - 2-minute invite expiry
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    1ae4c0ac
friends.php 11.9 KB