8000 Move the party server from hosted PartyKit to partyserver on Workers by noahm · Pull Request #677 · noahm/DDRCardDraw · GitHub
[go: up one dir, main page]

Skip to content

Move the party server from hosted PartyKit to partyserver on Workers - #677

Merged
noahm merged 2 commits into
partykitfrom
partyserver-migration
Oct 23, 2026
Merged

noahm merged 2 commits into
partykitfrom
partyserver-migration

Conversation

@noahm
@noahm noahm commented Oct 23, 2026 •
Copy link
Copy Markdown
Owner

Hosted PartyKit has been taken offline, so event mode needs a new home. This ports the room server to partyserver running on our own Cloudflare account as a SQLite-backed Durable Object.

What changed

  • Server: src/party/server.ts is now class Main extends Server<Env>. The sync protocol, hydration, coalesced writes and ?debug are unchanged; the diff is mostly renames (this.room.* → this.name / this.ctx.storage / this.broadcast) plus partyserver's swapped onMessage(connection, message) arguments.
  • Routing: new src/party/worker.ts + wrangler.jsonc. URLs keep the /parties/main/<room> shape, so partysocket on the client is untouched.
  • R2: snapshot-store.ts uses the SNAPSHOTS binding instead of signed S3 requests. Same bucket (ddr-tools-persistence) and key layout, so rooms already saved to R2 hydrate from it on first visit. Rooms that only ever lived in PartyKit room storage are gone.
  • Removed: aws4fetch, the R2_* secrets, LOCAL_SNAPSHOT_URL and scripts/local-snapshot-store.mjs; wrangler dev simulates the binding locally.
  • Storage limit: SQLite-backed DO values cap at 2 MB (was 128 KiB). gzip kept.
  • Domain: the worker is served at live.ddr.tools (custom domain route in wrangler.jsonc). The client host is a build-time PARTY_HOST in webpack, defaulting to it in production.
  • Tooling: yarn start:backend → wrangler dev --port 1999; new yarn deploy:party; watch:room wraps wrangler tail; worker code typechecks via tsconfig.worker.json (added to validate:types:ts).
  • Docs, .env.template and the verify skill updated.

Testing

  • yarn validate passes.
  • Against wrangler dev: websocket round trip writes to DO storage and R2; an R2-only room at seq 42 hydrated with source: remote and continued at 43; a backend restart restored from DO storage.
  • Browser, two tabs on one event room: adding a cab in one appeared in the other; ?debug showed seq == persistedSeq, no warnings.
  • watch:room against a live deploy is untested.

Deploy

  1. yarn deploy:party (first deploy creates the DO namespace and the live.ddr.tools DNS record + certificate).
  2. Rebuild and redeploy the frontend; live builds still point at *.partykit.dev.
  3. Point the ddr-tools-api val at the new host if it reads room state.

🤖 Generated with Claude Code

Hosted PartyKit has been taken offline. The room server is now a
SQLite-backed Durable Object (`Main`) routed by partyserver at the same
/parties/main/<room> paths, so partysocket on the client is unchanged.

- snapshot-store: R2 through the SNAPSHOTS binding instead of signed S3
  requests; same bucket and key layout, so rooms already saved there
  hydrate from it on first visit
- drop aws4fetch, the R2_* secrets, LOCAL_SNAPSHOT_URL and the local
  snapshot store script; wrangler dev simulates the binding locally
- storage value limit is now 2 MB (gzip kept)
- client host is a build-time PARTY_HOST, defaulting to
  ddr-card-draw-party.psoplayer.workers.dev
- yarn start:backend runs wrangler dev on :1999; new yarn deploy:party;
  watch:room wraps wrangler tail
- worker code typechecks against workers-types via tsconfig.worker.json

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel
vercel Bot commented Oct 23, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ddr-tools Ready Ready Preview Oct 23, 2026 4:53pm UTC

Custom domain route in wrangler.jsonc, and the production default for
PARTY_HOST in webpack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahm noahm closed this Oct 23, 2026
@noahm noahm reopened this Oct 23, 2026
@noahm
noahm merged commit 28fa25f into partykit Oct 23, 2026
7 checks passed
@noahm
noahm deleted the partyserver-migration branch October 23, 2026 16:58

This branch was successfully deployed

1 active deployment
Preview — 7aec81e6 Deployed Oct 23, 2026 by vercel[bot]
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

0