- Reuse or create one anonymous browser session.
- Fetch a preliminary snapshot only to discover the queue UUID.
- Open one deterministic
queue:<uuid>:changeschannel. - Subscribe to
queues.id = <uuid>andqueue_entries.queue_id = <uuid>. - Wait for
SUBSCRIBED. - Fetch and publish a fresh authoritative snapshot.
- Treat later changes as debounced invalidation signals.
This subscribe-then-snapshot publication order prevents an update between initial discovery and live subscription from being missed.
CONNECTING, CONNECTED, RECONNECTING, OFFLINE, and ERROR map to calm readable interface states. Brief channel errors are reconnecting, not alarming failures. The adapter removes its channel and event listeners when the route unmounts.
Queue and entry messages from one transaction can arrive rapidly, so a 75 ms debounce produces one snapshot request. A refresh already in flight queues at most one follow-up. Lower revisions are ignored; equal revisions are ignored during ordinary invalidation; higher revisions replace state. Recovery refreshes may reassert an equal revision but never downgrade. Because every invalidation retrieves full state, detected revision gaps converge without event replay.
- initial
SUBSCRIBED - browser
online - channel resubscription/recovery
- tab visibility return after more than five seconds hidden
- any queue/entry invalidation, including a revision gap
There is no healthy-connection polling, Presence, global schema channel, custom heartbeat write, or private-table subscription.
An online event performs an authoritative refresh before restoring the visible CONNECTED state. A failed refresh remains reconnecting or enters the adapter's error path; network reachability alone is not treated as successful convergence.
A new user intent gets a UUID request ID. Automatic retry must retain that UUID. The RPC validates actor/type reuse, performs its transaction, and returns a snapshot. Buttons show local pending feedback but do not invent an authoritative result. Typed conflicts restore the control and explain the recoverable state. Realtime is confirmation/invalidation; the RPC result may update the UI immediately.
Development-only instrumentation reports sanitized subscription status, refresh reason, and current revision. It never logs access codes, customer names, tokens, or Realtime payloads and is omitted from production mode.