01Give each room a durable home
Room-local state and round deadlines live together in a Durable Object. This makes the room lifecycle easier to reason about, with the tradeoff of depending on Cloudflare-specific infrastructure.
01 / Real-time applications
Keeping the room on the same page.
The original Bun/Socket.IO version was deployed. The current rebuild separates a SvelteKit interface, a pure TypeScript rules engine, durable room state, and shared reporting.
Cloudflare rebuild. Rebuild implemented; hosted and phone playtesting remain to be verified.
A voting game needs one coherent view of the round even when people reconnect, commands arrive twice, or the results database becomes unavailable. The interesting engineering work is maintaining that shared state without making reporting failures interrupt play.
Each room has a SQLite-backed Cloudflare Durable Object. A pure TypeScript package handles round rules. Room events enter a durable outbox before being exported to D1, which holds shared results. The SvelteKit frontend communicates through a same-origin API path.
Room-local state and round deadlines live together in a Durable Object. This makes the room lifecycle easier to reason about, with the tradeoff of depending on Cloudflare-specific infrastructure.
Commands carry operation IDs and stored receipts. A repeat can return the prior outcome; reusing an ID with a different payload is rejected. Transactional writes connect the command result to its receipt.
The room writes export events to its durable outbox and retries delivery. Reporting can catch up after an outage while room play continues.
Evidence from the project’s implementation, test harnesses, and recorded status.
The Cloudflare rebuild is distinct from the original deployed version. Its status document still calls for hosted deployment checks, phone playtesting, and cost measurement. A public demo of the rebuild is not claimed here.
Validate a complete session on multiple phones, check the hosted WebSocket path, and measure update latency and recovery behavior under a documented setup.