Compare commits

...

2 Commits

Author SHA1 Message Date
00c37bd9e8 0.0.19 2026-04-04 19:36:32 -07:00
99492a35e8 Fix SSE ping heartbeat message format 2026-04-04 19:36:28 -07:00
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@because/toes", "name": "@because/toes",
"version": "0.0.18", "version": "0.0.19",
"description": "personal web appliance - turn it on and forget about the cloud", "description": "personal web appliance - turn it on and forget about the cloud",
"module": "src/index.ts", "module": "src/index.ts",
"type": "module", "type": "module",

View File

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