What is detached status in session list

Hello Dev team,

I have upgraded the Openfire server version to 4.5.1. I have noticed that in session list i can see Detached status i am not sure what is that can any one explain this ?

Screenshot%20from%202020-03-09%2014-37-07

Thanks,
Hiren vavadiya

Hi Hiren,

This is a feature that relates to XEP-0198: Stream Management: it allows a session that is interrupted to be resumed. This is useful in scenarios where network is unreliable (for example, with mobile phones), to prevent the client to have to re-initialize a new session upon reconnect.

The state detached means that Openfire detected that a client connection is lost (without having been properly closed). Openfire will wait for the client to re-establish the connection. If that does not happen within a few minutes, the session will be marked as closed.

2 Likes

Thanks @guus for the clarifications.

@guus Is there any reason that the user presence keeps getting online in Detached mode? Should not it be offline?

The state ā€˜detachedā€™ represents a scenario where the client unexpectedly lost its connection, and is expected to be back soon. Openfire keeps the session ā€˜aliveā€™ until that time (or until a timeout occurs).

While Openfire keeping the session ā€˜aliveā€™, it should show user presence offline or away.

Think the scenario:
Client see the user online and send messages and those messages will not deliver to the user until the user session resumed. This confuses the client sending messages.

Moreover, when you request last activity of the user, it will return 0 means that user is online.

I think, user presence should not be online in detached mode.

Please read the specification. The user is considered online while the session is detached.

You can control the length of the detached state with the server property ā€œxmpp.session.detach.timeoutā€. When the timer expires, the session is terminated and the presence becomes ā€œofflineā€.