after stream conflict, presence offline not communicated when server closes connection

Nauman Bashir
Added over 4 years ago


We have some custom components that rely on presence information. We have written a plugin that implements XMPPPresenceUpdateProcessorIfc, to get presence information from server. This plugin than forwards this information to our components.

This works fine in normal cases. However we noticed a case when server closes a connection, and does not generate a presence unavailable packet.

The scenario is:

  1. A user connects using a particular resource

  2. Before connection process is completed, this user tries to connect again.

  3. Server closes first connection due to conflict is resource id.

  4. Now second connection is working fine.

  5. Latter on this connection is abruptly broken (user didn't send presence unavailable packet).

  6. Server detects broken connection and generates a STREAM_CLOSED packet.

  7. At this point it is expected that server will generate a presence offline packet for this user and send to session manager.

Log files are attached. Stream conflict is in tigase.log.30, line 11729. STREAM_CLOSED in tigase.log.29, line 7971

We are using tigase 5.2.0 release.

Replies (5)


Added by Artur Hefczyc TigaseTeam over 4 years ago

I have created a ticket in our system and added you to watchers: #2057

Added by Nauman Bashir over 4 years ago

Thank you for looking into it & quick response.

Presence functionality is critical to our application. Can you please suggest some quick fix/work around that we can implement for the time being.


Added by Artur Hefczyc TigaseTeam over 4 years ago

We need to investigate it first to find out why this actually happens.

Added by Andrzej Wójcik IoT 1 CloudTigaseTeam over 4 years ago

I tried to replicate issue but I always received presence unavailable packet when my connection was broken (even after resource conflict as mentioned). I looked into code to see in what situation I may not receive presence unavailable when connection is broken - I found that it may happen only if particular connection never sent initial presence (except from cases when exception might be thrown during processing - but no exception appeared in log).

After that I checked attached logs once again looking for initial presence being sent from client (and processed by @sess-man@) between resource conflict (binding on second connection) and time when client connection was broken but I could not found initial presence in this period of time, so Tigase XMPP Server could not sent presence as it never received initial presence on second connection (connection which caused resource conflict).


Added by Artur Hefczyc TigaseTeam over 4 years ago

Thank you Andrzej for looking into this. I am rejecting the issue related to the topic then.