fix(offline): give the local human seat the real account id
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m41s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m41s
In a local game the human seat's account id was a synthetic 'local:human:0',
so seatName's `accountId === session.userId` check never matched: the game
header rendered BOTH seats as 🤖 (the vs_ai fallback), and the lobby's
groupGames could not find the viewer's seat, so a human's turn read as
'Their turn' with the hourglass. Carry the real account id on the human seat
(create -> record -> GameView); the robot keeps its synthetic id.
Local games created before this fix keep the old display (no migration).
This commit is contained in:
@@ -17,6 +17,9 @@ import type { Variant } from '../model';
|
||||
export interface Seat {
|
||||
kind: 'human' | 'robot';
|
||||
name: string;
|
||||
/** The player's real account id for a human seat, so the client identifies "you" and the correct
|
||||
* turn exactly as in an online game; absent for the robot (a synthetic id is derived). */
|
||||
accountId?: string;
|
||||
}
|
||||
|
||||
/** LocalGameRecord is the durable form of one local game — everything needed to reconstruct it. */
|
||||
|
||||
Reference in New Issue
Block a user