I have deployed a shiny application with shiny server open source.
The app should not grey out as long as a user has the browser tab open. This is something people are not used to when interacting with websites.
So I set the app_idle_timeout option to 0. This seems to work, but now every 30 seconds a popup is opening for some millisesonds in the bottom left corner (It says 'Attempting to reconnect'). Is there a way to hide this popup because it is distracting?
It is strange and I do not know, why this timeouts happen. It does not matter if the user interacts with the app or does nothing. Every 30 seconds there is a disconnect.
I think I misunderstood the app_idle_timeout option as this does not have something to do with it, right? It only affects, what happens after a user closes the browser tab, or?
The clock above will update every 5 seconds to a value that is above the window. This css prevents users from seeing the value, but since something is sent every 5 seconds, the websocket is kept alive.
@barret Thanks, but it does not help. I think this issue is directly linked to the way I deployed the shiny server. I am running this as a Kubernetes Deployment in Google Cloud. An ingress with a https load balancer makes the app available to the outside. In the documentation in External Application Load Balancer overview | Load Balancing | Google Cloud I found that there is a 30 second timeout:
A configurable response timeout , which represents the amount of time the load balancer will wait for your backend to return a complete response.The default value is 30 seconds. Consider increasing this timeout under these circumstances:
If you expect a backend to take longer to return HTTP responses, or
If the connection is upgraded to a WebSocket.
When I change this timeout to 45 seconds, I will see the disconnects and reconnects after 45 seconds. So it's directly linked to this setting. But I still do not understand why do I loose the websocket connection between app and browser at all and what can be done to prevent this?
These are the configuration files of my ingress and service: