widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.9k stars 140 forks source link

Sessions timeout / websocket disconnect #161

Closed yugosuz closed 1 year ago

yugosuz commented 1 year ago

Thanks for the great project! I am developing an app for annotating data, but some data is difficult to discern and takes a long time, and it is quite difficult to use if the session expires at that time. Is it possible to extend the session expiration date? If there is information on this in the documentation or something, I apologize.

maartenbreddels commented 1 year ago

You mean the disconnect when you get the popup?
This should not happen, and only happens if the computer goes into standby, or the connection to the server gets interrupted. Is that the case? We do have a WIP branch that will re-connect and restore the 'session'/'connection'.

yugosuz commented 1 year ago

You mean the disconnect when you get the popup?

Yes. Could this also happen when a window other than the Solara app has been selected for a while? If it's not designed that way, perhaps it's because I'm deploying with Cloud Run and that's what's causing it.

maartenbreddels commented 1 year ago

Yes, some cloud hosting services close long running connections like websockets.

Looking at https://cloud.google.com/run/docs/triggering/websockets it seems like 5 minutes is the default, and it can be increased to 60. Does that help you?

yugosuz commented 1 year ago

Thanks for letting me know! That seems to solve the problem. Sorry for the inconvenience caused by my lack of knowledge.

maartenbreddels commented 1 year ago

Not at all, this is an issue we want to improve. Thank you for your feedback! I re-opened this so we can close it when we fix it