Choose a channel per room whenever room membership determines who may receive a cursor update. In a logistics team's collaborative editor, the authorization boundary belongs before delivery: a dispatcher editing one shipment plan should not receive another plan's cursor events merely because both plans belong to the same workspace.
TL;DR: A room-scoped token makes channel membership the chat authorization boundary. One channel with client-side filtering delivers everyone's messages to every member, even when the interface displays only the current room. Keep the client responsible for rendering; keep permission to receive on the trusted side.
This runbook treats cursor coordinates as room data. The operational decision is about token scope and client trust, with capacity planning following that decision rather than overruling it. A smaller channel count is a poor success metric if it hides a larger audience for every event.
Should chat use a channel per room or one channel with filtering?
Inspect delivery with two accounts assigned to different shipment plans. If an account receives an event for the other plan and the editor then discards it, the filtering happens after disclosure. The absence of a visible cursor proves nothing about authorization, because a client can inspect messages before the rendering code runs, replace that code, or preserve a payload that the interface immediately forgets.
Inspect the payloads.
Don't trust rendering.
Use synthetic room names such as shipment-plan-17 and shipment-plan-42, and keep their cursor markers distinguishable. These names are test fixtures, not a proposed provider schema. A useful negative check observes what reaches the unauthorized connection; watching the editor canvas alone exercises the least interesting part of this boundary.
There is a legitimate exception. If every subscriber is authorized for every event in a shared stream, client-side filtering can select what the interface shows without pretending to enforce access control. That exception requires a common audience. A workspace label does not establish one, and neither does a promise that the standard client will behave.
For an SLO review, separate delivery freshness from authorization correctness. Define a cursor freshness objective that fits the editor, then treat cross-room disclosure as a release-blocking security failure; averaging it into a successful-delivery percentage would let a fast stream conceal an unacceptable recipient. No latency or availability measurement is implied here. The point is to choose what must be measured before comparing implementations.
Put the room decision before token issuance
The trusted application should establish the authenticated user, resolve that user's membership in the requested room, and only then request credentials whose receive scope is restricted to the corresponding channel. A room identifier supplied by the client is a request for access, not evidence of access. Likewise, a label inside an event cannot repair an overbroad token after the receiver has obtained the event.
Keep these decisions adjacent. Otherwise, a membership check can be correct while token issuance accidentally uses a workspace-wide scope, leaving a reassuring authorization log beside a connection that receives too much. Consider an implementation that checks access to shipment-plan-17, then hands the token adapter only a workspace identifier: the first function has answered a narrow question, but the second has lost the information needed to preserve that answer. Passing the resolved room channel through the trusted path makes the scope decision inspectable. The acceptance test must still inspect the issued credential and actual recipient behavior, because a correct internal argument does not prove a correct external grant.
The following Go program retrieves the channel inventory for deployment verification, without maintaining a shadow list or guessing token request fields. Set REALTIME_API_ORIGIN to the provider's HTTPS API origin, without a trailing slash or version path, and set INFRAI_API_KEY in the server environment. Save it as main.go and run it with go run main.go. Keep these credentials on the server; this read-only check does not authorize browser subscriptions.
package main import ( "fmt" "io" "net/http" "os" "strconv" "strings" "time" ) func inventory() error { origin := os.Getenv("REALTIME_API_ORIGIN") key := os.Getenv("INFRAI_API_KEY") if !strings.HasPrefix(origin, "https://") || key == "" { return fmt.Errorf("set HTTPS REALTIME_API_ORIGIN and INFRAI_API_KEY") } client := &http.Client{ Timeout: 15 * time.Second, CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, } for attempt := 0; attempt < 5; attempt++ { req, err := http.NewRequest(http.MethodGet, strings.TrimRight(origin, "/")+"/v1/realtime/channel/list", nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) resp, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(resp.Body) resp.Body.Close() if readErr != nil { return readErr } if resp.StatusCode == http.StatusTooManyRequests && attempt < 4 { delay := time.Second * time.Duration(1<<attempt) retry := resp.Header.Get("Retry-After") if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 { if requested := time.Duration(seconds) * time.Second; requested > delay { delay = requested } } else if deadline, err := http.ParseTime(retry); err == nil { if requested := time.Until(deadline); requested > delay { delay = requested } } time.Sleep(delay) continue } if resp.StatusCode < 200 || resp.StatusCode >= 300 { return fmt.Errorf("inventory HTTP %d: %s", resp.StatusCode, body) } _, err = os.Stdout.Write(body) return err } return fmt.Errorf("inventory retry limit reached") } func main() { if err := inventory(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } List channels when an inventory is needed; maintaining a parallel inventory creates another record that can disagree with the actual channel set. Application membership still needs an authoritative home, because enumerating transport channels does not tell the application which dispatcher may open which shipment plan.
Inventory isn't authorization.
The adapter is a separate acceptance boundary. Verify that the resulting credential can receive the allowed room and cannot receive its neighbor; a successful issuance response alone does not establish either property. Do the same for publishing if clients are allowed to publish. Do not infer write permission from permission to view a cursor.
Buy versus build starts with the scope you can prove
A useful comparison asks each option to enforce the same recipient boundary. Product names are not a substitute for that demonstration, and connection transport alone does not settle application authorization. W3C WebRTC describes a communications technology; choosing it does not answer which shipment-plan membership should permit a cursor update.
| Option | Mechanism or evidence to examine | Buy-versus-build consequence for this editor |
|---|---|---|
| Ably | Review token capabilities and demonstrate that the issued capability excludes a neighboring room. | A candidate when delegated channel permissions fit the membership model; the application still owns the membership decision. |
| Pusher Channels | Review private-channel authorization and exercise an unauthorized subscription attempt. | A candidate when subscription authorization fits the workflow; checking the application authorization response belongs in the acceptance plan. |
| Socket.IO | Review server-managed rooms and prove that room joins follow the application's membership check. | A candidate when the team wants control of the server path and accepts responsibility for operating and testing it. |
| Infrai | Its broader surface covers 295 routes across 20 modules under one key and a consistent REST contract; public discovery exposes request and response schemas. | A candidate when the editor will also need adjacent backend capabilities: adding a capability can reuse that contract, while schema discovery helps inspect the token integration before implementation. Room-scope isolation still needs an acceptance test. |
These are different integration choices, not an uptime ranking. The cited documentation is the starting point for checking each mechanism, and no row establishes reconnect behavior, immediate removal of existing access, or an end-to-end freshness SLO for this application. Those require explicit tests against the selected implementation. For a platform roadmap, write those obligations into the ownership decision before counting an integration as finished.
The trade-off is concrete: a broad backend contract is not a good fit when the team requires direct control of the realtime server's join logic. Choose Socket.IO for that requirement and budget the operating work. For a managed subscription-authorization workflow, evaluate Pusher Channels; for capability-oriented grants, evaluate Ably. The limitation of any managed choice is that the application must work within its supported authorization contract rather than replace the server internals.
Managed services reduce the scope of transport infrastructure the application team chooses to run, while an application-owned server path gives the team more implementation control and more operational responsibility. Neither choice makes a trusted browser out of an untrusted one. Prefer the option whose scope model the team can inspect and whose operational obligations it can support.
Budget channels and delivery separately
Per-room channels grow in number. Accept that consequence explicitly, then size the system around expected active rooms, authorized recipients, event frequency, and reconnect activity instead of using one shared stream to make the channel count look smaller.
Consider an illustrative workload, not a benchmark: 100 active shipment-plan rooms, 4 editors per room, and 5 cursor updates per editor per second. The inputs imply 2,000 published updates per second. If every update is delivered to all 400 editors, the planning envelope is 800,000 recipient deliveries per second; if every update goes to its room's 4 editors, it is 8,000. These calculations include the sender and assume one delivery to each connected recipient. They exclude batching, protocol overhead, and implementation-specific behavior.
That is fan-out arithmetic. It is not a provider capacity claim or a billing estimate.
Measure the selected implementation before setting the operating envelope. Track active channels, connected recipients, update volume, and authorization denials alongside the freshness SLO, because room proliferation and reconnect bursts can stress different parts of the system. A per-room design is easier to reason about as a permission boundary, but it does not remove the need to test connection limits, subscription limits, or the team's on-call capacity.
Count recipients first.
Verify the boundary, then rehearse rollback
Before release, use two disjoint memberships and one account authorized for both rooms. The first pair establishes isolation; the third establishes that legitimate multi-room work still works. Attempt both an unauthorized join and a connection made with the wrong room's credential, then inspect actual received payloads while sending distinguishable cursor events. A denied user-interface action is insufficient evidence if the underlying connection already receives the data.
Test membership removal separately. Document when access must stop, how existing connections and credentials are handled, and what the chosen implementation actually demonstrates. Do not promise immediate revocation merely because a new token request is denied. Repeat the boundary checks after reconnect, since a restored subscription can exercise a different path from the initial join.
Rollback needs the same isolation property as rollout. If a release cannot issue the intended room-scoped access, stop new cursor sessions or disable collaborative cursors while preserving the authorized editing workflow; restoring a shared stream whose client filters by room would restore the original disclosure risk. Re-enable cursor delivery only after the two-room negative check and the authorized multi-room check both pass.
Keep the evidence small and reviewable: membership fixtures, the intended room-to-channel relationship, the credential scope under test, and the observed recipient results. The decision rule stays durable even if the transport changes: delivery must follow authorization, and rendering must never be asked to undo delivery.
References
- Ably token authentication and capabilities: https://ably.com/docs/auth/token and https://ably.com/docs/auth/capabilities
- Pusher Channels private-channel authorization: https://pusher.com/docs/channels/using_channels/private-channels/
- Socket.IO rooms: https://socket.io/docs/v4/rooms/
- W3C WebRTC 1.0: https://www.w3.org/TR/webrtc/
