subscriptions-transport-sse
subscriptions-transport-sse copied to clipboard
keepalive and reconnects
- It leaks, because of the keepalive setInterval never being cancelled on socket close
- Why is the keepalive needed?
- Why do you close the subscription when the socket closes? When the browser reconnects, the subscription won't exist any more
- Perhaps the client should send a random token and that gets used for all subsequent connections, so that multiple subscription calls all happen on the same SSE stream
- Perhaps the subscribed queries should be stored with that client token, and then unsub all on connection drop + re-subscribe when the connection is re-established
- Or maybe the client needs to store all active queries, and when the SSE drops close it, and re-subscribe all