The type in defines as a valid game-ending reason:
export type Outcome = {
winner?: Color;
reason: 'checkmate' | 'resignation' | 'timeout' | 'draw' | 'stalemate' | 'insufficient_material' | 'threefold_repetition';
}
However, looking through the codebase, is never actually set anywhere. The disconnect handler in sets a 5-second reconnect timer, but when that timer fires it calls directly without ever setting an outcome with reason .
A outcome would be appropriate when a player disconnects and does not reconnect within the grace period. This would provide a cleaner game record than silently erasing the game.
To fix this, the disconnect handler's reconnect timer should set before erasing the game, similar to how handles it.
The type in defines as a valid game-ending reason:
However, looking through the codebase, is never actually set anywhere. The disconnect handler in sets a 5-second reconnect timer, but when that timer fires it calls directly without ever setting an outcome with reason .
A outcome would be appropriate when a player disconnects and does not reconnect within the grace period. This would provide a cleaner game record than silently erasing the game.
To fix this, the disconnect handler's reconnect timer should set before erasing the game, similar to how handles it.