Skip to content

containers: WebSocket wrapper needs to implement connect() to support Workers TCP ingress#6495

Merged
fhanau merged 1 commit into
mainfrom
gv/websocket
Apr 8, 2026
Merged

containers: WebSocket wrapper needs to implement connect() to support Workers TCP ingress#6495
fhanau merged 1 commit into
mainfrom
gv/websocket

Conversation

@gabivlj

@gabivlj gabivlj commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gabivlj gabivlj requested review from a team as code owners April 3, 2026 21:15
@ask-bonk

ask-bonk Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

abortWrite takes kj::Exception&&. The code passes kj::cp(e) which produces a temporary kj::Exception (an rvalue), which binds to &&. This is correct.

Now let me check: connection.abortWrite(kj::cp(e))connection is the raw kj::AsyncIoStream&. After neutering the wrapper, calling abortWrite/abortRead on the underlying stream is intentional to force-close the connection. The kj::cp(e) on line 274 copies the exception before moving it to neuter() on line 273, so the ordering is fine.

Wait, let me re-read: line 273 uses kj::cp(e) and line 274 also uses kj::cp(e). Then e itself is still valid. This is fine since both kj::cp() calls just copy, they don't move from e.

The implementation follows the same pattern as RevocableWebSocket and looks correct. The change replaces a KJ_UNIMPLEMENTED with actual functionality.

LGTM

github run

Comment thread src/workerd/io/worker-interface.c++
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

@gabivlj gabivlj force-pushed the gv/websocket branch 2 times, most recently from f740aa6 to 010a548 Compare April 7, 2026 15:46
@fhanau

fhanau commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Rebased the PR to fix CI

@fhanau fhanau merged commit 1b85fee into main Apr 8, 2026
33 of 35 checks passed
@fhanau fhanau deleted the gv/websocket branch April 8, 2026 01:50
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.

3 participants