I was wondering, why a shiny app deployed with Shiny server disconnected often. Took me a long time to figure out, but now I think it has sth. to do with this line of code, which I had in my server function:
session$onSessionEnded(function() {stopApp()})
When I have the app open in two browsers and then close one browser, after about 15 seconds the app will disconnect in the other browser. Removing this line seems to fix it. Maybe someone can add some explanation?