You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Splits the all-in-one @sse annotation into two independent halves so a
routine can be a publisher OR a subscriber without being forced into
both. Fully back-compat — existing @sse keeps both halves.
@sse_publish - this routine's RAISE feeds the SSE broadcaster;
no subscribe URL exposed (cleans up phantom /info
URLs on emitter procedures + drops unused
createXEventSource helpers from the TS client).
@sse_subscribe - exposes a subscribe URL for EventSource clients;
routine body is never executed when a client opens
the stream.
@sse [path] - shorthand for both; unchanged.
Adds a runtime warning when a RAISE whose severity matches the
configured SSE forwarding level fires in a routine that has no @sse or
@sse_publish — kills the silent-emitter footgun where forgetting the
annotation produces no error and no event delivery. Once-per-endpoint
dedupe; gated on the project actually using SSE somewhere; configurable
via the new WarnUnboundServerSentEventsNotices setting (default true).
Adds a "connected" handshake flush so SSE clients learn the connection
is established before any real event fires — makes "subscribe then
publish" sequencing reliable.
12 new tests including a reusable SseTestClient streaming-HTTP helper
that opens a connection, waits for the broadcaster to register the
subscriber, then reads events. End-to-end live delivery test verifies
RAISE in a publish-only procedure reaches a subscriber connected
through a separate subscribe-only procedure's URL.
1949/1949 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: NpgsqlRest/Log.cs
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -334,4 +334,7 @@ public static partial class Log
334
334
335
335
[LoggerMessage(Level=LogLevel.Warning,Message="Endpoint {path} parameter {paramName} received a {source} value but is auto-bound from claim '{claimName}'. The supplied value is being ignored.")]
[LoggerMessage(Level=LogLevel.Warning,Message="RAISE {severity} in endpoint {path} was not broadcast to SSE subscribers — the endpoint has no @sse or @sse_publish annotation. Add @sse_publish to forward this routine's notices, or set NpgsqlRestOptions.WarnUnboundSseNotices=false to silence this warning.")]
Copy file name to clipboardExpand all lines: NpgsqlRest/Options/NpgsqlRestOptions.cs
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -368,6 +368,15 @@ public NpgsqlRestOptions(NpgsqlDataSource dataSource)
368
368
/// Collection of custom server-sent events response headers that will be added to the response when connected to the endpoint that is configured to return server-sent events.
0 commit comments