Closed crcastle closed 4 years ago
@crcastle It currently tries to reconnect to the websocket every 1 second. I’ve seen this issue once and when it happened 404 was returned when the app tried to load the image user uploaded from the selfie app. When I checked the url, the image actually existed. So possibly, sometimes the image doesn’t get populated right away? I'll keep digging.
Ok so pinging and reconnecting are different. I will implement pinging.
@crcastle I confirm the client side tries to reconnect to the websocket connection if it dies. Also, I added code to ping the server every 25 seconds, however, there is not ping method so I'm just sending a message. What do you think? https://github.com/heroku/friends-from-the-trail-demo/pull/11/files#diff-2018087f584c4398b5c3a23fc0e5f9dbR18
I have a suspicion this is related to websocket connection timeout. Heroku HTTP (or websocket) connections timeout after a certain period of time with no data sent from either side. I recommend making a websocket
ping
request from the client every 25 seconds to mitigate this. See here for more info https://devcenter.heroku.com/articles/websockets#timeoutsAlso, can can you confirm that the browser tries to reconnect the websocket connection if it dies, and if not add that? Conference internet connections can be flakey, and I wonder if intermittent connectivity issues might have cause this too.