Docs menu

Upgrading to 0.4

This guide covers moving from 0.3.x to 0.4.0. 0.4 has no breaking changes and no database migrations. Hub sending is new, and it's off unless you turn it on. 0.3 SDKs keep working against a 0.4 server, and a 0.4 @dotwire/client with hubSend: true falls back to REST against a 0.3 server.

Run the server at 0.4.3, the latest 0.4 release. 0.4.2 and 0.4.3 have no breaking changes. 0.4.1 is a server-only fix release on top of 0.4.0, with no config changes. It speeds up an auth query and raises the listen backlog to 65,535. In benchmarks on the same hardware, p99 at 5,000 msg/s dropped from ~110 ms to ~25 ms, and p99 with 50,000 connections dropped by ~30%.

What's new

AreaIn 0.4.0What to do
Hub sendsWith Dotwire__HubSend__Enabled=true, members can send over their existing hub connection with the Send method, instead of a separate REST request. Validation, presend and postsend webhooks, and idempotency keys behave as on REST. See Hub events.Optional. Turn it on on All and Gateway nodes, then set hubSend: true on @dotwire/client.
Send rate limitWith hub sends on, REST sends and hub Send share one per-user send bucket on each node. REST still answers 429 with Retry-After. Hub Send fails with RateLimited.Nothing, unless clients send over both paths at once. Then raise Dotwire__RateLimits__Send__*.
Hub send authorizationHub Send is authorized by the connection's live subscription, like Typing. A membership revocation stops it at once. A role change stops it at the next sweep, within Dotwire__MembershipSweepSeconds (60 by default). REST still checks on every request.If you need role changes to apply faster, lower the sweep interval, or leave hub sends off.
GatewaysWith hub sends on, gateway nodes publish to JetStream and call your presend and postsend webhooks.Make sure gateways can reach your webhook URLs. See Deployment.
Read poolcompose.yaml sets Minimum Pool Size=20;Maximum Pool Size=100 on ConnectionStrings__PostgresRead. On startup, each node opens its minimum read connections, waiting up to 5 seconds, and logs a warning if it can't open them all.If you run your own config, size the pool for your node count against Postgres max_connections.
Room access checksThe role cross-check and the membership check on room routes now run as one query. Responses are unchanged: 403 for a role mismatch or non-member, 404 for a malformed room id.Nothing.

Rollout order

  1. Roll the server nodes to 0.4.3. Leave Dotwire__HubSend__Enabled unset.
  2. Roll host applications and browser clients on the 0.4.3 SDKs. Nothing changes until you opt in.
  3. To use hub sends, set Dotwire__HubSend__Enabled=true on every All and Gateway node, then ship clients with hubSend: true. Clients that reach a node without it fall back to REST.

To roll back, unset Dotwire__HubSend__Enabled. Clients fall back to REST on their next send.