Push relay: answer the browser before Stalwart does #72

Merged
jcoffey-dev merged 1 commits from fix/relay-headers-now into main 2026-11-14 21:40:01 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 3ad9e2e967 Push relay: answer the browser before Stalwart does (#71)
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / stalwart (stalwartlabs/stalwart@sha256:baafeacd6cbde77acdd94af49972d41c6709e54a376df48e18a9fe3f445eb3d5, 1.0.0) (pull_request) Skipped
ci / stalwart (stalwartlabs/stalwart@sha256:c429b311c93db5606598abc1c68225a85a6953183848ae01bee9c6a98885836c, 0.16.27) (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m46s
Stalwart sends nothing on its event stream, not even response headers,
until its first ping, 30 seconds in. The relay waited for that before
answering the browser, so the live-updates dot showed "reconnecting" for
half a minute on every connect, and a proxy that gives up on a response
that slow kept it there for good.

This matters more since Stalwart 1.x refuses to push to private
addresses: a subscription to an ihasmail on a private network never
verifies, so every tab is on the relay. Both relay paths now send their
headers and a comment line at once, and end the stream if the upstream
fails.
2026-11-14 14:36:53 -07:00