Upgrading to 0.3
This guide covers moving from 0.2.x to 0.3.0. The server image, Dotwire.Host, @dotwire/client, @dotwire/host and @dotwire/react all move to 0.3.0 together. A 0.2 SDK against a 0.3 server isn't supported.
Breaking changes
| Area | In 0.3.0 | What to do |
|---|---|---|
| Webhook signing | The host SDK webhook handlers throw unless WebhookSecret / webhookSecret is set. Calls are verified with X-Dotwire-Signature-V2, an HMAC of "<X-Dotwire-Timestamp>.<body>". Timestamps older than five minutes and bodies over 1 MiB are rejected. | Set the same secret on the server (Dotwire__Webhooks__Secret) and the host SDK, or opt out with AllowUnsignedWebhooks = true / allowUnsignedWebhooks: true. Pass the new headers to the handlers. The old body-only X-Dotwire-Signature needs AllowLegacyWebhookSignatures / allowLegacyWebhookSignatures. In .NET, the old HandlePresendWebhookAsync(body, signatureHeader) overload still compiles but answers 401 to every call, so switch to the WebhookHeaders overload. See Moderation webhooks. |
| Webhook URLs | The server refuses http webhook URLs except on loopback. The post-send queue defaults to 1,000 items and 64 MiB (was 10,000 items). | Use https, or set Dotwire__Webhooks__AllowInsecureUrls=true. Raise QueueCapacity / MaxQueueBytes if you relied on the old depth. |
| Token lifetime | iat is required and can't be in the future. exp - iat can't exceed Auth__MaxTokenLifetimeMinutes (default 60). | Mint shorter tokens, or raise the cap. 0 disables it. |
| Keys | Auth__Keys__<kid> must be a public-key PEM of at least 2048-bit RSA. A private key fails startup. JWKS URLs must be https. | Check your key config before rolling. For a local http JWKS endpoint, set Auth__AllowInsecureJwksUrl=true. |
| Query-string tokens | ?access_token= is accepted only on GET /hub/rooms and GET /rooms/{uuid}/events, and only when no Authorization header is present. | Send tokens in the Authorization header everywhere else. |
| CORS | 0.2 reflected any origin and allowed credentials. 0.3 allows the origins in Cors__AllowedOrigins__<n> (any origin when none are set) and never allows credentials. | The default @dotwire/client transport, 'websockets', is unaffected. With transport: 'negotiate' on a cross-origin page, the negotiate request carries credentials and is blocked, so switch back to 'websockets'. Set the allowlist before exposing dotwire. |
| Role changes | An admin can't change their own role (409 self_role_change) or remove the last admin (409 last_admin). | Update any admin tooling that did either. |
| Compose | Port 8080 binds to 127.0.0.1. compose.multinode.yaml needs NATS_USER, NATS_PASSWORD, POSTGRES_REPLICATION_PASSWORD and HAPROXY_STATS_PASSWORD in .env. Images are pinned, and DOTWIRE_VERSION defaults to 0.3.0. NATS moves from 2.10 to 2.15.1, and compose.yaml adds a short-lived nats-init service that hands a fresh NATS volume to the user NATS runs as. | Put TLS in front before exposing dotwire, and fill in .env. |
| Node | The npm packages require Node 22 or newer (was 20). | Upgrade your runtime. |
| Room ids | The Node host SDK throws a TypeError on a room id that isn't a UUID. | Use UUIDs. |
React send | A failed useRoom().send() rejects its promise and leaves status and error unchanged. In 0.2 it also set status to 'error'. | Catch the rejection where you call send. Anything that watched status for send failures no longer sees them. |
IDotwireHostClient | Gains SendAsUserAsync(..., idempotencyKey, ct) and the WebhookHeaders overloads of both webhook handlers. | Add them to any fake or custom implementation. |
The hub was already WebSockets-only in 0.2.1, and hub and SSE connections already closed when the token expired. Neither is a change.
New defaults to know about
- Limits: 256 KiB request bodies (
413above it), 100 hub plus SSE connections per user (a hub connection is refused and SSE answers429above it), 1,000 SSE replay rows per resume, and a per-IP bucket for unauthenticated requests (Dotwire__RateLimits__Unauthenticated__*). - Hub connects now count against the
readrate-limit bucket. - The
hubrate-limit bucket (SubscribeandUnsubscribe) is keyed per user instead of per connection. A user with many tabs open shares one budget across them. RaiseDotwire__RateLimits__Hub__*if clients subscribe to many rooms at once. Dotwire__MembershipSweepSeconds(default 60) re-checks live subscriptions against current roles and membership.- New messages use encryption envelope v1: a per-message key derived with HKDF, and associated data that binds the ciphertext to its room, sender and key id. Older envelopes still decrypt while
Dotwire__Encryption__AllowLegacyEnvelopesistrue(the default). Set it tofalseonce every pre-0.3 row has aged out of Postgres and JetStream. See Encryption and retention. - Sends accept an optional idempotency key: the
Idempotency-Keyheader, oridempotencyKeyin the SDKs.
See the configuration reference for every option.
Database
Migration 0009_audit_integrity.sql runs on the migrating node at startup. It adds a unique index on audit_log.prev_hash, a stream_time column and a checkpoint validation trigger. Back up Postgres first.
Rollout order
- Back up Postgres.
- Update
.envand your config for the table above. - Roll the migrating node, then the remaining nodes. See Deployment.
- Roll host applications on the 0.3.0 SDKs, with webhook secrets set. See Moderation webhooks.
- Roll browser clients.