lobby-e-sala

Documents the KrockSide chess lobby flow for listing, creating, and joining rooms via SignalR.

Updated Jan 28, 2024
One-click install
npx skills add https://github.com/Thiago-Cruz-eng/KrockSide --skill lobby-e-sala-thiago-cruz-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lobby-e-sala
Source: https://github.com/Thiago-Cruz-eng/KrockSide/tree/main/.agents/skills/lobby-e-sala
Command: npx skills add https://github.com/Thiago-Cruz-eng/KrockSide --skill lobby-e-sala-thiago-cruz-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? The ChessLobby component in the KrockSide React frontend contains known defects—silent returns, a broken getUser call, a navigation race condition, and a color selector the server ignores—that make joining a chess room unreliable. This Skill gives developers the full domain context, event contracts, and cataloged technical debt needed to fix or extend the lobby without rediscovering every trap. ## Core Features & Use Cases - Join-room flow documentation: Maps the exact seven-step handleJoinRoom sequence, including the three silent returns and the getUser route/field mismatch (DT-02/DT-03) that aborts the flow. - SignalR event contract reference: Details PlayerJoined, PlayerLeft, GameStarted, RoomFull, and RoomNotFound handling, including the empty GameStarted handler that should drive navigation (DT-08). - Prioritized fix roadmap: Orders remediation from correcting getUser, to replacing silent returns with setErrorMessage, to propagating joinResult.color to the board (DT-01). - Use Case: A developer investigating why the "Entrar na Sala" button appears to do nothing can consult this Skill to learn the click dies in a silent return after a 404 from the nonexistent get/{id} route. ## Quick Start Use the lobby-e-sala skill to explain why clicking join room in ChessLobby shows no error and how to fix the navigation race condition.

Frequently Asked Questions about lobby-e-sala

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does the join room button do nothing when clicked?

The handleJoinRoom flow contains three silent returns after session and color validation. The getUser call hits a nonexistent backend route and returns 404, so the function aborts without calling setErrorMessage, leaving the user with no feedback.

How do I navigate to the chess board after joining a SignalR room?

Navigate from the PlayerJoined or GameStarted event rather than polling GetPlayersInRoom after JoinRoom. The current count-based check is a race condition where the first player sees one player and stays stuck in the lobby.

Does the color selected in the lobby affect the chess game?

No, the server assigns color by join order in TryAssignColor and ignores the pieceColor saved in Validation. The correct approach is propagating the color returned in JoinRoomResponse to the board instead of trusting the user's selection.

What SignalR events does a chess lobby component subscribe to?

ChessLobby subscribes to PlayerJoined, PlayerLeft, GameStarted, RoomFull, and RoomNotFound. PlayerJoined and PlayerLeft replace the room's player list with color data, while RoomFull and RoomNotFound are sent only to the JoinRoom caller.

Why does rejoining a room after reconnecting fail with RoomFull?

Reconnecting creates a new SignalR ConnectionId, so the backend treats the client as a new player slot. Re-entering a room that already has two players is rejected with RoomFull even if one slot belonged to the same user before disconnecting.