testing generic deploy

This commit is contained in:
Devin Zuczek
2026-06-29 21:52:50 -04:00
parent 3affabd280
commit 69b89e2dc4
79 changed files with 399 additions and 307 deletions
+6 -9
View File
@@ -1,13 +1,11 @@
# notify
Notifications Worker served at `notify.rec.djdevin.net`. Ported from the C#
`NotifyController` / `NotificationsHub` / `NotificationService`, which host a
SignalR hub at `/hub/v1`.
Notifications Worker served on the `notify` subdomain. Hosts a SignalR hub at
`/hub/v1`.
The hub is implemented as a **Durable Object** (`NotificationsHub`) speaking the
SignalR JSON Hub Protocol over a hibernatable WebSocket. A single global DO
instance plays the role of the C# static dictionaries (one shared process across
all connections).
instance holds the shared hub state (one process across all connections).
## Endpoints
@@ -27,8 +25,7 @@ all connections).
1. Client `POST /hub/v1/negotiate`, then opens a WebSocket to `/hub/v1?id=<token>`.
2. Handshake: client sends `{"protocol":"json","version":1}␞`, server replies
`{}␞` (`␞` = record separator `0x1e`).
3. Server immediately sends the `OnConnect` invocation (mirrors the C#
`OnConnectedAsync`).
3. Server immediately sends the `OnConnect` invocation on connect.
4. Client→server invocations:
- `SubscribeToPlayers({ playerIds })` — replaces this connection's
subscriptions and flushes any queued notifications for those players.
@@ -42,11 +39,11 @@ all connections).
Held in the DO's SQLite so it survives hibernation:
- `subscriptions(connectionId, playerId)` — serves both the connection→players
and player→connections lookups from the C#.
and player→connections lookups.
- `pending(id, playerId, payload)` — per-player queue delivered once the player
subscribes.
A connection's rows are removed on `webSocketClose` (the C# `OnDisconnected`).
A connection's rows are removed on `webSocketClose`.
## TODO before production