partyserver@0.5.7
Patch Changes
-
#405
7dbf92cThanks @threepointone! - Accept non-hibernating WebSocket connections in half-open mode (accept({ allowHalfOpen: true })).On compatibility dates
>= 2026-04-07theweb_socket_auto_reply_to_closeflag makes the runtime send a reciprocal Close frame and tear the socket down automatically. For a non-hibernating PartyServer (hibernate: false), the Durable Object sits on the server end of a connection that the runtime tunnels back to the client, so that auto-teardown could fire through an already-severed tunnel — surfacing as a spurious retryableNetwork connection lost.rejection (for example when a Durable Object is reset while a connection is still open). Half-open mode keeps PartyServer's existing close handling in control; it already reciprocates the peer's Close frame on every compatibility date, so client behavior is unchanged.Also in this release, two related WebSocket fixes that keep behavior consistent across all compatibility dates:
- Pin
binaryTypeto"arraybuffer"for non-hibernating connections. On compatibility dates>= 2026-03-17thewebsocket_standard_binary_typeflag flips the default server-sidebinaryTypefrom"arraybuffer"to"blob", so binary frames arrived asBlobinstead ofArrayBufferon the in-memory path. PartyServer (and frameworks built on it, e.g. Cloudflare Agents) have always receivedArrayBuffer, so it is now pinned back inaccept(). This is a no-op on older dates and corrective on newer ones; the Hibernation API is unaffected (it always deliversArrayBuffer). - Stop reporting transport-teardown errors as
onError. A retryableNetwork connection lost./WebSocket peer disconnectederror that fires on an already closing/closed connection is the socket going away during the close handshake, not an application error. It is now suppressed when the connection isCLOSING/CLOSED(detected via the structuredretryableflag, with a message fallback), so it no longer spams logs on abrupt client disconnects. Genuine mid-connection (OPEN) errors still reachonError.
- Pin