You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are extracting real-time notifications from the monolith into a dedicated notifications-gateway service.
Constraints:
Single PR delivering the full change.
No auth changes in this task (ignore socket auth/authorization).
UI continues to connect to a single entry point (Envoy). UI code remains unchanged.
Envoy must route /socket.io to the new notifications-gateway and /api to platform-server.
Use Redis Pub/Sub as the broker between platform-server and notifications-gateway.
Our default docker-compose continues to spin up only third-party deps (engineers run services locally). Provide a separate docker-compose.e2e.yml that brings up our services for end-to-end testing.
Specification (from research)
Current monolith behavior (to be replicated):
Socket.IO server lives in packages/platform-server/src/gateway/graph.socket.gateway.ts (default namespace, path /socket.io, websocket-only). Clients join rooms via a subscribe event; no server-side unsubscribe.
Rooms: graph, threads, and entity rooms: node:<id>, thread:<id>, run:<id>.
Events (names and payloads must remain identical):
Emission path today: domain services → EventsBusService (in-process EventEmitter) → GraphSocketGateway emit to rooms. There is also a LiveGraphRuntime direct subscription emitting node_status.
Auth: not used for sockets today; do not add in this task.
Target architecture & scope for this PR:
Create a new service packages/notifications-gateway:
Runs a Socket.IO server on /socket.io (default namespace, websocket-only).
Consumes notifications from Redis Pub/Sub channel notifications.v1.
Emits to rooms using the current room model and event names/payloads exactly as-is.
No auth/authorization checks in this task.
Update monolith (platform-server):
Remove GraphSocketGateway initialization/wiring from the monolith.
Add a NotificationsPublisher that subscribes to the existing EventsBusService and publishes a broker envelope for each event that used to be emitted to sockets.
Replace the LiveGraphRuntime direct socket coupling with publishing the same node_status events via the publisher.
Broker envelope (internal, not visible to UI) can be a thin wrapper:
User Request
We are extracting real-time notifications from the monolith into a dedicated notifications-gateway service.
Constraints:
/socket.ioto the new notifications-gateway and/apito platform-server.docker-compose.e2e.ymlthat brings up our services for end-to-end testing.Specification (from research)
Current monolith behavior (to be replicated):
packages/platform-server/src/gateway/graph.socket.gateway.ts(default namespace, path/socket.io, websocket-only). Clients join rooms via asubscribeevent; no server-side unsubscribe.graph,threads, and entity rooms:node:<id>,thread:<id>,run:<id>.EventsBusService(in-process EventEmitter) →GraphSocketGatewayemit to rooms. There is also aLiveGraphRuntimedirect subscription emittingnode_status.Target architecture & scope for this PR:
packages/notifications-gateway:/socket.io(default namespace, websocket-only).notifications.v1.NotificationsPublisherthat subscribes to the existingEventsBusServiceand publishes a broker envelope for each event that used to be emitted to sockets.LiveGraphRuntimedirect socket coupling with publishing the samenode_statusevents via the publisher./socket.ioto the notifications-gateway with WebSocket upgrade and long idle timeout./apito platform-server.Deliverables:
packages/notifications-gateway/subscribebehavior and validation.packages/platform-server/src/index.ts: removeGraphSocketGatewayinit (and any related wiring).packages/platform-server/src/notifications/notifications.publisher.ts: publish all current socket events fromEventsBusServiceto Redis.attachRuntimeSubscriptions()usage to publishnode_statusto Redis rather than emitting directly.packages/platform-server/src/gateway/graph.socket.gateway.tsusage (delete if not referenced by tests).platform-serverandnotifications-gateway./socket.io→notifications-gateway,/api→platform-server./socket.io.Acceptance Criteria:
/socket.iothrough Envoy when notifications-gateway is running.Notes/Out of Scope: