after stream conflict, presence offline not communicated when server closes connection
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:
A user connects using a particular resource
Before connection process is completed, this user tries to connect again.
Server closes first connection due to conflict is resource id.
Now second connection is working fine.
Latter on this connection is abruptly broken (user didn't send presence unavailable packet).
Server detects broken connection and generates a STREAM_CLOSED packet.
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.
Added by Andrzej Wójcik 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).