The Guest holds the Seat: the server mints it, the browser keeps and sends it, the Seat token is gone #372
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#373 Store each decided Online game once, owned by the Guest in each Seat
amaurycoudr/chess-project
#370 The Drizzle Gateway browses every stack through an SSH tunnel
amaurycoudr/chess-project
#371 Production is dumped nightly, checked by a restore, encrypted and kept off the VPS
amaurycoudr/chess-project
Reference
amaurycoudr/chess-project#372
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#355
What to build
A browser proves its Seat with one Guest, in every Room, instead of a Seat token per Room (ADR 0034).
When a browser creates a Room or takes a Seat without a Guest, the server mints one: at least 128 random bits, URL-safe, through a constructor option. The response says which Guest it minted, or that it minted none, and that response is the only time the secret crosses the wire. A refused take (
NO_FREE_SEAT) mints nothing, so a Spectator never gets a Guest. The API's RPC context reads the Guest header and hashes the secret with SHA-256 on arrival. From then on the caller's occupant is a union with one variant today, a Guest known by its hash. Resolving the caller stays synchronous and reads no database. An unknown secret is a Guest with nothing to its name, never a validation error.The Room keys each occupant by its Guest and is always handed one; it no longer mints anything. A Guest that already holds a Seat in a Room gets that Seat back on a second take, never the other one.
The front keeps the Guest under one
localStoragekey of its own. It sends the Guest in its header on every call and replaces it with whatever a response minted. The store sits where bothroom/and a futuregames/vertical may import it. Entering a Room always callsseat.take, still deduplicated per Room code. The answer either hands back the held Seat, takes a free one, or refuses, and a refusal makes the browser a Spectator. Leaving forgets nothing. If storage throws, play still works, but a reload loses the Seat.The Seat token is removed everywhere: its contract schema and header, the token in the create and take output, the per-Room front storage, and the API's handling of its header. Leftover per-Room keys in browsers are ignored. Comments that cite ADR 0016 are repointed to ADR 0034 or dropped. A Player sees no difference.
Seam: the
Roomwith its fixtures (seating by Guest); the RPC wire with the in-process app (minting, acting for a Seat); the Room view tests with their harness and MSW (keeping and sending the Guest); e2e (the existing reload and second-tab specs kept green).Acceptance criteria
room.createandseat.takewith no Guest mint one and say so. With a known or unknown Guest, they mint nothing.seat.take(NO_FREE_SEAT) mints no Guest (story 3).seat.takeonce per Room code, and a refusal lands the browser as a Spectator.mentioned in issue #373
mentioned in issue #355
mentioned in issue #370
mentioned in issue #371
marked this issue as related to #355
marked this issue as related to #370
marked this issue as related to #371
marked this issue as related to #373
mentioned in commit
8ad1fd91fementioned in commit
d5cf28a684mentioned in commit
c56a5f5454mentioned in commit
d6459084e7mentioned in commit
d5b42b7f11mentioned in merge request !515
mentioned in commit
941c8132bdmentioned in commit
7d0a5a725ementioned in commit
66524f0f45mentioned in commit
ff47973c19mentioned in commit
1696cd91efmentioned in commit
f453e2ce3fmentioned in commit
c1eb8e46e2mentioned in commit
084b9e5706mentioned in commit
d7ee32c058mentioned in commit
309352130c