Last logouts are not recorded when server is shut down
It you shut down the server, the last logout information for users is never updated.
@Gaston: I've implemented your suggestion. Can you review?
Removing the 'fix version' for all unresolved issues that were scheduled for version 7.8.2. We're releasing this version today - the remaining issues should be rescheduled later.
XMPPServer#shutdownServer is executed when shutting down the server which in turn stops the server's modules. When the RoutingTableImpl module is stopped it will disconnect clients connected to that JVM only and it sends the stream error condition system-shutdown. That is how all connected clients get disconnected.
Before disconnecting the clients presences of users are not updated (which makes sense for performance reason). However the consequence of this is that the logic in PresenceUpdateHandler#process is never triggered thus the code in PresenceManagerImpl#userUnavailable is never reached so logout timestamp is never stored in the database.
An option to solve this problem in an efficient way to to change PresenceManagerImpl to implement the XMPPServerListener interface and listen to the event of shutdown. This event is triggered before modules are stopped. The PresenceManagerImpl can then update the log out time for each connected user to that JVM.