I want to build a chat application with a stateless server as backend. Users have an online and offline status. When a user connects to the server, the server marks that user as online.
Now imagine a user disconnects because his battery died. The user can not notify the server he is going offline. How would a stateless server make sure the user will be marked offline in that scenario? The server MUST keep some sort of state of the user, right?
Every user is coupled to a user_id UUID primary key in the database in table User which has the status column. I think the server must keep track of the user_id in order to mark the user as offline on disconnect, right?.
I was wondering if it is possible to implement disconnect events in a truly stateless server.