• Mahmoud Aglan's avatar
    feat(social, multiplayer): working chat and groups, reliable challenges, true... · d951ad46
    Mahmoud Aglan authored
    feat(social, multiplayer): working chat and groups, reliable challenges, true VS, resume sync, emotes from the sender
    
    Social: chat sides came from a stored user id that Google sign-in never set,
    so every message looked like the other player's; the server now marks each
    message mine and the client reads its id from the token (core/me.js). Chat
    rebuilt (my bubbles inline-end, grouping, times, seen, typing, reactions,
    quick replies), live delivery fixed, groups fully working (join by code or
    link, admins, unread, owner hand-over), presence, dock/bell/friend badges,
    friend notifications, news feed, invite links, profile actions.
    tests/play/social.mjs 106/106.
    
    Challenges: the invite was only seen on the Friends screen; a global prompt
    (play/invite-watch.js) now shows it everywhere with a countdown. Chess
    declines failed on the result enum; the handshake lives in match_invites
    with conditional updates, expiry and challenger presence. VS: self vs self
    came from the stored id and profile.php answering with the caller when the
    id was missing; every player's card now travels with the hand-off.
    Backgammon simultaneous searches and ludo table sizes fixed.
    tests/play/challenge.mjs 72/72 (4 games x 6 scenarios x 3 rounds).
    
    Resume: leaving the screen dropped the saved match; your own sleep was
    blamed on the opponent; heartbeats raced moves inside game_state (now
    match_presence); moves on a bad line were dropped (outbox) and late retries
    rolled boards back (stale steps refused); frozen loops restart on return.
    Emotes appear at the sender's plate on both screens, per seat in ludo.
    Resume and emote scenarios pass in all four suites.
    
    Migrations applied: social, match-invites, match-presence.
    Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
    d951ad46
board.js 35.9 KB