Subscribe - any timeout on particle side?

Hi guys,
I ran into a problem with the long running web app subscribing for the SSE stream. So far I cannot easily reproduce this since this issue seems to appear only after many hours. The web app reconnects to SSE stream if the network connection is lost and back. However, I think that maybe the app does not reconnect properly if the SSE stream is disconnected on the server site.

Maybe someone already know if the particle cloud has any timeouts for the long running connections to the SSE stream?

What SSE client are you using from your web app? particle-api-js from node.js?

The current versions of particle-api-js detect when the server closed the socket and will reconnect. Not all SSE clients handle this properly, and old versions of particle-api-js (from more than a year or so ago), did not.

There is no maximum lifetime for SSE sessions, however the SSE server may disconnect clients at any time so you should expect that could happen. Server nodes could be rebooted, moved to other clusters, etc…

1 Like

Roger that! It’s a angular app. So far I used vanilla EventSource. After some research it seems that browsers do not act in a consistent way while dealing with EventSource disconnects. This needs some code to deal with disconnects and reconnects properly.


/G

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.