feat(protocol): version the wire contract, reject mismatched clients #97

Merged
marco merged 1 commit from feat/protocol-version into main 2026-07-19 20:25:34 +02:00
Owner

Groundwork for shipping client + server as separate releases (#33): a protocol version gate.

  • ProtocolVersion.Current (a const int in Shared/Protocol) is the single source of truth.
  • The client sends it at connect: /ws?access_token=...&v={Current}.
  • The server rejects a connection whose v differs (HTTP 426 Upgrade Required) before any handshake — a stale client can't talk a desynced protocol and cause subtle bugs.
  • Rule added to CLAUDE.md: bump ProtocolVersion.Current in the SAME change as any wire-contract change (ClientMessage/ServerMessage shape, protocol enum, wire DTO).

Integration test: a wrong version is rejected; the existing WS tests now send the version.

Definition of Done

  • A client on the wrong protocol version cannot connect (426); a matching client connects normally.
  • Suite green (160 GameServer), zero warnings.
Groundwork for shipping client + server as separate releases (#33): a **protocol version gate**. - `ProtocolVersion.Current` (a `const int` in `Shared/Protocol`) is the single source of truth. - The client sends it at connect: `/ws?access_token=...&v={Current}`. - The server rejects a connection whose `v` differs (HTTP **426 Upgrade Required**) **before any handshake** — a stale client can't talk a desynced protocol and cause subtle bugs. - **Rule added to CLAUDE.md**: bump `ProtocolVersion.Current` in the SAME change as any wire-contract change (ClientMessage/ServerMessage shape, protocol enum, wire DTO). Integration test: a wrong version is rejected; the existing WS tests now send the version. ## Definition of Done - [ ] A client on the wrong protocol version cannot connect (426); a matching client connects normally. - [ ] Suite green (160 GameServer), zero warnings.
feat(protocol): version the wire contract, reject mismatched clients
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m28s
603c2043d2
Add ProtocolVersion.Current (Shared/Protocol). The client sends it at connect
(/ws?...&v=); the server rejects a mismatched version with HTTP 426 before any
handshake, so a stale client can't talk a desynced protocol once client and
server ship as separate releases. Bump the const on any wire-contract change
(rule added to CLAUDE.md). Integration test: a wrong version is rejected.
marco merged commit 75851f498a into main 2026-07-19 20:25:34 +02:00
marco deleted branch feat/protocol-version 2026-07-19 20:25:34 +02:00
Sign in to join this conversation.
No reviewers
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.

Dependencies

No dependencies set

Reference
marco/IsoMmo!97
No description provided.