I have a node in Firebase Realtime Database which saves a boolean value true or false along with some more attributes. If and only if this key is false, then I allow the user to perform write operations on the same node in database.
When user has did the task, this value is again set back to false. This is like the critical section concept of the operating systems i.e., only one user can perform a task at a time.
It works as I intended, but the issue I am facing is if user has changed this value to true, and but due to bad network or something he/she is not writing on the database. Now, no one can write on that node on database.
I would like to add a time-interval functionality, if user has not performed any write operation for some interval, say 10 minutes and the boolean is true. Then, I would like to set it to false.
I know that Firebase Cloud Function triggers only on database write, update and create operations. Please suggest me something to handle this issue or some other ways by which I can perform it. There is no code snippet regarding this functionality anywhere. I have looked up various resources on internet, brainstormed myself, I could get nothing.