Skip to content

fix: handle ASGI WebSocket close events and environment propagation - #218

Merged
dom96 merged 1 commit into
mainfrom
dominik/ws-close-env
Aug 21, 2026
Merged

fix: handle ASGI WebSocket close events and environment propagation#218
dom96 merged 1 commit into
mainfrom
dominik/ws-close-env

Conversation

@dom96

@dom96 dom96 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

This fixes two gaps in ASGI WebSocket handling:

  • Application-originated websocket.close messages were ignored, so clients never received the requested close code or reason.
  • WebSocket scopes always received an empty env, even when the caller supplied Worker bindings.

Test Plan

$ uv run pytest 'tests/test_in_workerd.py::test_in_workerd[asgi-ws-disconnect-3.13]' -v

@dom96
dom96 requested a review from ryanking13 August 18, 2026 18:05
@ask-bonk

ask-bonk Bot commented Aug 18, 2026

Copy link
Copy Markdown

ProviderModelNotFoundError

github run

@ask-bonk

ask-bonk Bot commented Aug 18, 2026

Copy link
Copy Markdown

@dom96 Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

Comment thread packages/runtime-sdk/src/workers/asgi.py
@dom96
dom96 merged commit 47cc488 into main Aug 21, 2026
22 of 23 checks passed
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.

2 participants