Skip to content

Inherit hibernation across Server subclasses - #417

Merged
threepointone merged 1 commit into
mainfrom
agent/inherit-server-hibernation-options
Aug 3, 2026
Merged

Inherit hibernation across Server subclasses#417
threepointone merged 1 commit into
mainfrom
agent/inherit-server-hibernation-options

Conversation

@threepointone

Copy link
Copy Markdown
Collaborator

What changed

  • Resolve hibernate through the server constructor chain, using the nearest explicitly configured value.
  • Cache that resolved value and use it consistently for connection-manager selection and socket-handler attachment.
  • Add a Workers integration regression proving that a child with partial static options still registers its socket through the Durable Object Hibernation API.
  • Document the inheritance behavior and add a patch changeset for partyserver.

Root cause

PartyServer read this.#ParentClass.options.hibernate directly. A child class that declared its own partial static options object shadowed the hibernating base class object, leaving hibernate undefined. PartyServer then silently selected the in-memory connection manager.

This is the underlying cause of cloudflare/agents#2012. Once this ships, cloudflare/agents#2022 can replace its pre-super() compatibility workaround with the new PartyServer release.

Reproduction

Before the fix, the regression connected through a child of a hibernating server whose own static options were empty. ctx.getWebSockets() returned 0, proving the socket had been accepted in memory. It returns 1 after the fix.

Validation

  • npm run build -w partyserver
  • npm run check
    • repository consistency and formatting
    • lint
    • all 42 TypeScript projects
    • PartyServer: 88 tests
    • PartySocket: 325 tests
    • Partysub, Partywhen, Partytracks, and Y-PartyServer suites

@changeset-bot

changeset-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 93888ab

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

This PR includes changesets to release 1 package
Name Type
partyserver 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

@pkg-pr-new

pkg-pr-new Bot commented Aug 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

hono-party

npm i https://pkg.pr.new/cloudflare/partykit/hono-party@417

partyfn

npm i https://pkg.pr.new/cloudflare/partykit/partyfn@417

partyserver

npm i https://pkg.pr.new/cloudflare/partykit/partyserver@417

partysocket

npm i https://pkg.pr.new/cloudflare/partykit/partysocket@417

partysub

npm i https://pkg.pr.new/cloudflare/partykit/partysub@417

partysync

npm i https://pkg.pr.new/cloudflare/partykit/partysync@417

partytracks

npm i https://pkg.pr.new/cloudflare/partykit/partytracks@417

partywhen

npm i https://pkg.pr.new/cloudflare/partykit/partywhen@417

y-partyserver

npm i https://pkg.pr.new/cloudflare/partykit/y-partyserver@417

commit: 93888ab

@threepointone
threepointone marked this pull request as ready for review August 3, 2026 14:59
@threepointone
threepointone merged commit 5ce45b7 into main Aug 3, 2026
6 of 7 checks passed
@threepointone
threepointone deleted the agent/inherit-server-hibernation-options branch August 3, 2026 15:06
@github-actions github-actions Bot mentioned this pull request Aug 3, 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