Skip to content

feat(hub): add bounded WebSocket broadcasts - #156

Merged
nshki merged 3 commits into
build/hub/newfrom
copilot/hub-websocket-foundation
Oct 30, 2026
Merged

nshki merged 3 commits into
build/hub/newfrom
copilot/hub-websocket-foundation

Conversation

Copilot AI commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Why

The client app and Copilot plugin need live updates as features move to the TypeScript Hub. This adds the connection layer before commenting is ported, without storing or replaying notifications. Closes #155.

What changes

The ws integration attaches to the existing HTTP server. Clients can subscribe to channels, and feature code can broadcast to their connected subscribers. createApp and route registration accept an optional broadcast function, so HTTP features can run without WebSocket setup. Vite forwards development upgrades, and API shutdown closes connections.

Connection and message limits bound memory use, including pending access checks, channel memberships, fragmented messages, and outgoing data. Heartbeats remove dead connections, and repeated rejected upgrades are summarized in logs.

Authentication remains separate work. The endpoint rejects connections until application access checks are supplied. This foundation serves one API process only; comment events, client reconnection, and communication between processes are not included. The new guide documents the protocol, limits, and responsibilities for future features.

Created from a Slack conversation.

Co-authored-by: Nishiki <1121087+nshki@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings October 29, 2026 18:19
Copilot AI requested review from a team and nshki as code owners October 29, 2026 18:19

This comment was marked as duplicate.

nshki and others added 2 commits October 29, 2026 18:53
Merge app coverage into index.test.ts and keep the WebSocket happy path and critical failure cases. Move reusable test helpers into function directories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep protocol schemas and shared types outside entry points. Extract connection, delivery, and shutdown helpers into function directories without changing behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nshki
nshki merged commit 567a98b into build/hub/new Oct 30, 2026
27 checks passed
@nshki
nshki deleted the copilot/hub-websocket-foundation branch October 30, 2026 16:48
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.

5 participants