Fix SSE ping heartbeat message format

This commit is contained in:
Chris Wanstrath 2026-04-04 19:36:28 -07:00
parent cf018004a2
commit 99492a35e8

View File

@ -12,7 +12,7 @@ router.sse('/stream', (send) => {
queue = queue.then(() => send(...args))
}
const unsub = onEvent(event => safeSend(event))
const heartbeat = setInterval(() => safeSend('', 'ping'), 60_000)
const heartbeat = setInterval(() => safeSend({ type: 'ping' }, 'ping'), 60_000)
return () => {
clearInterval(heartbeat)
unsub()