Reputation: 151
I recently developed an instant message website using Ejabberd and it seems that some of the messages are being sent twice. Here are the details of the situation.
User A sent multiple message to User B, with the format:
<body rid='1874291086' xmlns='http://jabber.org/protocol/httpbind' sid='33549457dc8ad98caceedbb648178f26683fcf8a'>
<message to='284@ejabberd' from='282@ejabberd' type='chat' xmlns='jabber:client' id='efdf6155-a661-46eb-9b54-88b2790f492a'>
<body>1</body>
<data timestamp='1501136608657'/>
<request xmlns='urn:xmpp:receipts'/></message>
</body>
While B receipts the message, returning:
<body xmlns='http://jabber.org/protocol/httpbind'>
<message xmlns='jabber:client' xml:lang='en' to='282@ejabberd/9495456281346940375146' from='284@ejabberd/12680356801999428401210' id='5b1d7c22-381c-4332-a4c9-bc9443a9d296'>
<received xmlns='urn:xmpp:receipts' id='efdf6155-a661-46eb-9b54-88b2790f492a'/>
</message>
</body>
After a few minutes either of the client would receive:
<body xmlns='http://jabber.org/protocol/httpbind'>
<presence xmlns='jabber:client' to='282@ejabberd/13236655690203912299484' from='282@ejabberd/964025387189976270180' type='unavailable'>
<status xml:lang='en'>Connection failed: connection closed</status>
</presence>
</body>
The client which receives the above message would send the ping
<body rid='872290555' xmlns='http://jabber.org/protocol/httpbind' sid='cc0604ed5e728d88216c3bb9124fc39ed574cf5b'/>
and that client would again receive all the message that sent to it previously
<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns='jabber:client' xml:lang='en' to='282@ejabberd/13236655690203912299484' from='284@ejabberd/17094073157455939286404' type='chat'>
<composing xmlns='http://jabber.org/protocol/chatstates'/></message>
... all the messages ...
</body>
I am using Strophe and Ejabberd 17.04, connecting from 5280 port with http-bind, with mod_mam and mod_muc disabled. I do have the logs from Ejabberd but it's pretty large, I could provide if necessary.
The messages would resent every time the client lost the connection, and every single one of the message that is sent to the user will be delivered again.
I am having the annoying issues for a few days, any suggestion would be greatly appreciated. Thank you for your time:)
Upvotes: 0
Views: 485