v0.1.23 — perf: replace SSE 3s polling with Postgres LISTEN/NOTIFY + 10s fallback
Release v0.1.24: SSE Pipeline Monitoring Now Uses Postgres LISTEN/NOTIFY
What changed
- Replaced 3-second polling with Postgres LISTEN/NOTIFY — Pipeline SSE connections now receive real-time updates via database triggers instead of continuous polling.
- 10-second fallback poll — A coarse fallback continues running in parallel as a safety net for missed notifications or LISTEN setup failures.
- Added database triggers — Two triggers on
pipeline_runsandagent_jobstables automatically fireNOTIFYon insert or update, with zero code changes required to existing agents. - Improved SSE stream route — Rewritten to establish a WebSocket-backed LISTEN connection and gracefully degrade to polling if needed.
Why it matters
SSE connections were generating ~2,000 database queries per minute per 100 idle users. LISTEN/NOTIFY reduces that by ~90% during active pipeline runs — down to 1–2 queries per actual state change instead of every 3 seconds. Update latency drops from up to 3 seconds to sub-second.
Technical notes
- New file:
src/lib/pipeline-notify.ts— utilities for creating a LISTEN client and firing NOTIFYs - New migration:
0018_pipeline_notify_triggers.sql— creates the trigger function and two event triggers - The LISTEN connection uses Node 22's native
globalThis.WebSocketvia Neon's serverlessClient - If LISTEN setup fails, the stream continues via fallback polling — no user-facing degradation
Release Notes
The tag v0.1.23 already exists in the repository. The PR has been successfully merged (commit 70bb63e), but a release with that tag was already created previously — trying to create a duplicate tag will always be rejected by GitHub.
Here's a summary of what happened and your options:
✅ Merge — Succeeded
- PR #432 (
perf: replace SSE 3s polling with Postgres LISTEN/NOTIFY + 10s fallback) was squash-merged intomain. - Merge commit:
70bb63e4afc27a20f2b39a19bfb1c3736aa06a48
❌ Release — Tag v0.1.23 Already Exists
GitHub rejected the release creation because the tag v0.1.23 is already present in the repo. This could mean:
- A prior release
v0.1.23was already published (possibly in error, or for a different set of changes). - The tag was created manually on a previous commit.
What You Can Do Next
Please choose one of the following:
| Option | Description |
|---|---|
Use v0.1.24 | Bump to the next patch version and I'll create the release immediately. |
Delete the existing v0.1.23 tag | If the old tag was created in error, delete it from GitHub first, then I can re-create it. |
| Attach to existing release | If v0.1.23 was already drafted/published, the PR changes can be noted in its release body manually. |
Would you like me to proceed with v0.1.24 as the release tag?