Seats and Games as an Account: one Seat across devices, Games owned and listed by the Account #382

Closed
opened 2026-10-11 16:27:08 +00:00 by root · 13 comments
root commented 2026-10-11 16:27:08 +00:00 (Migrated from gitlab.core-project.space)

Imported from GitHub amaurycoudr/chess-project#382, opened by @amaurycoudr on 2026-10-11 16:27 UTC.


Parent

#364

What to build

A call with a Session creates a Room or takes a Seat as its Account; without one, as its Guest. A call is a Seat's occupant when either its Account or its Guest matches. So a second signed-in device opens the same Seat, a browser that signed in mid-Game keeps its Guest-held Seat, and signing out leaves the Seat taken and disconnected. A caller who already occupies a Seat by either identity cannot take the other. The room.changes stream identifies its Connection once, when it opens.

A decided Game records each Color's owner as an Account or a Guest. The games table gains a nullable account owner per Color with ON DELETE SET NULL and at most one owner per Color. An owner whose Account was deleted before the Game ended is stored as no owner. game.list and game.get answer as the caller's Account when there is a Session, else their Guest. The Seat view in the snapshot and each side in a Game read gain the occupant's name: an Account with its Username, or a Guest. No email, account id or hash crosses the wire.

Seam: the RPC wire

Acceptance criteria

  • Create and take record the Account with a Session and the Guest without one
  • One Account on two devices, with the other Seat free, never takes it; the second device is seated in the same Seat
  • Signing in mid-Game keeps the Guest-held Seat playable from that browser
  • Signing out leaves the Seat taken and disconnected, and signing in again resumes it
  • A decided Game is stored with the Account as owner; one decided after its Account owner was deleted is stored with no owner for that Color
  • game.list as an Account lists its Games newest first, including when it has none; game.get as the Account answers its Color
  • The snapshot's Seats and the sides of game.list and game.get carry the occupant's name and nothing else that identifies them
  • The migration adds the owner columns, the one-owner-per-Color check and the indexes for "My games"
> _Imported from GitHub [amaurycoudr/chess-project#382](https://github.com/amaurycoudr/chess-project/issues/382), opened by [@amaurycoudr](https://github.com/amaurycoudr) on 2026-10-11 16:27 UTC._ <!-- github-issue:382 --> --- ## Parent #364 ## What to build A call with a **Session** creates a **Room** or takes a **Seat** as its **Account**; without one, as its **Guest**. A call is a **Seat**'s occupant when either its **Account** or its **Guest** matches. So a second signed-in device opens the same **Seat**, a browser that signed in mid-**Game** keeps its **Guest**-held **Seat**, and signing out leaves the **Seat** taken and disconnected. A caller who already occupies a **Seat** by either identity cannot take the other. The `room.changes` stream identifies its **Connection** once, when it opens. A decided **Game** records each **Color**'s owner as an **Account** or a **Guest**. The `games` table gains a nullable account owner per **Color** with `ON DELETE SET NULL` and at most one owner per **Color**. An owner whose **Account** was deleted before the **Game** ended is stored as no owner. `game.list` and `game.get` answer as the caller's **Account** when there is a **Session**, else their **Guest**. The **Seat** view in the snapshot and each side in a **Game** read gain the occupant's name: an **Account** with its **Username**, or a **Guest**. No email, account id or hash crosses the wire. Seam: the RPC wire ## Acceptance criteria - [ ] Create and take record the **Account** with a **Session** and the **Guest** without one - [ ] One **Account** on two devices, with the other **Seat** free, never takes it; the second device is seated in the same **Seat** - [ ] Signing in mid-**Game** keeps the **Guest**-held **Seat** playable from that browser - [ ] Signing out leaves the **Seat** taken and disconnected, and signing in again resumes it - [ ] A decided **Game** is stored with the **Account** as owner; one decided after its **Account** owner was deleted is stored with no owner for that **Color** - [ ] `game.list` as an **Account** lists its **Games** newest first, including when it has none; `game.get` as the **Account** answers its **Color** - [ ] The snapshot's **Seats** and the sides of `game.list` and `game.get` carry the occupant's name and nothing else that identifies them - [ ] The migration adds the owner columns, the one-owner-per-**Color** check and the indexes for "My games"
root commented 2026-10-11 16:27:08 +00:00 (Migrated from gitlab.core-project.space)

GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links).

> _GitHub issue relations, imported as "related" links (GitLab CE has no sub-issues or blocking links)._ <!-- github-relations --> - Parent (sub-issue of): #364 - Blocked by: #378 - Blocking: #384, #383
root commented 2026-10-13 08:39:49 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #383

mentioned in issue #383
root commented 2026-10-13 08:39:50 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #384

mentioned in issue #384
root commented 2026-10-13 08:41:22 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #364

mentioned in issue #364
root commented 2026-10-13 08:41:26 +00:00 (Migrated from gitlab.core-project.space)

mentioned in issue #378

mentioned in issue #378
root commented 2026-10-13 08:42:29 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #364

marked this issue as related to #364
root commented 2026-10-13 08:42:37 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #378

marked this issue as related to #378
root commented 2026-10-13 08:42:40 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #384

marked this issue as related to #384
root commented 2026-10-13 08:42:40 +00:00 (Migrated from gitlab.core-project.space)

marked this issue as related to #383

marked this issue as related to #383
root commented 2026-10-14 10:36:16 +00:00 (Migrated from gitlab.core-project.space)

mentioned in merge request !523

mentioned in merge request !523
root commented 2026-10-14 11:15:15 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit b379bb71bd

mentioned in commit b379bb71bd539f891a7fcfafd73e436230ffbcd7
root commented 2026-10-14 12:19:56 +00:00 (Migrated from gitlab.core-project.space)

mentioned in commit 550a569aef

mentioned in commit 550a569aef0fb0ade603eb340926feb9b828e2ad
root commented 2026-10-14 13:29:03 +00:00 (Migrated from gitlab.core-project.space)

Delivered by !523, merged into main.

Delivered by !523, merged into main.
root (Migrated from gitlab.core-project.space) closed this issue 2026-10-14 13:29:04 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
amaurycoudr/chess-project#382
No description provided.