Skip to content

Conversation

@threepointone
Copy link
Collaborator

Summary

  • partyserver: Add configurable: true to the state, setState, serializeAttachment, and deserializeAttachment property descriptors on connection objects. This allows downstream consumers (like the Cloudflare Agents SDK) to redefine these properties via Object.defineProperty for namespacing or wrapping internal state storage. Default behavior is unchanged.

  • partysocket: Throw a clear error when constructing a PartySocket without room or basePath (and without startClosed: true), instead of silently connecting to a malformed URL containing "undefined" as the room name.

  • Tests: Add tests for configurable property redefinition (both hibernating and non-hibernating paths), setState round-trip persistence, and the new constructor validation. Change describe.skipdescribe.skipIf(!!process.env.GITHUB_ACTIONS) across partysocket tests so they run locally but remain skipped in CI. Fix port collision between react-ssr and edge-cases test suites, and individually skip flaky WebSocket-connection-dependent hook tests.

Test plan

  • partyserver: 12 tests pass (including 3 new: configurable state hibernating, configurable state non-hibernating, setState round-trip)
  • partysocket: 273 tests pass locally, 16 flaky connection-timing tests skipped
  • Simulated CI (GITHUB_ACTIONS=true): identical to previous behavior (45 partysocket + 12 partyserver pass)

Make connection property descriptors configurable by adding configurable: true to state, setState, serializeAttachment and deserializeAttachment so downstream consumers (e.g. Cloudflare Agents SDK) can redefine or namespace them. Update types and tests to cover redefinition and state round-trips (hibernating and in-memory paths), and add DurableObject test classes and wrangler entries. Add validation in PartySocket to throw a clear error when constructed without room or basePath (unless startClosed: true) to avoid silently connecting to malformed URLs. Misc: refactor/guard many partysocket tests with skipIf on CI and adjust error-handling and edge-case tests accordingly. Two changeset files record patch bumps for partyserver and partysocket.
@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: 5c7851c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
partyserver Patch
partysocket Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@threepointone threepointone merged commit 15a4157 into main Feb 8, 2026
4 of 5 checks passed
@threepointone threepointone deleted the configurable-connection-setstate branch February 8, 2026 18:30
This was referenced Feb 8, 2026
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