mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 15:20:00 -07:00
Fix satellite dashboard page never loading by sending immediate SSE keepalive
Werkzeug's dev server buffers SSE response headers until the first body byte is written. With keepalive_interval=30s, opening two SSE connections on DOMContentLoaded (satellite stream + new ground station stream) meant the browser waited 30 seconds before receiving any response bytes from either connection. Browsers keep their loading indicator active while connections are pending, causing the satellite dashboard to appear stuck loading. Fix: yield an immediate keepalive at the start of sse_stream_fanout so every SSE endpoint flushes headers + first data to the browser instantly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,10 @@ def sse_stream_fanout(
|
||||
)
|
||||
last_keepalive = time.time()
|
||||
|
||||
# Send an immediate keepalive so the browser receives response headers
|
||||
# right away (Werkzeug dev server buffers headers until first body byte).
|
||||
yield format_sse({'type': 'keepalive'})
|
||||
|
||||
try:
|
||||
while True:
|
||||
if stop_check and stop_check():
|
||||
|
||||
Reference in New Issue
Block a user