MongooseIM icon indicating copy to clipboard operation
MongooseIM copied to clipboard

Offline message queue full due to chat state notification?

Open theanhoo opened this issue 4 years ago • 1 comments

MongooseIM version: 3.5.0 Installed from: source Erlang/OTP version: 20

Does MongooseIM (3.5.0) keep chat state notifications in the offline message queue? I kept getting this:

<message xmlns='jabber:client' to='[email protected]/mobile' from='[email protected]' id='b830b979-9d6d-40a6-9be3-c0ffb4331161' xml:lang='en' type='error'><error type='wait'><resource-constraint xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Your contact offline message queue is full. The message has been discarded.</text></error><body>Qwerty</body><item-type xmlns="chat.somewhere.com" type="1" mime-type="" /><markable xmlns='urn:xmpp:chat-markers:0'/><stanza-id xmlns='urn:xmpp:sid:0' id='B8R8FMSA5EO1' by='[email protected]'/></message>, <error xmlns='jabber:client' type='wait'><resource-constraint xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/><text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Your contact offline message queue is full. The message has been discarded.</text></error>
<message xmlns='jabber:client' to='[email protected]/mobile' from='[email protected]' id='0cAuo-601' xml:lang='en' type='error'><error type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error><composing xmlns='http://jabber.org/protocol/chatstates'/></message>, <error xmlns='jabber:client' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error>

Chat state notifications seem to causing the offline message queue to fill up really quick. Is there a way to turn this off in mod_offline using unless_chat_state?

Many thanks in advance.

theanhoo avatar Apr 16 '20 14:04 theanhoo

Hi @theanhoo, thanks for contacting us.

It's hard to say if chat state notifications are the root cause of the full offline storage. The code responsible for storing offline messages tries to filter out chat state notifications but if the message stanza contains some other elements, other than just the chat state notification it may happen that such a stanza goes into the archive.

I suggest taking a look at all the messages which are in the full offline storage, you can do it in MongooseIM shell (mongooseimctl debug) by calling doing a call similar to the one:

mod_offline_backend:fetch_messages(<<"username">>, <<"the.domain.com">>).

Of course, username and the.domain.com from my example needs to be replaced with correct values for a user you know has full offline storage.

michalwski avatar Apr 24 '20 07:04 michalwski