The Outcome type in src/types/index.ts defines 'timeout' as a valid game-ending reason:
export type Outcome = {
winner?: Color;
reason: 'checkmate' | 'resignation' | 'timeout' | 'draw' | ...;
}
However, searching the codebase shows no path that ever sets outcome.reason = 'timeout'. The disconnect handler uses 'resignation' when both players leave, and there is no timeout-based cleanup that produces an outcome.
Either the timeout reason should be removed from the type, or a timeout mechanism should be implemented (e.g., a move or action timeout tracked per game, or the reconnection grace period culminating in a timeout outcome instead of resignation).
Files likely affected:
src/types/index.ts — remove 'timeout' or document why it exists
src/gameManager/index.ts — add timeout outcome logic if implementing
src/sockets/chessSockets.ts — wire up timeout events if implementing
Checklist:
The
Outcometype insrc/types/index.tsdefines'timeout'as a valid game-ending reason:However, searching the codebase shows no path that ever sets
outcome.reason = 'timeout'. The disconnect handler uses'resignation'when both players leave, and there is no timeout-based cleanup that produces an outcome.Either the
timeoutreason should be removed from the type, or a timeout mechanism should be implemented (e.g., a move or action timeout tracked per game, or the reconnection grace period culminating in a timeout outcome instead of resignation).Files likely affected:
src/types/index.ts— remove'timeout'or document why it existssrc/gameManager/index.ts— add timeout outcome logic if implementingsrc/sockets/chessSockets.ts— wire up timeout events if implementingChecklist:
'timeout'is needed or should be removed'timeout'from theOutcometype