·
3 commits
to main
since this release
Patch Changes
- #394
9a927a3Thanks @threepointone! - Don't reciprocate the WebSocket close handshake when the runtime delivers a reserved close code (1005,1006,1015). These codes are synthesized by the runtime when the peer didn't actually send a Close frame — there is no handshake to complete. The earlier0.5.4change ([#393](https://github.com/cloudflare/partykit/issues/393)) normalized these to1000and tried to send a reciprocating Close frame anyway; in cross-isolate transports (notably WebSocket pairs that flow back through Durable Object RPC, e.g. Cloudflare Agents sub-agents) the reciprocation would succeed synchronously but schedule an outbound write on a transport whose peer was already gone. The runtime then rejected that write asynchronously withNetwork connection lost, escapingcloseQuietly's synchronoustry/catchand surfacing as an unhandled promise rejection in tests and production logs. The fix is to skip the reciprocation for reserved codes — there's nothing to acknowledge to a peer that didn't speak. The narrow user-visible behavior change: a client that callsws.close()with no code on compat dates< 2026-04-07(no auto-reply) will now observe a non-clean close instead of a clean1000close, because the framework no longer fabricates a reciprocation. Clients that pass an explicit close code are unaffected.