Skip to content

Targeting and delivery

These rules are not wire format, but conforming server implementations MUST follow them, because clients depend on them.

Servers MUST support sending notifications (NOTIFY) and datagrams to:

Target Recipients
All Every session on the endpoint
Session(id) / Sessions(ids) Specific sessions
User(id) / Users(ids) Every session whose principal has that user ID
Group(name) / Groups(names) Every session in the group(s)
Any of the above with Except(session ids) Minus the listed sessions
  • A session matching a target through several routes receives the message once.
  • Unknown session IDs, users or groups are silently skipped.
  • Notifications sent to detached sessions (§7.8) are buffered for replay; datagrams sent to detached sessions, or to sessions without capability datagrams, are dropped; sends to ended sessions are no-ops.
  • Server-initiated calls (§8.8) target exactly one session; a call to an unknown or ended session fails with NOT_FOUND (§8.8). Servers MAY offer a fan-out helper that issues one call per session and aggregates results; on the wire these are independent calls.
  • Add/remove a session to/from a named group; both idempotent. Names are case-sensitive. A successful add or remove is visible to every send issued after it returns.
  • Membership is per session, non-durable, and cleared when the session ends (not when it detaches).
  • Group operations MUST work for sessions on other nodes in multi-node deployments.
  • A session has at most one user ID, derived from its principal. Anonymous sessions have none and are never matched by User targets.
  • A user may have any number of sessions.
  • On connect runs after authentication and before WELCOME is sent, within the handshake timeout (§7.1). It may reject the session (REJECT with FORBIDDEN or another code). It may join groups; those joins take effect when WELCOME is sent, together with the session’s registration, and never take effect if the session is rejected. Sends issued before WELCOME do not reach the session.
  • On disconnect runs exactly once, when the session ends (CLOSE in either direction, transport loss or idle timeout without resumption, resume_window expiry, or early eviction under the detached-session cap, §7.8), not on transport loss that is later resumed.
  • Hooks do not run on resumption.
  • Each session has a bounded outbound queue for stream 0 (default 1 MiB), including notifications, channel frames and emulated datagrams. The queue’s threshold is its bound.
  • Frames in the queue have not been written to the transport, so under resumption they carry no seq yet (§7.8) and dropping one leaves no seq hole.
  • Datagrams are dropped first when the queue is over its bound.
  • Lossy-with-recovery for history channels: when the queue is over its bound, the server SHOULD next drop the session’s pending PUBLICATION frames for channels with history and send UNSUBSCRIBED {code: 2} for those channels (§10.3); the client resubscribes with since and catches up from history at its own pace.
  • Frames without a recovery path (notifications, publications on channels without history, other control-stream frames) are never dropped from the queue: while it is over its bound they are still queued, up to a hard cap (default 2 × the bound). Reaching the hard cap, or staying over the bound beyond a configurable grace period (default 5 s), closes the session with SLOW_CONSUMER (no resumption).
  • The replay buffer under resumption applies the recoverable-first order of §7.8.
  • A slow session MUST NOT delay delivery to other sessions.
  • PING/PONG and CLOSE bypass the queue limit.

A message sent to many sessions SHOULD be encoded once per codec, with only the per-session header fields (seq) differing. This is why data sections are separate from headers (§5.2). A NOTIFY to any target but Session(id) whose arguments a codec the endpoint offers (§13.8) cannot encode is refused by the entry rule of §12.3, even when every recipient uses cbor.

Kind Guarantee
Call Exactly one terminal outcome per call (RESULT/END or ERROR), or local UNAVAILABLE on transport loss
Notification At-most-once; with resumption, exactly-once and ordered per lane within the session lifetime
Publication As notification, plus gapless recovery by (epoch, offset) when history is enabled
Presence Eventually consistent; snapshot + deltas
Datagram Best effort; may be lost or reordered (WT); never replayed; latest topics deliver monotonically increasing seq
  • Ownership. A session is owned by the node that accepted its transport. Ownership moves only by takeover: when a resume (§7.8) arrives at a node that does not own the session, that node locates the owner by the session ID in the resume map and asks the owner for it. The owner MUST either hand over the complete detached state (principal, granted capabilities, groups, subscriptions, datagram key-to-name bindings, sequence positions and replay buffer) and stop acting for the session, forwarding anything that still arrives to the new owner, or refuse, in which case the resume is answered REJECT RESUME_FAILED. A node MUST NOT act for a session it has handed over. If the owner cannot be reached within the takeover timeout (default 2 s, §16), the resume is answered REJECT RESUME_FAILED and the client starts a new session; channel recovery (§10.5) covers what resumption could not.

  • Backplane outage. While a node cannot reach the backplane it MUST keep serving the sessions it owns and MUST fail what it cannot complete instead of queuing it:

    • A send whose target may include sessions on other nodes fails with UNAVAILABLE and is delivered to no session, local ones included, so a retry never duplicates a delivery.
    • Publications on channels whose sequencer (§10.5) is on another node fail with UNAVAILABLE, because no offset can be assigned.
    • Server-initiated calls to sessions on other nodes fail with UNAVAILABLE and nx: true.
    • Group operations on sessions owned by other nodes fail with UNAVAILABLE.
    • Calls carrying pavia-idempotency-key on a session with capability idempotency fail with ERROR UNAVAILABLE and nx: true when the idempotency store is unreachable; the handler never runs without the duplicate check (§8.7).
    • SUBSCRIBE with since fails with REQUEST_ERROR UNAVAILABLE when history cannot be read.
    • SUBSCRIBE without since to a channel whose sequencer is on another node fails with REQUEST_ERROR UNAVAILABLE, because SUBSCRIBED needs the channel’s current offset (§10.2).

    When the backplane is reachable again the node MUST send UNSUBSCRIBED {code: 2} (§10.3) to every local subscriber of a channel whose sequencer is on another node and MUST re-announce presence for its sessions. Notifications published by other nodes during the outage are not recovered (§13.7). If an outage outlasts the presence lease, other nodes report the node’s members as left and the re-announce reports them as joined again; presence converges (§10.6).

  • Codecs. All nodes of one endpoint MUST offer the same codecs, because a resumed or taken-over session keeps the codec it negotiated (§7.8), whichever node serves it next. The entry rule (§12.3) then checks data against every codec the endpoint offers, so a value one node admits encodes on all of them.


From the specification: §13.1, §13.2, §13.3, §13.4, §13.5, §13.6, §13.7, §13.8.