Cancel auto-refresh app in the cloud

I had your application open for more than an hour and there weren’t any refreshes, as far as I can tell. I also tried with one application on main, same result.

Thanks for trying @Goyo. Did you hit “r” to reload the page to simulate a page interaction and update the table of timestamps? New directories seem to me to be getting created every five minutes on the dot.

I’m a bit confused, I just opened it from the link you just provided and see that it’s been refreshing every five minutes. It’s 11:97 AM Eastern and it seems the Streamlit server is 4 hours ahead, and the last regular refresh was indeed at 15:57:33. Note there are also refreshes outside that interval (and more than the number of connections I should be making myself):

What are you seeing on your end in that “Input data in MAWA” table, particularly after you hit “r” to simulate a page interaction?

Thanks so much for your help!

Yes, if I rerun the aplication, the table is updated with new entries. The same happens if I manually refresh the application.

But if I leave the app untouched, the table is not updated. So yes, new directories are being created, but I dont think that’s due to refreshes on my end.

IIUC, a refresh means that the current session is killed, a new session starts and the UI is updated to reflect the state of the new session. Or are we talking about something else?

@Goyo, yes, I think you are right. Thank you. The session is not being refreshed. It’s just that new directories are being created exactly every five minutes. If you or anybody has any thoughts on why that might be happening (I’m using the tempfile module), I’d appreciate it, but I acknowledge that’s a separate issue and I apologize for miscategorizing it. @mathcatsand

One actually related issue might be that I left the app running on the cloud and came back to it a few hours later, and briefly saw “CONNECTING…” in the top right corner. Then, when I hit “r” (to simulate an interaction, not a true refresh), the session did fully refresh.

Is it expected that after a certain amount of idle time, what’s in the session state will be lost even if the tab remains open? What is the length of this idle time?

I am out of ideas. I tried to deploy your streamlit cloud bracnch for some testing but I wasn’t even able to make it work.

No worries, I really appreciate you trying @Goyo.

As far as I know, if a websocket disconnects and does not reconnect for some period of time, the session will be lost.

If you look at the release notes for 1.21.0, websocket timeouts were increased to 15 seconds here. So if I understand correctly, if your computer goes to sleep and stops keeping the websocket connection alive, the session will be lost. This happens a lot on mobile devices which drop connections when not in use to save bandwidth. Therefore, browser settings come into play here. (I don’t have a super deep understanding of how it all works, though.) I think there is an additional consideration from the Community Cloud that times out the connection in some way, but I still don’t have a solid understanding.

Thanks very much @mathcatsand, I really appreciate this information!

I do have the same problem with my App running Streamlit Version 1.39.0 deployed to Community Cloud.
I’m filling st.multiselect with items retrieved by an API call. Before calling the API I do check if the values a already present in the session_state. I seems that after 5 min inactivity the page is refreshed (all 5 minutes) and the session_state is no longer valid resulting in calling the API every 5min.
|pineconenapi|2024-10-30 17:20:15.057000+00:00|
|pineconenapi|2024-10-30 17:15:15.069000+00:00|
|pineconenapi|2024-10-30 17:10:15.023000+00:00|
|pineconenapi|2024-10-30 17:05:15.146000+00:00|

Anyone any ideas meanwhile?

Same here. My app refreshes automatically every minute

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