Conversation
Persist the Durable Object server name so it survives cold starts and is available inside onStart/onAlarm and scheduled callbacks. Introduces a NAME_STORAGE_KEY constant and has setName write the name to storage; fetch(), alarms and ws handlers hydrate the name from storage via a new #ensureInitialized() helper. Adds tests and two test DOs (AlarmNameServer, NoNameServer) plus wrangler test config updates; updates package peer/dev dependency ranges for partyserver and bumps partysocket. Adds a changeset entry and enables an experimental changesets option.
Replace wrangler migration entries from `new_classes` to `new_sqlite_classes` across fixtures and READMEs and add a changeset documenting that partyserver now relies on SQLite-backed Durable Objects (synchronous storage). Update use-socket logic to track option changes while disabled, ensure correct socket creation/cleanup on re-enable and StrictMode/HMR, and always connect replacement sockets. Expand tests in partysocket to cover these re-enable, token-refresh, cleanup, and wire-level scenarios. Breaking: Durable Object namespaces must use `new_sqlite_classes` when deployed.
Replace synchronous ctx.storage.kv usage with the async ctx.storage.get/put for persisting Server.name. Add a #hydrateNameFromStorage() helper and call it from entry points (#ensureInitialized and fetch path) so the name is loaded on cold starts; await storage.put when setting the name. Update tests to await ctx.storage.put. Add a changeset documenting the migration and remove the previous changeset that required SQLite-backed Durable Objects.
Stop storing the server name on ConnectionAttachments and in accept() options; instead populate connection.server at runtime from Server.name. Adjusted tryGetPartyServerMeta, connection serialization, and ConnectionManager.accept signatures accordingly. Updated index to set connection.server before invoking handlers, and updated tests/worker to expect the runtime-populated value. Marked the Connection.server type as deprecated in types.ts.
Specify explicit reconnection parameters in the react-hooks wire tests to control retry behavior during testing and reduce flakiness. Adds minReconnectionDelay: 50, maxReconnectionDelay: 200, and connectionTimeout: 2000 for the affected test cases.
Re-enable and stabilize many flaky partysocket tests by introducing a FAST_RECONNECT config and applying it across tests (min/max reconnection delays and connectionTimeout). Adjusted test timeouts, waitFor durations, and small timing delays to reduce flakiness; added explicit maxRetries and connectionTimeout in places. Also updated an error-handling test to set connectionTimeout and extended its wait period. In partyserver index, removed stray TODO/commented lines and top-of-file notes to tidy the file.
Pass the Hono Context (c) as a third argument to onBeforeConnect/onBeforeRequest callbacks so handlers can access c.env, c.var, c.get(), etc. Adds a .changeset for a patch release, updates the Hono fixture and README to demonstrate using env bindings, and implements HonoPartyServerOptions plus wrapOptionsWithContext to close over the Hono context. Also adjusts middleware and handler wiring (createMiddleware generic, options wrapping, and handler signatures) to forward the context to partyserver callbacks.
Add an explicit, optional React peerDependency for partysocket so strict package managers (e.g. pnpm) correctly resolve react for the partysocket/react and partysocket/use-ws subpath exports. This includes a new changeset and package.json updates. Also: tighten test typings (import and use WsWebSocket instead of any), rename an unused handler param to _lobby to avoid linter noise, and add explanatory comments plus a biome-ignore on the memoized socket options to avoid unnecessary reconnects when callers pass inline option objects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )