How can I determine if a user is active?

Our backend team is using a new database technology - https://neon.tech/

This lets the database sleep between requests. They want me to ping the server to wake up the database when the users login to the app and then ping the server every x minutes (4 in my case) to keep the database active while they are active on the site.

What I am doing now is using a backend workflow that gets the current user object passed to it. The first action updates the user db, last seen date field. Then it pings the server with a condition - only when Do a search for Users last seen in the last 5 minutes:count > 0

It is working well, but they want me to time out this based on inactivity. Say a user leaves the tab open or walks away from the computer / stops using the site. What can I do to sense for this condition and stop the ping?

Have you considered a Detect Inactivity Plugin on Bubble? It could be effective for managing your ping based on user inactivity.

1 Like

Thank you for posting this. I was not aware of this plugin and it suited the situation brilliantly.

This topic was automatically closed after 70 days. New replies are no longer allowed.