Skip to content

refactor: scope broadcasts to subscribed WebSocket clients#76

Merged
ColeMurray merged 1 commit intomainfrom
refactor/scope-broadcasts-to-subscribed-clients
Feb 7, 2026
Merged

refactor: scope broadcasts to subscribed WebSocket clients#76
ColeMurray merged 1 commit intomainfrom
refactor/scope-broadcasts-to-subscribed-clients

Conversation

@ColeMurray
Copy link
Copy Markdown
Owner

Summary

  • Narrow broadcast() audience from all connected clients to only those that have completed the subscribe handshake
  • Clients receive full state sync on subscribe, so no data is missed
  • Add integration-style test validating the broadcast pattern across authenticated, post-hibernation, unauthenticated, and sandbox sockets

Test plan

  • Unit tests pass (326/326)
  • Type check passes
  • Verify authenticated clients receive real-time updates normally via web UI
  • Verify post-hibernation clients continue receiving broadcasts after DO wake

Narrow broadcast audience to clients that have completed the subscribe
handshake. Clients receive full state sync on subscribe, so no data
is missed.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 7, 2026

Terraform Validation Results

Step Status
Format ⚠️
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Feb 7, 2026

Greptile Overview

Greptile Summary

Changed the broadcast() method to only send messages to authenticated WebSocket clients (those that have completed the subscribe handshake) instead of all connected clients. This prevents unauthenticated connections from receiving real-time updates before they've been authorized, while still supporting post-hibernation clients that have persisted database mappings.

  • Narrows broadcast audience from all_clients to authenticated_only mode
  • Added comprehensive integration test validating broadcast behavior across authenticated, post-hibernation, unauthenticated, and sandbox socket types
  • No data loss since clients receive full state sync on subscribe

@ColeMurray ColeMurray merged commit 77818c1 into main Feb 7, 2026
11 checks passed
@ColeMurray ColeMurray deleted the refactor/scope-broadcasts-to-subscribed-clients branch February 7, 2026 09:02
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