Skip to content

spike: Hold a Neon LISTEN session over a Preview SSE stream - #4194

Closed
sentry-junior[bot] wants to merge 6 commits into
mainfrom
spike/versions-listen
Closed

sentry-junior[bot] wants to merge 6 commits into
mainfrom
spike/versions-listen

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Throwaway spike for #3776. Do not merge. It is closed when the spike ends.

It proves whether one Vercel function can hold a Postgres LISTEN session on the direct (non--pooler) Neon endpoint for a full SSE stream and get NOTIFY from another connection.

apps/example/spike-versions-listen.ts adds three GET routes in front of the example app. They run only when VERCEL_ENV is preview, and every other environment gets a 404. Vercel deployment protection gates the Preview URL.

  • /__spike/versions-listen/stream: LISTEN on junior_spike_versions_listen over the direct URL. Streams each notification as SSE, runs SELECT 1 every 15 s with a 5 s timeout, and ends at 285 s. It closes the session when the stream ends. At most 4 streams per instance.
  • /__spike/versions-listen/notify: pg_notify on that channel over the pooled HTTP driver.
  • /__spike/versions-listen/stats: backend counts from pg_stat_activity, max_connections, and pg_postmaster_start_time().

It reads and writes no tables and adds no migrations or triggers. It adds @neondatabase/serverless to the example app, so the lockfile changes.

Open decision

via @BYK.

--

View Session [Sentry]

Throwaway spike for #3776. Do not merge.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 24, 2026 2:19pm UTC
junior-example Ready Ready Preview Nov 24, 2026 2:19pm UTC

Request Review

Comment thread apps/example/server.ts Resolved
Comment thread apps/example/spike-versions-listen.ts Resolved
@blacksmith-sh

This comment has been minimized.

Previews have no Junior secrets, so skip junior upgrade and createApp there.

Co-Authored-By: BYK <[email protected]>
Comment thread apps/example/server.ts Resolved
Previews have no Junior secrets, so they build only the spike routes,
without juniorNitro or junior snapshot create.

Co-Authored-By: BYK <[email protected]>
nitro.config.ts imports @sentry/junior/nitro, so its dist must exist.

Co-Authored-By: BYK <[email protected]>

This branch was successfully deployed

2 active deployments
Preview – junior-example — 29fbfbd7 Deployed Nov 24, 2026 by vercel[bot]
Preview – junior-docs — 29fbfbd7 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant