Skip to content

fix(pegboard-envoy): send an actor's own WebSocket close back to it - #5950

Open
eersnington wants to merge 1 commit into
mainfrom
fix/pegboard-envoy-actor-ws-close
Open

eersnington wants to merge 1 commit into
mainfrom
fix/pegboard-envoy-actor-ws-close

Conversation

@eersnington

Copy link
Copy Markdown
Member

When an actor called ws.close(), pegboard-envoy forwarded the close to the client and ended the tunnel. It never sent the close back to the actor, so the actor's close handler never ran, the socket stayed open, and the actor never went to sleep. Client-initiated closes were not affected.

  • pegboard-envoy now sends ToEnvoyWebSocketClose back to the actor, with the same code and reason, after it forwards the actor's close to the client.
  • A close with hibernate: true is not sent back.
  • No protocol change: the message already exists.
Actor calls ws.close(4000) Actor close event Actor sleeps when idle
Before never never
After once yes

Checked with a RivetKit 3.0.0-preview.4 actor on a local Engine, 3 runs each. Client-initiated closes behave as before.

@NathanFlurry
NathanFlurry changed the base branch from 3.x to main October 31, 2026 20:52

This branch has not been deployed

No deployments
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