Skip to content

feat: stream committed match states over WebSockets - #13

Merged
nosam1998 merged 3 commits into
mainfrom
feat/live-match-stream
Sep 30, 2026
Merged

nosam1998 merged 3 commits into
mainfrom
feat/live-match-stream

Conversation

@nosam1998

@nosam1998 nosam1998 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Players and spectators can subscribe to /v1/matches/{id}/stream for an initial state and each newly committed turn. A runtime-independent service observer wakes clients after successful commits; durable replay fills notification gaps and periodic reconciliation catches another process writing to the same database.

Depends on #12. Streams apply the selected viewer to every state, retain local peer/Host/Origin checks, limit active connections and message sizes, bound writes with timeouts, and close before SQLite during shutdown. Submit moves through REST. This initial protocol sends state frames; event pagination and resume cursors remain separate increments.

Validation: all GitHub Actions checks pass at 0c2f7ec1c17268228b0016050f3fcde09b3c04a3: 43 Rust tests, fmt, clippy, architecture and SQLx metadata checks, cargo-deny, core API compatibility, web checks, and game benchmarks. A real CLI/HTTP/SQLite restart smoke test also passes. New tests cover commit-only notifications, ordered player/spectator streams, other-match isolation, reconnects, invalid upgrades, shutdown, terminal-state delivery before close, and reconciliation after a separate service writes without notification.

@nosam1998
nosam1998 marked this pull request as ready for review September 30, 2026 04:45
@nosam1998
nosam1998 changed the base branch from feat/local-server to main September 30, 2026 04:47
@nosam1998
nosam1998 merged commit 8eb0d90 into main Sep 30, 2026
6 checks passed
@nosam1998
nosam1998 deleted the feat/live-match-stream branch September 30, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant