Commit dc72447
committed
fix(opencode): clean up SSE heartbeat on server-initiated stream close
clearInterval(heartbeat) and unsub() only run inside stream.onAbort(),
which Hono only fires on client disconnect. When the server closes the
stream on InstanceDisposed via stream.close(), the interval and bus
subscription leak. Add cleanup before stream.close() in the
InstanceDisposed handler. Both calls are idempotent so the onAbort
fallback for normal client disconnects still works.1 parent ca331e5 commit dc72447
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
| 519 | + | |
518 | 520 | | |
519 | 521 | | |
520 | 522 | | |
| |||
0 commit comments