Bump partysocket from 1.1.16 to 1.3.0 in /server
DE
5mo ago+7+7+0123456789-7-7-0123456789
Bumps partysocket from 1.1.16 to 1.3.0.
Release notes
Sourced from partysocket's releases.
partysocket@1.3.0
Minor Changes
- #409
6b97742Thanks@threepointone! - AddshouldReconnectOnClose, allowing callers to stop automatic reconnects for terminal close events while preserving the existing reconnect-by-default behavior.partysocket@1.2.0
Minor Changes
#403
7e042ebThanks@threepointone! - Make buffered messages and connection teardown reliable across socket replacement and explicit close (see cloudflare/agents#1738).
close()now dispatches itscloseevent synchronously (mirroring howreconnect()already dispatched its synthetic close). Consumers that detach their listeners right after closing — like the React hooks during cleanup — previously never observed the terminal close event, leaving "connection closed" handling (pending-call rejection, state resets) to never run. Afterclose()returns,readyStatereportsCLOSEDimmediately, even while the underlying socket finishes its closing handshake. Code that attached acloselistener after callingclose()and relied on the event arriving asynchronously must attach the listener first.send()now returns aboolean:trueif the message was transmitted immediately over an open connection,falseif it was buffered (delivered when the connection next opens, always before theopenevent is dispatched) or dropped becausemaxEnqueuedMessageswas reached. Callers implementing request/response protocols can use this to know whether a request is actually in flight.- New
drainQueuedMessages()method removes and returns all messages that were buffered bysend()but never transmitted, so a socket that's being discarded can hand its unsent buffer to a replacement instead of silently losing it.- React hooks (
usePartySocket,useWebSocket) now migrate buffered messages when they replace the socket because connection options changed. By default, buffered messages transfer only when the destination is unchanged (e.g. onlyquery— credentials — changed); if destination options (room,party,path,host, URL, ...) changed, the messages are discarded with a warning rather than delivered to a destination they weren't composed for. The newtransferEnqueuedMessagesoption overrides this:truealways transfers,falsenever does.- Warn when
send()is called afterclose(). Messages sent against a permanently closed socket are buffered into a queue that nothing will ever flush (unlessreconnect()is called later), which silently strands the message — and any caller waiting on a reply. This usually indicates a stale socket reference in the caller. The message is still buffered for backwards compatibility; the warning is emitted once per close cycle and resets onreconnect().partysocket@1.1.19
Patch Changes
partysocket@1.1.18
Patch Changes
- #374
c05d86aThanks@threepointone! - Narrow the exportedMessagetype fromArrayBufferViewtoArrayBufferView<ArrayBuffer>so it matches the DOMWebSocket.send()overloads under newer@cloudflare/workers-types/ lib.dom.d.ts, where the defaultArrayBufferView<ArrayBufferLike>includesSharedArrayBuffer-backed views thatsend()does not accept. Runtime behaviour is unchanged —WebSocket.send()already rejected shared-buffer views at runtime.partysocket@1.1.17
Patch Changes
- #372
bb6ab6fThanks@threepointone! - Fixprotocolstype inPartySocketOptionsto acceptProtocolsProviderinstead ofstring[], matching the full range of types already supported by the underlyingReconnectingWebSocket.
Changelog
Sourced from partysocket's changelog.
1.3.0
Minor Changes
- #409
6b97742Thanks@threepointone! - AddshouldReconnectOnClose, allowing callers to stop automatic reconnects for terminal close events while preserving the existing reconnect-by-default behavior.1.2.0
Minor Changes
- #403
7e042ebThanks@threepointone! - Make buffered messages and connection teardown reliable across socket replacement and explicit close (see cloudflare/agents#1738).
close()now dispatches itscloseevent synchronously (mirroring howreconnect()already dispatched its synthetic close). Consumers that detach their listeners right after closing — like the React hooks during cleanup — previously never observed the terminal close event, leaving "connection closed" handling (pending-call rejection, state resets) to never run. Afterclose()returns,readyStatereportsCLOSEDimmediately, even while the underlying socket finishes its closing handshake. Code that attached acloselistener after callingclose()and relied on the event arriving asynchronously must attach the listener first.send()now returns aboolean:trueif the message was transmitted immediately over an open connection,falseif it was buffered (delivered when the connection next opens, always before theopenevent is dispatched) or dropped becausemaxEnqueuedMessageswas reached. Callers implementing request/response protocols can use this to know whether a request is actually in flight.- New
drainQueuedMessages()method removes and returns all messages that were buffered bysend()but never transmitted, so a socket that's being discarded can hand its unsent buffer to a replacement instead of silently losing it.- React hooks (
usePartySocket,useWebSocket) now migrate buffered messages when they replace the socket because connection options changed. By default, buffered messages transfer only when the destination is unchanged (e.g. onlyquery— credentials — changed); if destination options (room,party,path,host, URL, ...) changed, the messages are discarded with a warning rather than delivered to a destination they weren't composed for. The newtransferEnqueuedMessagesoption overrides this:truealways transfers,falsenever does.- Warn when
send()is called afterclose(). Messages sent against a permanently closed socket are buffered into a queue that nothing will ever flush (unlessreconnect()is called later), which silently strands the message — and any caller waiting on a reply. This usually indicates a stale socket reference in the caller. The message is still buffered for backwards compatibility; the warning is emitted once per close cycle and resets onreconnect().1.1.19
Patch Changes
1.1.18
Patch Changes
- #374
c05d86aThanks@threepointone! - Narrow the exportedMessagetype fromArrayBufferViewtoArrayBufferView<ArrayBuffer>so it matches the DOMWebSocket.send()overloads under newer@cloudflare/workers-types/ lib.dom.d.ts, where the defaultArrayBufferView<ArrayBufferLike>includesSharedArrayBuffer-backed views thatsend()does not accept. Runtime behaviour is unchanged —WebSocket.send()already rejected shared-buffer views at runtime.1.1.17
Patch Changes
- #372
bb6ab6fThanks@threepointone! - Fixprotocolstype inPartySocketOptionsto acceptProtocolsProviderinstead ofstring[], matching the full range of types already supported by the underlyingReconnectingWebSocket.
Commits
886022dVersion Packages6b97742Add terminal close reconnect predicateaeba44fpost release cleanup881c192Version Packages5e6261cformat7e042ebfix(partysocket): reliable buffered messages and close events across socket r...282c5d3Version Packages4abd429fix(partysocket): avoid module-scope random default7b4cceaformat7ba9997Version Packages- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Summary by cubic
Upgrade partysocket to 1.3.0 in server for more reliable WebSocket behavior and better control over reconnects. Adds shouldReconnectOnClose, synchronous close events, and improved buffered message handling.
-
Dependencies
- Bump
partysocketfrom 1.1.16 → 1.3.0
- Bump
-
Migration
- If you rely on the
closeevent firing asynchronously, attachcloselisteners before callingclose(); no other changes required.
- If you rely on the