Offline messages lost when user refreshes the page or closes the tab #3734
-
I am using strophe.js as client for ejabberd server. The problem I am facing is that, offline messages are lost when user refreshes the page or closes the tab. I am using anon login. mod_offline is enabled for ejabberd server. auth_method:
- odbc
- anonymous
allow_multiple_connections: true
anonymous_protocol: both Steps to replicate: login to xmpp with full jid. Send negative present to store offline messages for delayed delivery. Messages are getting stored at this step. I can confirm offline message count > 0 using ejabberd get_offline_count API As I refresh the page or close the tab, messages are lost. I can confirm this using ejabberd get_offline_count API If i reconnect again with same jid but different resource for ex. user@domain.com/resource_2, I won't receive any of the offline messages. I am suspecting the ejabberd clears the offline messages for anon users. But I can't find any mention of this online, am I missing something here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Right, that's how it works:
If that cleaning mechanism were not implemented, the database would get polluted with useless offline messages for anonymous accounts that nobody cares at all. An anonymous account is a one-use and destroy account.
Ok, in that scenario from a user perspective, it would be desirable that the chat history is preserved at least some minutes, but not indefinitely. I wonder (like you) how to achieve that. |
Beta Was this translation helpful? Give feedback.
Right, that's how it works:
If that cleaning mechanism were not implemented, the database would get polluted with useless offline messages for anonymous accounts that nobody cares at all.
An anonymous account is a one-use and destroy account.
Ok, in that scenario from a user per…