PAGI::Server 0.002007: One Contract, Two Transports
Introduction PAGI::Server 0.002007 is the largest release of the server since the distribution split. Almost none of it is new features. Instead, it is the result of a systematic conformance pass: every behavior the PAGI specification describes was checked against what the server actually does, on both HTTP/1.1 and HTTP/2, and every divergence was resolved — in the server, or occasionally in the…
PAGI::Server 0.002007 is the latest release of the server since the distribution split. The update focuses on fixing issues and ensuring consistency in how the server handles different transports, such as HTTP/1.1 and HTTP/2. The primary goal is to provide a more robust and stable reference implementation for the PAGI specification.
One of the main changes in this release is mandatory event validation. Previously, there was an option to turn validation on or off depending on the environment (development or production). However, the conformance pass has eliminated this distinction. Now, all five send paths - HTTP/1.1, HTTP/2, WebSocket, Server-Sent Events (SSE), and lifespan - require event validation.
This means that malformed events, unknown event types, events for extensions that the server does not advertise, and mis-sequenced events will now fail the $send Future everywhere. This change enforces the correct sequence of events and helps prevent issues that arise later in the connection, such as hung clients or corrupted responses.
Another significant improvement is the normalization of the WebSocket send path. In earlier versions, sending frames directly to nghttp2's submit_data could lead to silent data loss when frames were submitted too close together. The updated server now frames every send through a per-stream FIFO send queue, ensuring that each frame type is included correctly.
This change not only resolves the silent data loss issue but also brings HTTP/2 WebSocket sends in line with other streaming scopes, making the transport surface consistent across different protocol versions.
Finally, the release introduces standardized connection-lifecycle events. The server now uses clear disconnect reason tokens, such as read_error or write_error, for socket errors instead of masking them as a generic client_closed event. Server-initiated teardowns also report their actual cause, such as idle_timeout or keepalive_timeout, rather than using arbitrary strings.
Additionally, disconnect events are now delivered exactly once per scope, ensuring consistency across different transport protocols. These improvements make the application's understanding of connection termination more reliable and predictable.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.