Is there an event that occurs on the Realm server when a user disconnects or the connection times out? If there is, how do we hook into that event?
The reason I am asking is we are attempting (again) to come up with some way to prevent objects from being deleted while they are ‘in use’.
For example; imagine a multi-user To Do app where users can view each others To Do’s. If user A opens a To Do to read it, at the same time user B selects that To Do and deletes it.
There’s nothing to prevent that from happening as Realm does not support Object Locking or any other kind of normal database option for indicating an object is being modified or in use.
A simple but impractical solution is to set a flag on that object when it’s opened (being read) but what if that user force-quits the app or disconnects? There’s no way to re-set that flag so other users could continue to work with that To Do.
If the server were aware of the disconnect and we had access to that event, the flag could be reset at that time.