stream-worker: honest comment on heartbeat catch (argus nit on #529)

argus pointed out the inline catch comment claimed dead ports get cleaned up on
next subscribe, but nothing actually prunes the allPorts Set on subscribe — the
honest answer is the one already at the bottom of onconnect: dead entries are
left in the Set, the bound cost is acceptable, and postMessage's throw is the
ambient signal we use. Point at that comment instead of repeating a wrong
description.
This commit is contained in:
iris 2026-05-27 23:40:38 +02:00
commit 88476976b7

View file

@ -59,7 +59,7 @@ const PING_INTERVAL_MS = 30_000;
setInterval(() => {
for (const port of allPorts) {
try { port.postMessage({ kind: 'ping' }); }
catch { /* port dead — cleanup happens lazily on next subscribe */ }
catch { /* port dead — left in the Set; see onconnect's closing comment */ }
}
}, PING_INTERVAL_MS);