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
Owner

For #71.

Stalwart sends no headers on its event stream until the first ping, 30 seconds in, and the relay waited for that before answering the browser. With Stalwart 1.x refusing to push to private addresses, an ihasmail on a private network has every tab on the relay, so the dot sat on "reconnecting" for at least 30 seconds, and for good behind a proxy that gives up sooner.

Both relay paths now send headers and a : relay comment straight away. Checked end to end against Stalwart 1.0.3 with RAW_PUSH_RELAY on and off; the new test fails on main.

For #71. Stalwart sends no headers on its event stream until the first ping, 30 seconds in, and the relay waited for that before answering the browser. With Stalwart 1.x refusing to push to private addresses, an ihasmail on a private network has every tab on the relay, so the dot sat on "reconnecting" for at least 30 seconds, and for good behind a proxy that gives up sooner. Both relay paths now send headers and a `: relay` comment straight away. Checked end to end against Stalwart 1.0.3 with RAW_PUSH_RELAY on and off; the new test fails on main.
jcoffey-dev added 1 commit 2026-11-14 21:37:07 +00:00
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
3ad9e2e967
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.
jcoffey-dev merged commit c79f0b0b2c into main 2026-11-14 21:40:01 +00:00
jcoffey-dev deleted branch fix/relay-headers-now 2026-11-14 21:40:01 +00:00
Sign in to join this conversation.